ScreenSaver.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:96k
源码类别:

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  *
  37.  * Filename:
  38.  * ---------
  39.  * ScreenSaver.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *   This file is intends for Screen Saver application
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * removed!
  78.  *
  79.  * removed!
  80.  * removed!
  81.  * removed!
  82.  *
  83.  * removed!
  84.  * removed!
  85.  * removed!
  86.  *
  87.  * removed!
  88.  * removed!
  89.  * removed!
  90.  *
  91.  * removed!
  92.  * removed!
  93.  * removed!
  94.  *
  95.  * removed!
  96.  * removed!
  97.  * removed!
  98.  *
  99.  * removed!
  100.  * removed!
  101.  * removed!
  102.  *
  103.  * removed!
  104.  * removed!
  105.  * removed!
  106.  *
  107.  * removed!
  108.  * removed!
  109.  * removed!
  110.  *
  111.  * removed!
  112.  * removed!
  113.  * removed!
  114.  *
  115.  * removed!
  116.  * removed!
  117.  * removed!
  118.  *
  119.  * removed!
  120.  * removed!
  121.  * removed!
  122.  *
  123.  * removed!
  124.  * removed!
  125.  * removed!
  126.  *
  127.  * removed!
  128.  * removed!
  129.  * removed!
  130.  *
  131.  * removed!
  132.  * removed!
  133.  * removed!
  134.  *
  135.  * removed!
  136.  * removed!
  137.  * removed!
  138.  *
  139.  * removed!
  140.  * removed!
  141.  * removed!
  142.  *
  143.  * removed!
  144.  * removed!
  145.  * removed!
  146.  *
  147.  * removed!
  148.  * removed!
  149.  * removed!
  150.  *
  151.  * removed!
  152.  * removed!
  153.  * removed!
  154.  *
  155.  * removed!
  156.  * removed!
  157.  * removed!
  158.  *
  159.  * removed!
  160.  * removed!
  161.  * removed!
  162.  *
  163.  * removed!
  164.  * removed!
  165.  * removed!
  166.  *
  167.  * removed!
  168.  * removed!
  169.  * removed!
  170.  *
  171.  * removed!
  172.  * removed!
  173.  * removed!
  174.  *
  175.  * removed!
  176.  * removed!
  177.  * removed!
  178.  *
  179.  * removed!
  180.  * removed!
  181.  * removed!
  182.  *
  183.  * removed!
  184.  * removed!
  185.  * removed!
  186.  *
  187.  * removed!
  188.  * removed!
  189.  * removed!
  190.  *
  191.  * removed!
  192.  * removed!
  193.  * removed!
  194.  *
  195.  * removed!
  196.  * removed!
  197.  * removed!
  198.  *
  199.  * removed!
  200.  * removed!
  201.  * removed!
  202.  *
  203.  * removed!
  204.  * removed!
  205.  * removed!
  206.  *
  207.  * removed!
  208.  * removed!
  209.  * removed!
  210.  *
  211.  * removed!
  212.  * removed!
  213.  * removed!
  214.  *
  215.  * removed!
  216.  * removed!
  217.  * removed!
  218.  *
  219.  * removed!
  220.  * removed!
  221.  * removed!
  222.  *
  223.  * removed!
  224.  * removed!
  225.  * removed!
  226.  *
  227.  * removed!
  228.  * removed!
  229.  * removed!
  230.  *
  231.  *------------------------------------------------------------------------------
  232.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  233.  *============================================================================
  234.  ****************************************************************************/
  235. #ifndef _SCREENSAVER_C
  236. #define _SCREENSAVER_C
  237. /***************************************************************************** 
  238. * Include
  239. *****************************************************************************/
  240. #include "MMI_features.h"
  241. #include "stdC.h"
  242. #include "L4Dr1.h"
  243. #include "PixtelDataTypes.h"
  244. #include "Unicodexdcl.h"
  245. #include "NVRAMType.h"
  246. #include "NVRAMProt.h"
  247. #include "NVRAMEnum.h"
  248. #include "DownloadDefs.h"
  249. #include "CommonScreens.h"
  250. #include "CustDataRes.h"
  251. #include "EventsGprot.h"
  252. #include "historyGprot.h"
  253. #include "ProtocolEvents.h"
  254. #include "CustMenuRes.h"
  255. #include "wgui_categories.h"
  256. #include "wgui_categories_idlescreen.h"
  257. #include "MainMenuDef.h"
  258. #include "TimerEvents.h"
  259. #include "SettingProfile.h"
  260. #include "GlobalDefs.h"
  261. #if defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__)
  262. #if defined(__MMI_POWER_ON_OFF_DISPLAY__)
  263.    /* MUST be allocated before WallpaperDefs.h */
  264. #include "PowerOnOffDisplayDefs.h"
  265. #endif /* defined(__MMI_POWER_ON_OFF_DISPLAY__) */ 
  266. #include "wgui_categories_multimedia.h" /* ShowCategory331Screen() */
  267. #include "Gdi_include.h"        /* GDI_RESULT */
  268. #include "VdoPlyStrEnum.h"
  269. #endif /* defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) */ 
  270. #include "ScreenSaverDefs.h"
  271. #include "WallpaperDefs.h"
  272. #include "WPSSProtos.h"
  273. #include "wgui_inline_edit.h"
  274. #include "DownloadProtos.h"
  275. #include "DebugInitDef.h"
  276. #include "HistoryGprot.h"
  277. #include "SettingDefs.h"
  278. #include "SettingProt.h"
  279. #include "PhoneSetup.h"
  280. #include "IdleAppDef.h"
  281. #ifdef __MMI_FILE_MANAGER__
  282. #include "FileMgr.h"
  283. #endif 
  284. #include "FileManagerGProt.h"
  285. #include "Conversions.h"
  286. #include "DebugInitDef.h"
  287. #ifdef __MMI_THEMES_V2_SUPPORT__
  288. #include "MMIThemes.h"  /* ritesh */
  289. #endif 
  290. #if defined(__MMI_RESOURCE_ENFB_SUPPORT__)
  291. #include "ResMemMgrGprot.h"
  292. #endif /* defined(__MMI_RESOURCE_ENFB_SUPPORT__) */
  293. /***************************************************************************** 
  294. * Local Variable
  295. *****************************************************************************/
  296. static PS8 error_str_ptr;
  297. static U8 ss_item_amount;
  298. /***************************************************************************** 
  299. * External Variable
  300. *****************************************************************************/
  301. #ifdef __MMI_FILE_MANAGER__
  302. extern PHNSET_WPSS_FILENAME_STRUCT phnset_wpss_filename;
  303. #endif
  304. /***************************************************************************** 
  305. * External Function
  306. *****************************************************************************/
  307. extern void PhnsetWpUsrDefPreView(void);
  308. extern U8 PhnsetGetDefEncodingType(void);
  309. /*****************************************************************************
  310.  * FUNCTION
  311.  *  HighlightPhnsetScreenSaver
  312.  * DESCRIPTION
  313.  *  This function is highlight handler for Phonesetup->IdleScreenDisplay->ScreenSaver
  314.  *  Following Functions:   EntryPhnsetScrSvr
  315.  * PARAMETERS
  316.  *  void
  317.  *  a(?)        [IN/OUT]        Void
  318.  *  b(?)        [IN]            Void
  319.  * RETURNS
  320.  *  void
  321.  *****************************************************************************/
  322. void HighlightPhnsetScreenSaver(void)
  323. {
  324.     /*----------------------------------------------------------------*/
  325.     /* Local Variables                                                */
  326.     /*----------------------------------------------------------------*/
  327.     /*----------------------------------------------------------------*/
  328.     /* Code Body                                                      */
  329.     /*----------------------------------------------------------------*/
  330.     g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_SS;
  331.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  332.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  333.     SetKeyHandler(EntryPhnsetScrSvr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  334.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  335.     SetLeftSoftkeyFunction(EntryPhnsetScrSvr, KEY_EVENT_UP);
  336.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  337. }
  338. /*****************************************************************************
  339.  * FUNCTION
  340.  *  HighlightPhnsetScrSvrSetting
  341.  * DESCRIPTION
  342.  *  This function is highlight handler for Phonesetup->IdleScreenDisplay->ScreenSaver -> Setting
  343.  *  Following Functions:   EntryPhnsetScrSvrSettings
  344.  * PARAMETERS
  345.  *  void
  346.  *  a(?)        [IN/OUT]        Void
  347.  *  b(?)        [IN]            Void
  348.  * RETURNS
  349.  *  void
  350.  *****************************************************************************/
  351. void HighlightPhnsetScrSvrSetting(void)
  352. {
  353.     /*----------------------------------------------------------------*/
  354.     /* Local Variables                                                */
  355.     /*----------------------------------------------------------------*/
  356.     /*----------------------------------------------------------------*/
  357.     /* Code Body                                                      */
  358.     /*----------------------------------------------------------------*/
  359.     SetLeftSoftkeyFunction(EntryPhnsetScrSvrSettings, KEY_EVENT_UP);
  360.     SetKeyHandler(EntryPhnsetScrSvrSettings, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  361. }
  362. /*****************************************************************************
  363.  * FUNCTION
  364.  *  HighlightPhnsetScrSvrSelect
  365.  * DESCRIPTION
  366.  *  This function is highlight handler for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select
  367.  *  Following Functions:   EntryPhnsetScrSvrSystem ( EntryScrSaverSystem //Wap Disable )
  368.  * PARAMETERS
  369.  *  void
  370.  *  a(?)        [IN/OUT]        Void
  371.  *  b(?)        [IN]            Void
  372.  * RETURNS
  373.  *  void
  374.  *****************************************************************************/
  375. void HighlightPhnsetScrSvrSelect(void)
  376. {
  377.     /*----------------------------------------------------------------*/
  378.     /* Local Variables                                                */
  379.     /*----------------------------------------------------------------*/
  380.     /*----------------------------------------------------------------*/
  381.     /* Code Body                                                      */
  382.     /*----------------------------------------------------------------*/
  383. #if (defined(__MMI_FILE_MANAGER__) && !defined(__MMI_FILE_MANAGER_HIDE_MENU__))
  384.     /* Display 2 menuitems: System, User Defined */
  385.     SetLeftSoftkeyFunction(EntryPhnsetScrSvrSelect, KEY_EVENT_UP);
  386.     SetKeyHandler(EntryPhnsetScrSvrSelect, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  387. #else /* (defined(__MMI_FILE_MANAGER__) && !defined(__MMI_FILE_MANAGER_HIDE_MENU__)) */ 
  388.     /* Download and File Manager not exist, go to system screen saver list directly */
  389.     SetLeftSoftkeyFunction(EntryPhnsetScrSvrSystem, KEY_EVENT_UP);
  390.     SetKeyHandler(EntryPhnsetScrSvrSystem, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  391.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  392. #endif /* (defined(__MMI_FILE_MANAGER__) && !defined(__MMI_FILE_MANAGER_HIDE_MENU__)) */ 
  393. }
  394. /*****************************************************************************
  395.  * FUNCTION
  396.  *  HighlightPhnsetScrSvrSystem
  397.  * DESCRIPTION
  398.  *  This function is highlight handler for Phonesetup->IdleScreenDisplay->ScreenSaver -> (Select) -> System
  399.  *  Following Functions:   EntryPhnsetScrSvrSystem
  400.  * PARAMETERS
  401.  *  void
  402.  *  a(?)        [IN/OUT]        Void
  403.  *  b(?)        [IN]            Void
  404.  * RETURNS
  405.  *  void
  406.  *****************************************************************************/
  407. #if defined(__MMI_FILE_MANAGER__)
  408. void HighlightPhnsetScrSvrSystem(void)
  409. {
  410.     /*----------------------------------------------------------------*/
  411.     /* Local Variables                                                */
  412.     /*----------------------------------------------------------------*/
  413.     /*----------------------------------------------------------------*/
  414.     /* Code Body                                                      */
  415.     /*----------------------------------------------------------------*/
  416.     SetLeftSoftkeyFunction(EntryPhnsetScrSvrSystem, KEY_EVENT_UP);
  417.     SetKeyHandler(EntryPhnsetScrSvrSystem, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  418. }
  419. #endif /* defined(__MMI_FILE_MANAGER__) */ 
  420. /*****************************************************************************
  421.  * FUNCTION
  422.  *  HighlightPhnsetScrSvrFmgr
  423.  * DESCRIPTION
  424.  *  ...
  425.  * PARAMETERS
  426.  *  void
  427.  *  a(?)        [IN/OUT]        Void
  428.  *  b(?)        [IN]            Void
  429.  * RETURNS
  430.  *  void
  431.  *****************************************************************************/
  432. #if defined(__MMI_FILE_MANAGER__)
  433. void HighlightPhnsetScrSvrFmgr(void)
  434. {
  435.     /*----------------------------------------------------------------*/
  436.     /* Local Variables                                                */
  437.     /*----------------------------------------------------------------*/
  438.     /*----------------------------------------------------------------*/
  439.     /* Code Body                                                      */
  440.     /*----------------------------------------------------------------*/
  441.     g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_SS;
  442.     SetLeftSoftkeyFunction(EntryPhnsetWallpaperFmgr /* EntryPhnsetScrSvrFmgr */ , KEY_EVENT_UP);
  443.     SetKeyHandler(EntryPhnsetWallpaperFmgr /* EntryPhnsetScrSvrFmgr */ , KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  444. }
  445. #endif /* defined(__MMI_FILE_MANAGER__) */ 
  446. /*****************************************************************************
  447.  * FUNCTION
  448.  *  HintPhnsetScrSvrSetting
  449.  * DESCRIPTION
  450.  *  This function is hint handler for Phonesetup->IdleScreenDisplay->ScreenSaver -> Setting
  451.  *  Following Functions:
  452.  * PARAMETERS
  453.  *  index       [IN]            
  454.  *  a(?)        [IN/OUT]        Void
  455.  *  b(?)        [IN]            Void
  456.  * RETURNS
  457.  *  void
  458.  *****************************************************************************/
  459. void HintPhnsetScrSvrSetting(U16 index)
  460. {
  461.     /*----------------------------------------------------------------*/
  462.     /* Local Variables                                                */
  463.     /*----------------------------------------------------------------*/
  464.     /*----------------------------------------------------------------*/
  465.     /* Code Body                                                      */
  466.     /*----------------------------------------------------------------*/
  467.     switch (PhnsetGetCurScrSvrStatus())
  468.     {
  469.         case SET_SS_STATUS_ON:
  470.             pfnUnicodeStrcpy((PS8) hintData[index], GetString(STR_GLOBAL_ON));
  471.             break;
  472.     #ifdef __MMI_LCD_PARTIAL_ON__
  473.         case SET_SS_STATUS_POWERSAVING:
  474.             pfnUnicodeStrcpy((PS8) hintData[index], GetString(STR_SCREENSAVER_DISPLAY_TIME));
  475.             break;
  476.     #endif /* __MMI_LCD_PARTIAL_ON__ */ 
  477.         default:
  478.             pfnUnicodeStrcpy((PS8) hintData[index], GetString(STR_GLOBAL_OFF));
  479.             break;
  480.     }
  481. }
  482. /*****************************************************************************
  483.  * FUNCTION
  484.  *  HintPhnsetScrSvrSelect
  485.  * DESCRIPTION
  486.  *  This function is hint handler for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select
  487.  *  Following Functions:
  488.  * PARAMETERS
  489.  *  index       [IN]            
  490.  *  a(?)        [IN/OUT]        Void
  491.  *  b(?)        [IN]            Void
  492.  * RETURNS
  493.  *  void
  494.  *****************************************************************************/
  495. void HintPhnsetScrSvrSelect(U16 index)
  496. {
  497.     /*----------------------------------------------------------------*/
  498.     /* Local Variables                                                */
  499.     /*----------------------------------------------------------------*/
  500.     /*----------------------------------------------------------------*/
  501.     /* Code Body                                                      */
  502.     /*----------------------------------------------------------------*/
  503.     PS8 p = PhnsetGetCurScrSvrName();
  504.     if (p)
  505.     {
  506.         pfnUnicodeStrcpy((PS8) hintData[index], p);
  507.     }
  508. }
  509. /*****************************************************************************
  510.  * FUNCTION
  511.  *  EntryPhnsetScrSvr
  512.  * DESCRIPTION
  513.  *  This function is Entry function for Phonesetup->IdleScreenDisplay->ScreenSaver
  514.  *  Following Functions:
  515.  * PARAMETERS
  516.  *  void
  517.  *  a(?)        [IN/OUT]        Void
  518.  *  b(?)        [IN]            Void
  519.  * RETURNS
  520.  *  void
  521.  *****************************************************************************/
  522. void EntryPhnsetScrSvr(void)
  523. {
  524.     /*----------------------------------------------------------------*/
  525.     /* Local Variables                                                */
  526.     /*----------------------------------------------------------------*/
  527.     U8 *guiBuffer;
  528.     U16 ScreenSaverScrText[MAX_SUB_MENUS];
  529.     U8 *ScreenSaverHintsList[MAX_SUB_MENUS];
  530.     U16 nNumofItem;
  531.     /*----------------------------------------------------------------*/
  532.     /* Code Body                                                      */
  533.     /*----------------------------------------------------------------*/
  534.     EntryNewScreen(SCR_MAIN_SCREENSAVER, NULL, EntryPhnsetScrSvr, NULL);
  535.     g_phnset_cntx_p->ScrAnchor = SCR_MAIN_SCREENSAVER;
  536.    /***** Set Hint/Hightlight Handler *****/
  537.     SetHintHandler(MENU_SETTING_SS_SETTING, HintPhnsetScrSvrSetting);
  538.     SetHintHandler(MENU_SETTING_SS_SELECT, HintPhnsetScrSvrSelect);
  539.     SetHiliteHandler(MENU_SETTING_SS_SETTING, HighlightPhnsetScrSvrSetting);
  540.     SetHiliteHandler(MENU_SETTING_SS_SELECT, HighlightPhnsetScrSvrSelect);
  541. #if defined(__MMI_FILE_MANAGER__)
  542.     SetHiliteHandler(MENU_SELECT_SS_SELECT_SYSTEM, HighlightPhnsetScrSvrSystem);
  543.     SetHiliteHandler(MEUN_SELECT_SS_SELECT_DOWNLOAD, HighlightPhnsetScrSvrFmgr);
  544. #endif /* defined(__MMI_FILE_MANAGER__) */ 
  545.       /***** End of Hint/Hightlight Handler *****/
  546.     guiBuffer = GetCurrGuiBuffer(SCR_MAIN_SCREENSAVER);
  547.     nNumofItem = GetNumOfChild(MENU_SETTING_SCR_SVR);
  548.     GetSequenceStringIds(MENU_SETTING_SCR_SVR, ScreenSaverScrText);
  549.     SetParentHandler(MENU_SETTING_SCR_SVR);
  550.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  551.     /* Set Hint Handler of Select to NULL if Screen Saver is Off */
  552.     if (PhnsetGetCurScrSvrStatus() == SET_SS_STATUS_ON)
  553.     {
  554.         SetHintHandler(MENU_SETTING_SS_SELECT, HintPhnsetScrSvrSelect);
  555.     }
  556.     else
  557.     {
  558.         SetHintHandler(MENU_SETTING_SS_SELECT, NULL);
  559.     }
  560.     ConstructHintsList(MENU_SETTING_SCR_SVR, ScreenSaverHintsList);
  561.     ShowCategory52Screen(
  562.         STR_SCR_SCREENSAVER_CAPTION,
  563.         IMG_SCR_SETTING_CAPTION,
  564.         STR_GLOBAL_OK,
  565.         IMG_GLOBAL_OK,
  566.         STR_GLOBAL_BACK,
  567.         IMG_GLOBAL_OK,
  568.         nNumofItem,
  569.         ScreenSaverScrText,
  570.         (PU16) gIndexIconsImageList,
  571.         ScreenSaverHintsList,
  572.         1,
  573.         0,
  574.         guiBuffer);
  575.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  576.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  577. }
  578. /* 
  579.  * Phonesetup->IdleScreenDisplay->ScreenSaver -> Setting
  580.  */
  581. /*****************************************************************************
  582.  * FUNCTION
  583.  *  PhnsetScrSvrInlineHiliteHdlr
  584.  * DESCRIPTION
  585.  *  This function is Inline selection highlight handler for Phonesetup->IdleScreenDisplay->ScreenSaver -> Setting
  586.  *  Following Functions:   PhnsetScrSvrSettingLskHdlr
  587.  * PARAMETERS
  588.  *  nIndex      [IN]            
  589.  *  a(?)        [IN/OUT]        Void
  590.  *  b(?)        [IN]            Void
  591.  * RETURNS
  592.  *  void
  593.  *****************************************************************************/
  594. void PhnsetScrSvrInlineHiliteHdlr(S32 nIndex)
  595. {
  596.     /*----------------------------------------------------------------*/
  597.     /* Local Variables                                                */
  598.     /*----------------------------------------------------------------*/
  599.     /*----------------------------------------------------------------*/
  600.     /* Code Body                                                      */
  601.     /*----------------------------------------------------------------*/
  602.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  603.     SetCategory57LeftSoftkeyFunction(PhnsetScrSvrSettingLskHdlr);
  604. }
  605. #ifdef __MMI_LCD_PARTIAL_ON__
  606. /*****************************************************************************
  607.  * FUNCTION
  608.  *  PhnsetScrSvrInlineStatusSelectHiliteHdlr
  609.  * DESCRIPTION
  610.  *  Highlight handler of the inline select for screen saver status
  611.  * PARAMETERS
  612.  *  item_index      [IN]            
  613.  *  a(?)            [IN/OUT]        Void
  614.  *  b(?)            [IN]            Void
  615.  * RETURNS
  616.  *  void
  617.  *****************************************************************************/
  618. void PhnsetScrSvrInlineStatusSelectHiliteHdlr(S32 item_index)
  619. {
  620.     /*----------------------------------------------------------------*/
  621.     /* Local Variables                                                */
  622.     /*----------------------------------------------------------------*/
  623.     /*----------------------------------------------------------------*/
  624.     /* Code Body                                                      */
  625.     /*----------------------------------------------------------------*/
  626.     if (item_index == 2 || item_index == 0)
  627.     {
  628.         DisableInlineItem(&(wgui_inline_items[3]), 3);
  629.         Category57ChangeItemText(3, (U8*) GetString(STR_GLOBAL_INVALID));
  630.     }
  631.     else
  632.     {
  633.         EnableInlineItem(&(wgui_inline_items[3]), 3);
  634.         Category57ChangeItemText(
  635.             3,
  636.             (U8*) subMenuDataPtrs[SET_SS_SETTING_INLINE_SELECT_5SEC + g_phnset_cntx_p->SSWaitStatusInlineHilite]);
  637.     }
  638.     RedrawCategory57Screen();
  639. }
  640. #endif /* __MMI_LCD_PARTIAL_ON__ */ 
  641. /*****************************************************************************
  642.  * FUNCTION
  643.  *  PhnsetScrSvrFillInline
  644.  * DESCRIPTION
  645.  *  This function is to fill inline selection items for Phonesetup->IdleScreenDisplay->ScreenSaver -> Setting
  646.  * PARAMETERS
  647.  *  SSaverInline        [?]             
  648.  *  a(?)                [IN/OUT]        InlineItem *SSaverInline
  649.  *  b(?)                [IN]            Void
  650.  * RETURNS
  651.  *  void
  652.  *****************************************************************************/
  653. void PhnsetScrSvrFillInline(InlineItem *SSaverInline)
  654. {
  655.     /*----------------------------------------------------------------*/
  656.     /* Local Variables                                                */
  657.     /*----------------------------------------------------------------*/
  658.     /*----------------------------------------------------------------*/
  659.     /* Code Body                                                      */
  660.     /*----------------------------------------------------------------*/
  661.     g_phnset_cntx_p->SSStatusInlineHilite = g_phnset_cntx_p->curSSStatus;
  662.     SetInlineItemActivation(&SSaverInline[1], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  663.     SetInlineItemActivation(&SSaverInline[3], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  664.     switch (g_phnset_cntx_p->curSSWaitTime)
  665.     {
  666.         case 5:
  667.             g_phnset_cntx_p->SSWaitStatusInlineHilite = 0;
  668.             break;
  669.         case 15:
  670.             g_phnset_cntx_p->SSWaitStatusInlineHilite = 1;
  671.             break;
  672.         case 30:
  673.             g_phnset_cntx_p->SSWaitStatusInlineHilite = 2;
  674.             break;
  675.         case 60:
  676.             g_phnset_cntx_p->SSWaitStatusInlineHilite = 3;
  677.             break;
  678.         default:
  679.             g_phnset_cntx_p->SSWaitStatusInlineHilite = 2;
  680.             break;  /* Deafult Value */
  681.     }
  682.     subMenuDataPtrs[SET_SS_SETTING_INLINE_CAPTION_STATUS] = (PU8) GetString(STR_SCREENSAVER_STATUS);
  683.     subMenuDataPtrs[SET_SS_SETTING_INLINE_SELECT_OFF] = (PU8) GetString(STR_GLOBAL_OFF);
  684.     subMenuDataPtrs[SET_SS_SETTING_INLINE_SELECT_ON] = (PU8) GetString(STR_GLOBAL_ON);
  685. #ifdef __MMI_LCD_PARTIAL_ON__
  686.     subMenuDataPtrs[SET_SS_SETTING_INLINE_SELECT_POWER_SAVING] = (PU8) GetString(STR_SCREENSAVER_DISPLAY_TIME);
  687. #endif 
  688.     subMenuDataPtrs[SET_SS_SETTING_INLINE_CAPTION_WAITING] = (PU8) GetString(STR_SCREENSAVER_WAITING);
  689.     subMenuDataPtrs[SET_SS_SETTING_INLINE_SELECT_5SEC] = (PU8) GetString(STR_SCREENSAVER_5SEC);
  690.     subMenuDataPtrs[SET_SS_SETTING_INLINE_SELECT_15SEC] = (PU8) GetString(STR_SCREENSAVER_15SEC);
  691.     subMenuDataPtrs[SET_SS_SETTING_INLINE_SELECT_30SEC] = (PU8) GetString(STR_SCREENSAVER_30SEC);
  692.     subMenuDataPtrs[SET_SS_SETTING_INLINE_SELECT_1MIN] = (PU8) GetString(STR_SCREENSAVER_1MINUTE);
  693.     SetInlineItemCaption(&SSaverInline[0], subMenuDataPtrs[SET_SS_SETTING_INLINE_CAPTION_STATUS]);
  694. #ifdef __MMI_LCD_PARTIAL_ON__
  695.     SetInlineItemSelect(
  696.         &SSaverInline[1],
  697.         3,
  698.         &subMenuDataPtrs[SET_SS_SETTING_INLINE_SELECT_OFF],
  699.         &(g_phnset_cntx_p->SSStatusInlineHilite));
  700.     RegisterInlineSelectHighlightHandler(&SSaverInline[1], PhnsetScrSvrInlineStatusSelectHiliteHdlr);
  701. #else /* __MMI_LCD_PARTIAL_ON__ */ 
  702.     SetInlineItemSelect(
  703.         &SSaverInline[1],
  704.         2,
  705.         &subMenuDataPtrs[SET_SS_SETTING_INLINE_SELECT_OFF],
  706.         &(g_phnset_cntx_p->SSStatusInlineHilite));
  707. #endif /* __MMI_LCD_PARTIAL_ON__ */ 
  708.     SetInlineItemCaption(&SSaverInline[2], subMenuDataPtrs[SET_SS_SETTING_INLINE_CAPTION_WAITING]);
  709.     SetInlineItemSelect(
  710.         &SSaverInline[3],
  711.         MAX_SS_INLINE_EDIT,
  712.         &subMenuDataPtrs[SET_SS_SETTING_INLINE_SELECT_5SEC],
  713.         &(g_phnset_cntx_p->SSWaitStatusInlineHilite));
  714. }
  715. /*****************************************************************************
  716.  * FUNCTION
  717.  *  EntryPhnsetScrSvrSettings
  718.  * DESCRIPTION
  719.  *  This function is Entry function for Phonesetup->IdleScreenDisplay->ScreenSaver -> Setting
  720.  *  Following Functions:   PhnsetScrSvrSettingLskHdlr
  721.  * PARAMETERS
  722.  *  void
  723.  *  a(?)        [IN/OUT]        Void
  724.  *  b(?)        [IN]            Void
  725.  * RETURNS
  726.  *  void
  727.  *****************************************************************************/
  728. void EntryPhnsetScrSvrSettings(void)
  729. {
  730.     /*----------------------------------------------------------------*/
  731.     /* Local Variables                                                */
  732.     /*----------------------------------------------------------------*/
  733.     U8 *guiBuffer;
  734.     U16 ScreenSaverListIcon[MAX_SS_INLINE_EDIT] = {IMG_SETTING_GREET_TEXT, 0, IMAGE_SETTING_TIME, 0};
  735.     InlineItem SSSettingInLine[MAX_SS_INLINE_EDIT];
  736.     S16 error;
  737.     U8 *inputBuffer;        /* added for inline edit history */
  738.     U16 inputBufferSize;    /* added for inline edit history */
  739.     /*----------------------------------------------------------------*/
  740.     /* Code Body                                                      */
  741.     /*----------------------------------------------------------------*/
  742.     EntryNewScreen(SCR_SCREENSAVER_SETTING, ExitPhnsetScrSvrSettings, NULL, NULL);
  743.     g_phnset_cntx_p->isCorrectSet = 0;
  744.     InitializeCategory57Screen();
  745.     guiBuffer = GetCurrGuiBuffer(SCR_SCREENSAVER_SETTING);
  746.     memset((void*)SSSettingInLine, 0, sizeof(InlineItem) * MAX_SS_INLINE_EDIT);
  747.     ReadValue(NVRAM_SCREENSAVER_STATUS, &(g_phnset_cntx_p->curSSStatus), DS_BYTE, &error);
  748.     ReadValue(NVRAM_SCREENSAVER_WAITING, &(g_phnset_cntx_p->curSSWaitTime), DS_BYTE, &error);
  749. #ifndef __MMI_LCD_PARTIAL_ON__
  750.     /* If __MMI_LCD_PARTIAL_ON__ is turned off without reseting NVRAM */
  751.     if (g_phnset_cntx_p->curSSStatus == (S32) SET_SS_STATUS_POWERSAVING)
  752.     {
  753.         g_phnset_cntx_p->curSSStatus = 0xFF;
  754.     }
  755. #endif /* __MMI_LCD_PARTIAL_ON__ */ 
  756.     if (g_phnset_cntx_p->curSSStatus == 0xFF)
  757.     {
  758.         g_phnset_cntx_p->curSSStatus = RstGetScrSaverStatusDefault();
  759.         WriteValue(NVRAM_SCREENSAVER_STATUS, &(g_phnset_cntx_p->curSSStatus), DS_BYTE, &error);
  760.     }
  761.     if (g_phnset_cntx_p->curSSWaitTime == 0xFF)
  762.     {
  763.         g_phnset_cntx_p->curSSWaitTime = RstGetScrSaverWaitingDefault();
  764.         WriteValue(NVRAM_SCREENSAVER_WAITING, &(g_phnset_cntx_p->curSSWaitTime), DS_BYTE, &error);
  765.     }
  766.     PhnsetScrSvrFillInline(SSSettingInLine);
  767.     SetLeftSoftkeyFunction(PhnsetScrSvrSettingLskHdlr, KEY_EVENT_UP);
  768.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  769.     RegisterHighlightHandler(PhnsetScrSvrInlineHiliteHdlr);
  770.     inputBuffer = GetCurrNInputBuffer(SCR_SCREENSAVER_SETTING, &inputBufferSize);       /* added for inline edit history */
  771.     if (inputBuffer != NULL)    /* added for inline edit history */
  772.     {
  773.         SetCategory57Data(SSSettingInLine, MAX_SS_INLINE_EDIT, inputBuffer);    /* sets the data */
  774.     }
  775.     ShowCategory57Screen(
  776.         SCR_SCREENSAVER_SETTING_CAPTION,
  777.         IMG_SCR_SETTING_CAPTION,
  778.         STR_GLOBAL_OK,
  779.         IMG_GLOBAL_OK,
  780.         STR_GLOBAL_BACK,
  781.         IMG_GLOBAL_BACK,
  782.         MAX_SS_INLINE_EDIT,
  783.         ScreenSaverListIcon,
  784.         SSSettingInLine,
  785.         0,
  786.         guiBuffer);
  787.     DisableCategory57ScreenDone();
  788.     SetCategory57RightSoftkeyFunctions(PhnsetScrSvrSettingLskHdlr, GoBackHistory);
  789. }
  790. /*****************************************************************************
  791.  * FUNCTION
  792.  *  ExitPhnsetScrSvrSettings
  793.  * DESCRIPTION
  794.  *  This function is Exit function for Phonesetup->IdleScreenDisplay->ScreenSaver -> Setting
  795.  *  Following Functions:
  796.  * PARAMETERS
  797.  *  void
  798.  *  a(?)        [IN/OUT]        Void
  799.  *  b(?)        [IN]            Void
  800.  * RETURNS
  801.  *  void
  802.  *****************************************************************************/
  803. void ExitPhnsetScrSvrSettings(void)
  804. {
  805.     /*----------------------------------------------------------------*/
  806.     /* Local Variables                                                */
  807.     /*----------------------------------------------------------------*/
  808.     history h;
  809.     S16 nHistory = 0;
  810.     U16 inputBufferSize;
  811.     /*----------------------------------------------------------------*/
  812.     /* Code Body                                                      */
  813.     /*----------------------------------------------------------------*/
  814.     CloseCategory57Screen();
  815.     h.scrnID = SCR_SCREENSAVER_SETTING;
  816.     h.entryFuncPtr = EntryPhnsetScrSvrSettings;
  817.     pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
  818.     GetCategory57History(h.guiBuffer);
  819.     inputBufferSize = (S16) GetCategory57DataSize();    /* added for inline edit history */
  820.     GetCategory57Data((U8*) h.inputBuffer);             /* added for inline edit history */
  821.     AddNHistory(h, inputBufferSize);                    /* added for inline edit history */
  822.     if (g_phnset_cntx_p->isCorrectSet)
  823.     {
  824.         DeleteUptoScrID(SCR_MAIN_SCREENSAVER);
  825.     }
  826. }
  827. /*****************************************************************************
  828.  * FUNCTION
  829.  *  PhnsetScrSvrSettingLskHdlr
  830.  * DESCRIPTION
  831.  *  This function is left softkey handler for Phonesetup->IdleScreenDisplay->ScreenSaver -> Setting
  832.  *  Ancestor Functions:   EntryPhnsetScrSvrSettings
  833.  *  PhnsetScrSvrInlineHiliteHdlr
  834.  * PARAMETERS
  835.  *  void
  836.  *  a(?)        [IN/OUT]        Void
  837.  *  b(?)        [IN]            Void
  838.  * RETURNS
  839.  *  void
  840.  *****************************************************************************/
  841. void PhnsetScrSvrSettingLskHdlr(void)
  842. {
  843.     /*----------------------------------------------------------------*/
  844.     /* Local Variables                                                */
  845.     /*----------------------------------------------------------------*/
  846.     S16 error;
  847.     /*----------------------------------------------------------------*/
  848.     /* Code Body                                                      */
  849.     /*----------------------------------------------------------------*/
  850.     g_phnset_cntx_p->curSSStatus = (U8) g_phnset_cntx_p->SSStatusInlineHilite;
  851.     switch (g_phnset_cntx_p->SSWaitStatusInlineHilite)
  852.     {
  853.         case 0:
  854.             g_phnset_cntx_p->curSSWaitTime = 5;
  855.             break;
  856.         case 1:
  857.             g_phnset_cntx_p->curSSWaitTime = 15;
  858.             break;
  859.         case 2:
  860.             g_phnset_cntx_p->curSSWaitTime = 30;
  861.             break;
  862.         case 3:
  863.             g_phnset_cntx_p->curSSWaitTime = 60;
  864.             break;
  865.     }
  866.     WriteValue(NVRAM_SCREENSAVER_STATUS, &(g_phnset_cntx_p->curSSStatus), DS_BYTE, &error);
  867.     WriteValue(NVRAM_SCREENSAVER_WAITING, &(g_phnset_cntx_p->curSSWaitTime), DS_BYTE, &error);
  868.     g_phnset_cntx_p->isCorrectSet = 1;
  869.     DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  870. }
  871. /* 
  872.  * Phonesetup->IdleScreenDisplay->ScreenSaver -> Select
  873.  */
  874. /*****************************************************************************
  875.  * FUNCTION
  876.  *  EntryPhnsetScrSvrSelect
  877.  * DESCRIPTION
  878.  *  This function is Entry function for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select
  879.  *  Ancestor Functions:   EntryPhnsetScrSvrSettings
  880.  *  PhnsetScrSvrInlineHiliteHdlr
  881.  * PARAMETERS
  882.  *  void
  883.  *  a(?)        [IN/OUT]        Void
  884.  *  b(?)        [IN]            Void
  885.  * RETURNS
  886.  *  void
  887.  *****************************************************************************/
  888. #if defined(__MMI_FILE_MANAGER__)
  889. void EntryPhnsetScrSvrSelect(void)
  890. {
  891.     /*----------------------------------------------------------------*/
  892.     /* Local Variables                                                */
  893.     /*----------------------------------------------------------------*/
  894.     U8 *guiBuffer;
  895.     U16 ScreenSaverSelectList[MAX_SUB_MENUS];
  896.     U16 nNumofItem;
  897.     /*----------------------------------------------------------------*/
  898.     /* Code Body                                                      */
  899.     /*----------------------------------------------------------------*/
  900.     EntryNewScreen(SCR_SCREENSAVER_SELECT, NULL, EntryPhnsetScrSvrSelect, NULL);
  901.     g_phnset_cntx_p->ScrAnchor = SCR_SCREENSAVER_SELECT;
  902.     guiBuffer = GetCurrGuiBuffer(SCR_SCREENSAVER_SELECT);
  903.     nNumofItem = GetNumOfChild(MENU_SETTING_SS_SELECT);
  904.     GetSequenceStringIds(MENU_SETTING_SS_SELECT, ScreenSaverSelectList);
  905.     SetParentHandler(MENU_SETTING_SS_SELECT);
  906.     RegisterHighlightHandler(ExecuteCurrHiliteHandler); /* HighlightPhnsetScrSvrSystem, HighlightPhnsetScrSvrDwnl */
  907.     ShowCategory15Screen(
  908.         STR_SCR_SCREENSAVER_CAPTION,
  909.         IMG_SCR_SETTING_CAPTION,
  910.         STR_GLOBAL_OK,
  911.         IMG_GLOBAL_OK,
  912.         STR_GLOBAL_BACK,
  913.         IMG_GLOBAL_BACK,
  914.         nNumofItem,
  915.         ScreenSaverSelectList,
  916.         (PU16) gIndexIconsImageList,
  917.         1,
  918.         0,
  919.         guiBuffer);
  920.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  921.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  922. }
  923. #endif /* defined(__MMI_FILE_MANAGER__) */ 
  924. /*****************************************************************************
  925.  * FUNCTION
  926.  *  PhnsetConstSysScrSvrList
  927.  * DESCRIPTION
  928.  *  This function is to construct system screen saver list
  929.  *  for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> System
  930.  * PARAMETERS
  931.  *  pSysSSStrList       [IN]            
  932.  *  pSysSSImgIDList     [?]             
  933.  *  HighliteItem        [?]             
  934.  *  a(?)                [IN/OUT]        U8 **pSysSSStrList, U16 *pSysSSImgIDList, S16 *HighliteItem
  935.  *  b(?)                [IN]            Void
  936.  * RETURNS
  937.  *  void
  938.  *****************************************************************************/
  939. U8 PhnsetConstSysScrSvrList(U8 **pSysSSStrList, U16 *pSysSSImgIDList, S16 *HighliteItem)
  940. {
  941.     /*----------------------------------------------------------------*/
  942.     /* Local Variables                                                */
  943.     /*----------------------------------------------------------------*/
  944.     S8 i;
  945.     DYNIMAGEINFO *Info;
  946.     U8 index_other = 0;
  947.     U8 index_swflash = 0;
  948.     U8 index_img = 0; /* count of image */
  949.     U8 index_vdo = 0; /* count of video */
  950.     U8 ss_max;
  951.     U8 max_ss_img = MAX_SCREENSAVER_IMG - MAX_OTHER_SCREENSAVER - MAX_DISPCHAR_SWFLASH;
  952.     U8 max_ss_other = MAX_OTHER_SCREENSAVER;
  953.     U8 max_ss_swflash = MAX_DISPCHAR_SWFLASH;
  954. #ifdef __MMI_THEMES_V2_SUPPORT__
  955.         if(!mmi_tm_get_current_theme_screensaver())
  956.         {
  957.             max_ss_other -= 2;
  958.         }
  959.         else
  960.         {
  961.             max_ss_other --;            
  962.         }
  963. #endif /* __MMI_THEMES_V2_SUPPORT__ */
  964.     /*----------------------------------------------------------------*/
  965.     /* Code Body                                                      */
  966.     /*----------------------------------------------------------------*/
  967.     /* Layout
  968.      *
  969.      * -- Video         --
  970.      *
  971.      * -- Normal Images --
  972.      * -- Normal Images -- SVG
  973.      * -- Normal Images -- M3D
  974.      * -- Analog clock  --
  975.      * -- Digital clock --
  976.      * -- Theme         --
  977.      * -- SWFLASH        --
  978.      *
  979.      * -- Factory images--
  980.      * 
  981.      */
  982.     for (i = 0; i < (MAX_SCREENSAVER_VDO + max_ss_img + max_ss_other + max_ss_swflash); i++)
  983.     {
  984.         U16 strID = 0, imgID = 0;
  985.         
  986.         if (i < MAX_SCREENSAVER_VDO)
  987.         {
  988.            imgID = IMG_ID_PHNSET_SS_VDO_START + i;
  989.         }
  990.         else if (i >= MAX_SCREENSAVER_VDO && 
  991.                  i < (MAX_SCREENSAVER_VDO + max_ss_img))
  992.         {
  993.            imgID = IMG_ID_PHNSET_SS_START + (i - MAX_SCREENSAVER_VDO);
  994.         }
  995.         else if (max_ss_other &&
  996.                  i >= (MAX_SCREENSAVER_VDO + max_ss_img) &&
  997.                  i < (MAX_SCREENSAVER_VDO + (max_ss_img + max_ss_other)))
  998.         {
  999.             imgID = IMG_ID_DISPCHAR_OTHER_START + (i - (MAX_SCREENSAVER_VDO + max_ss_img)) + 1;
  1000.         }
  1001.         else if (max_ss_swflash)
  1002.         {
  1003.             imgID = IMG_ID_DISPCHAR_SWFLASH_START + (i - (MAX_SCREENSAVER_VDO + (max_ss_img + max_ss_other)));
  1004.         }
  1005.         if (imgID >= IMG_ID_PHNSET_SS_VDO_START && imgID <= IMG_ID_PHNSET_SS_VDO_MAX)
  1006.         {
  1007.             strID = STR_ID_PHNSET_DISPCHAR_VDOID_START + index_vdo;
  1008.             ++index_vdo;
  1009.         }
  1010.         /* normal/SVG/M3D  images*/
  1011.         else if (imgID >= IMG_ID_PHNSET_SS_START && imgID <= IMG_ID_PHNSET_SS_MAX)
  1012.         {
  1013.             strID = STR_ID_PHNSET_DISPCHAR_IMGID_START + index_img;
  1014.             index_img++;
  1015.         }
  1016.         else if ( imgID > IMG_ID_DISPCHAR_OTHER_START && imgID < IMG_ID_DISPCHAR_OTHER_MAX)
  1017.         {
  1018.     #if !defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__)
  1019.         
  1020.     #ifdef __MMI_ANALOG_CLOCK__
  1021.             /* Analog clock */
  1022.             if (imgID == IMG_ID_DISPCHAR_ANALOG_CLK)
  1023.             {
  1024.                 strID = STR_ID_PHNSET_DISPCHAR_ANALOG;
  1025.             }
  1026.     #endif /* __MMI_ANALOG_CLOCK__ */ 
  1027.         
  1028.     #ifdef __MMI_DIGITAL_CLOCK__
  1029.             /* Digital clock */
  1030.             if (imgID == IMG_ID_DISPCHAR_DIGITAL_CLK)
  1031.             {
  1032.                 strID = STR_ID_PHNSET_DISPCHAR_DIGITAL;
  1033.             }
  1034.     #endif /* __MMI_DIGITAL_CLOCK__ */ 
  1035.         
  1036.     #endif /* !__MMI_UI_TECHNO_IDLESCREEN_BAR__ */ 
  1037.         
  1038.     #ifdef __MMI_THEMES_V2_SUPPORT__
  1039.             /* Theme */
  1040.             if (mmi_tm_get_current_theme_screensaver() && imgID == IMG_ID_DISPCHAR_THEME_WALLPAPER)
  1041.             {
  1042.                 imgID = IMG_ID_DISPCHAR_THEME_SCREENSAVER;
  1043.                 strID = STR_ID_DISPCHAR_THEME_SCREENSAVER;
  1044.             }
  1045.     #endif /* __MMI_THEMES_V2_SUPPORT__ */
  1046.             ++index_other;
  1047.         }
  1048. #ifdef __MMI_SWFLASH__
  1049.         else if (imgID >= IMG_ID_DISPCHAR_SWFLASH_START && imgID <= IMG_ID_DISPCHAR_SWFLASH_MAX)
  1050.         {
  1051.                 strID = STR_ID_DISPCHAR_SWFLASH_START + index_swflash;
  1052.                 ++index_swflash;
  1053.         }
  1054. #endif /* __MMI_SWFLASH__*/
  1055.         if(strID && imgID)
  1056.         {
  1057.             if (pSysSSImgIDList)
  1058.             {
  1059.                 pSysSSImgIDList[i] = imgID;
  1060.             }
  1061.             
  1062.             if (pSysSSStrList)
  1063.             {
  1064.                 pSysSSStrList[i] = (PU8) GetString(strID);
  1065.             }
  1066.             
  1067.             if (HighliteItem && g_phnset_cntx_p->curSsID == pSysSSImgIDList[i])
  1068.             {
  1069.                 *HighliteItem = i;
  1070.             }
  1071.         }
  1072.     }
  1073.     ss_max = i;
  1074.     MMI_ASSERT(index_other == max_ss_other);
  1075.     MMI_ASSERT(index_swflash == max_ss_swflash);
  1076.     
  1077.    /*
  1078.     * FACTORY SCREEN SAVER
  1079.     */
  1080.     g_phnset_cntx_p->SSFctyImgNum = GetFullScreenFactoryImagesInfo(&Info);
  1081.     for (i = 0; i < g_phnset_cntx_p->SSFctyImgNum; i++)
  1082.     {
  1083.         U16 strID = STR_ID_PHNSET_DISPCHAR_IMGID_START + index_img + i;
  1084.         if (pSysSSImgIDList)
  1085.         {
  1086.             pSysSSImgIDList[ss_max + i] = Info[i].ImagesId;
  1087.         }
  1088.         if (pSysSSStrList)
  1089.         {
  1090.             pSysSSStrList[ss_max + i] = (PU8) GetString(strID);
  1091.         }
  1092.         if (HighliteItem)
  1093.             if (g_phnset_cntx_p->curSsID == Info[i].ImagesId)
  1094.             {
  1095.                 *HighliteItem = ss_max + i;
  1096.             }
  1097.     }
  1098.     ss_max += i;
  1099.     return ss_max;   /* amount, will be used to construct list */
  1100. }
  1101. /*****************************************************************************
  1102.  * FUNCTION
  1103.  *  EntryPhnsetScrSvrSystem
  1104.  * DESCRIPTION
  1105.  *  This function is Entry function for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> System
  1106.  *  Following Functions:   EntryPhnsetScrSvrSysView
  1107.  * PARAMETERS
  1108.  *  void
  1109.  *  a(?)        [IN/OUT]        Void
  1110.  *  b(?)        [IN]            Void
  1111.  * RETURNS
  1112.  *  void
  1113.  *****************************************************************************/
  1114. void EntryPhnsetScrSvrSystem(void)
  1115. {
  1116.     /*----------------------------------------------------------------*/
  1117.     /* Local Variables                                                */
  1118.     /*----------------------------------------------------------------*/
  1119.     U8 *guiBuffer;
  1120.     /*----------------------------------------------------------------*/
  1121.     /* Code Body                                                      */
  1122.     /*----------------------------------------------------------------*/
  1123.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "EntryPhnsetScrSvrSystemn"));
  1124.     EntryNewScreen(SCR_SCREENSAVER_SYSTEM_LIST, NULL, EntryPhnsetScrSvrSystem, NULL);
  1125.     guiBuffer = GetCurrGuiBuffer(SCR_SCREENSAVER_SYSTEM_LIST);
  1126.     RegisterHighlightHandler(PhnsetScrSvrSysHiliteHdlr);
  1127.     g_phnset_cntx_p->curHightlightItem = 0;
  1128.     ss_item_amount = PhnsetConstSysScrSvrList(
  1129.                         subMenuDataPtrs,
  1130.                         g_phnset_cntx_p->SysWPSSList,
  1131.                         (S16*) & g_phnset_cntx_p->curHightlightItem);
  1132.     /* Variable To Keep Is Dont Added On Scrolling */
  1133.     g_phnset_cntx_p->WPSSPreviewScrFlag = 1;
  1134.     if (g_phnset_cntx_p->curSsID == 0)
  1135.         g_phnset_cntx_p->curHightlightItem;        
  1136.     
  1137.     ShowCategory36Screen(
  1138.         STR_GLOBAL_SELECT,
  1139.         IMG_SCR_SETTING_CAPTION,
  1140.         STR_GLOBAL_VIEW,
  1141.         0,
  1142.         STR_GLOBAL_BACK,
  1143.         IMG_GLOBAL_BACK,
  1144.         ss_item_amount,
  1145.         subMenuDataPtrs,
  1146.         (U16) (g_phnset_cntx_p->curHightlightItem),
  1147.         guiBuffer);
  1148.     SetLeftSoftkeyFunction(EntryPhnsetScrSvrSysView, KEY_EVENT_UP);
  1149.     SetKeyHandler(EntryPhnsetScrSvrSysView, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1150.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1151.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1152. }
  1153. /*****************************************************************************
  1154.  * FUNCTION
  1155.  *  PhnsetScrSvrSysHiliteHdlr
  1156.  * DESCRIPTION
  1157.  *  This function is highlight handler for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> System
  1158.  * PARAMETERS
  1159.  *  nIndex      [IN]            
  1160.  *  a(?)        [IN/OUT]        Void
  1161.  *  b(?)        [IN]            Void
  1162.  * RETURNS
  1163.  *  void
  1164.  *****************************************************************************/
  1165. void PhnsetScrSvrSysHiliteHdlr(S32 nIndex)
  1166. {
  1167.     /*----------------------------------------------------------------*/
  1168.     /* Local Variables                                                */
  1169.     /*----------------------------------------------------------------*/
  1170.     /*----------------------------------------------------------------*/
  1171.     /* Code Body                                                      */
  1172.     /*----------------------------------------------------------------*/
  1173. #if defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) && defined(__MTK_TARGET__)
  1174.     if (nIndex < MAX_SCREENSAVER_VDO)
  1175.     {
  1176.         ChangeLeftSoftkey(STR_ID_VDOPLY_PLAY, 0);
  1177.     }
  1178.     else
  1179.     {
  1180.         ChangeLeftSoftkey(STR_GLOBAL_VIEW, 0);
  1181.     }
  1182. #endif /* defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) && defined(__MTK_TARGET__) */ 
  1183.     g_phnset_cntx_p->curHightlightItem = (U16) nIndex;
  1184. }
  1185. /*****************************************************************************
  1186.  * FUNCTION
  1187.  *  EntryPhnsetScrSvrSysView
  1188.  * DESCRIPTION
  1189.  *  This function is Entry function for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> System ->View
  1190.  *  Following Functions:   EntryScrSetScreenSaver
  1191.  *  PhnsetScrSvrSysViewPre
  1192.  *  PhnsetScrSvrSysViewNext
  1193.  * PARAMETERS
  1194.  *  void
  1195.  *  a(?)        [IN/OUT]        Void
  1196.  *  b(?)        [IN]            Void
  1197.  * RETURNS
  1198.  *  void
  1199.  *****************************************************************************/
  1200. void EntryPhnsetScrSvrSysView(void)
  1201. {
  1202.     /*----------------------------------------------------------------*/
  1203.     /* Local Variables                                                */
  1204.     /*----------------------------------------------------------------*/
  1205.     U8 *guiBuffer;
  1206.     /* Notice: g_phnset_cntx_p->SysWPSSList Has been constructed at  EntryPhnsetScrSvrSystem() */
  1207.     U16 screenSaverId = g_phnset_cntx_p->SysWPSSList[g_phnset_cntx_p->curHightlightItem];
  1208.     U8 *ssName = (U8 *)PhnsetGetScrSvrNameById(screenSaverId);
  1209.     /*----------------------------------------------------------------*/
  1210.     /* Code Body                                                      */
  1211.     /*----------------------------------------------------------------*/
  1212.     guiBuffer = GetCurrGuiBuffer(SCR_SCREENSAVER_VIEW);
  1213.     g_phnset_cntx_p->isCorrectSet = 0;
  1214.     if (g_phnset_cntx_p->WPSSPreviewScrFlag)
  1215.     {
  1216.         EntryNewScreen(SCR_SCREENSAVER_VIEW, ExitPhnsetScrSvrSysView, EntryPhnsetScrSvrSysView, NULL);
  1217.     }
  1218. #if defined(__MMI_RESOURCE_ENFB_SUPPORT__)
  1219.     else
  1220.     {
  1221.         mmi_frm_resmem_reset(MMI_FRM_RESMEM_TYPE_LOD_ON_DEMAND);
  1222.     }    
  1223. #endif /* defined(__MMI_RESOURCE_ENFB_SUPPORT__) */
  1224.     wgui_set_touch_title_bar_buttons(); /* enable the display of title bar buttons */
  1225. #if defined(__MMI_TOUCH_SCREEN__)
  1226.     register_touch_button_handlers(NULL, PhnsetScrSvrSysViewPre, NULL, PhnsetScrSvrSysViewNext);
  1227. #endif 
  1228.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "EntryPhnsetScrSvrSysView: screenSaverId=%dn", screenSaverId));
  1229. #if defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) && defined(__MTK_TARGET__)
  1230.     if (PhnsetGetDisplayType(screenSaverId) == PHNSET_TYPE_DISP_VIDEO)
  1231.     {
  1232.         ShowCategory225Screen(
  1233.             STR_ID_PHNSET_DISPCHAR_VDOID_START + (screenSaverId - IMG_ID_PHNSET_SS_VDO_START),        /* title_str */
  1234.             0,                  /* title_icon */
  1235.             STR_GLOBAL_OK,      /* lsk_str */
  1236.             IMG_GLOBAL_OK,      /* lsk_icon */
  1237.             STR_GLOBAL_BACK,    /* rsk_str */
  1238.             IMG_GLOBAL_BACK,    /* rsk_icon */
  1239.             screenSaverId,      /* video_id */
  1240.             NULL,               /* video_filename */
  1241.             1,                  /* repeat_count */
  1242.             TRUE,               /* is_visual_update */
  1243.             FALSE,              /* is_play_audio */
  1244.             TRUE,               /* is_lcd_no_sleep */
  1245.             GDI_COLOR_BLACK,    /* bg_color */
  1246.             PhnsetWpSsPlayCallBack,
  1247.             guiBuffer);
  1248.     }
  1249.     else
  1250. #endif /* defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) && defined(__MTK_TARGET__) */ 
  1251. #ifndef __MMI_UI_TECHNO_IDLESCREEN_BAR__    
  1252. #ifdef __MMI_ANALOG_CLOCK__
  1253.         /* Category 86 to View Analog Clock Screen Saver */
  1254.     if ((screenSaverId == IMG_ID_DISPCHAR_ANALOG_CLK))
  1255.     {
  1256.         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);        /* 051305 Calvin modified */
  1257.     }
  1258.     else
  1259. #endif /* __MMI_ANALOG_CLOCK__ */ 
  1260. #ifdef __MMI_DIGITAL_CLOCK__
  1261.         /* Category 128 to View Digital Clock Screen Saver */
  1262.     if (screenSaverId == IMG_ID_DISPCHAR_DIGITAL_CLK)
  1263.     {
  1264.         ShowCategory128Screen(
  1265.             STR_ID_PHNSET_DISPCHAR_DIGITAL,
  1266.             0,
  1267.             STR_GLOBAL_OK,
  1268.             IMG_GLOBAL_OK,
  1269.             STR_GLOBAL_BACK,
  1270.             IMG_GLOBAL_BACK,
  1271.             IMG_ID_DISPCHAR_DIGITAL_CLK,
  1272.             1,
  1273.             1,
  1274.             1,
  1275.             guiBuffer,
  1276.             0);
  1277.     }
  1278.     else
  1279. #endif /* __MMI_DIGITAL_CLOCK__ */ 
  1280. #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__  */
  1281. #ifdef __MMI_SWFLASH__
  1282.     if (PhnsetGetDisplayType(screenSaverId) == PHNSET_TYPE_DISP_SWFLASH)
  1283.     {
  1284.         ShowCategory229Screen(
  1285.             ssName,                            /* title_str */
  1286.             IMG_SCR_SETTING_CAPTION,            /* title_icon */
  1287.             STR_GLOBAL_OK,                      /* lsk_str */
  1288.             IMG_GLOBAL_OK,                      /* lsk_icon */
  1289.             STR_GLOBAL_BACK,                    /* rsk_str */
  1290.             IMG_GLOBAL_BACK,                    /* rsk_icon */
  1291.             screenSaverId,                      /* resource_id */
  1292.             NULL,                               /* resource_filename */
  1293.             1,                                  /* repeat_count */
  1294.             MMI_FALSE,                          /* is_play_audio */
  1295.             MMI_FALSE,                          /* is_vibrate_on */
  1296.             MMI_FALSE,                          /* is_interaction_on */
  1297.             MMI_TRUE,                           /* is_lcd_no_sleep */
  1298.             MMI_TRUE,                          /* is_full_screen */
  1299.             GDI_COLOR_WHITE,                    /* bg_color */
  1300.             PhnsetWpSsPlayCallBack,
  1301.             guiBuffer);
  1302.     }
  1303.     else
  1304. #endif /* __MMI_SWFLASH__ */
  1305.     /* Category 129 to view other Screensavers */
  1306.     {
  1307.         ShowCategory129Screen(
  1308.             ssName,
  1309.             0,
  1310.             STR_GLOBAL_OK,
  1311.             IMG_GLOBAL_OK,
  1312.             STR_GLOBAL_BACK,
  1313.             IMG_GLOBAL_BACK,
  1314.             screenSaverId,
  1315.             guiBuffer);
  1316.     }
  1317.     SetLeftSoftkeyFunction(PhnsetScrSvrSysViewLskHdlr, KEY_EVENT_UP);
  1318.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1319.     /* changed the up-down arrow key handlers to left-right arrow key handlers
  1320.        for having the similar behaviour of keypad and touchscreen. */
  1321.     SetKeyHandler(PhnsetScrSvrSysViewPre, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1322.     SetKeyHandler(PhnsetScrSvrSysViewNext, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1323. }
  1324. /*****************************************************************************
  1325.  * FUNCTION
  1326.  *  ExitPhnsetScrSvrSysView
  1327.  * DESCRIPTION
  1328.  *  This function is Exit function for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> System ->View
  1329.  *  Ancestor Functions:
  1330.  * PARAMETERS
  1331.  *  void
  1332.  *  a(?)        [IN/OUT]        Void
  1333.  *  b(?)        [IN]            Void
  1334.  * RETURNS
  1335.  *  void
  1336.  *****************************************************************************/
  1337. void ExitPhnsetScrSvrSysView(void)
  1338. {
  1339.     /*----------------------------------------------------------------*/
  1340.     /* Local Variables                                                */
  1341.     /*----------------------------------------------------------------*/
  1342.     /*----------------------------------------------------------------*/
  1343.     /* Code Body                                                      */
  1344.     /*----------------------------------------------------------------*/
  1345.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "ExitPhnsetScrSvrSysViewn"));
  1346.     if (g_phnset_cntx_p->isCorrectSet)
  1347.     {
  1348.         DeleteUptoScrID(g_phnset_cntx_p->ScrAnchor);
  1349.     }
  1350.     g_phnset_cntx_p->WPSSPreviewScrFlag = 1;
  1351. }
  1352. /*****************************************************************************
  1353.  * FUNCTION
  1354.  *  PhnsetScrSvrSysViewPre
  1355.  * DESCRIPTION
  1356.  *  This function is Entry function for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> System ->View
  1357.  *  Ancestor Functions:   EntryPhnsetScrSvrSysView
  1358.  * PARAMETERS
  1359.  *  void
  1360.  *  a(?)        [IN/OUT]        Void
  1361.  *  b(?)        [IN]            Void
  1362.  * RETURNS
  1363.  *  void
  1364.  *****************************************************************************/
  1365. void PhnsetScrSvrSysViewPre(void)
  1366. {
  1367.     /*----------------------------------------------------------------*/
  1368.     /* Local Variables                                                */
  1369.     /*----------------------------------------------------------------*/
  1370.     /*----------------------------------------------------------------*/
  1371.     /* Code Body                                                      */
  1372.     /*----------------------------------------------------------------*/
  1373.     ExitCategoryFunction();
  1374.     if (g_phnset_cntx_p->curHightlightItem <= 0)
  1375.     {
  1376.         g_phnset_cntx_p->curHightlightItem = ss_item_amount;
  1377.     }
  1378.     g_phnset_cntx_p->curHightlightItem--;
  1379.     g_phnset_cntx_p->WPSSPreviewScrFlag = 0;
  1380.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetScrSvrSysViewPre: highlight=%dn",
  1381.                          g_phnset_cntx_p->curHightlightItem));
  1382.     EntryPhnsetScrSvrSysView();
  1383. }
  1384. /*****************************************************************************
  1385.  * FUNCTION
  1386.  *  PhnsetScrSvrSysViewNext
  1387.  * DESCRIPTION
  1388.  *  This function is Entry function for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> System ->View
  1389.  *  Ancestor Functions:   EntryPhnsetScrSvrSysView
  1390.  * PARAMETERS
  1391.  *  void
  1392.  *  a(?)        [IN/OUT]        Void
  1393.  *  b(?)        [IN]            Void
  1394.  * RETURNS
  1395.  *  void
  1396.  *****************************************************************************/
  1397. void PhnsetScrSvrSysViewNext(void)
  1398. {
  1399.     /*----------------------------------------------------------------*/
  1400.     /* Local Variables                                                */
  1401.     /*----------------------------------------------------------------*/
  1402.     /*----------------------------------------------------------------*/
  1403.     /* Code Body                                                      */
  1404.     /*----------------------------------------------------------------*/
  1405.     ExitCategoryFunction();
  1406.     if (g_phnset_cntx_p->curHightlightItem >= ss_item_amount - 1)
  1407.     {
  1408.         g_phnset_cntx_p->curHightlightItem = -1;
  1409.     }
  1410.     g_phnset_cntx_p->curHightlightItem++;
  1411.     g_phnset_cntx_p->WPSSPreviewScrFlag = 0;
  1412.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetScrSvrSysViewNext: highlight=%dn",
  1413.                          g_phnset_cntx_p->curHightlightItem));
  1414.     EntryPhnsetScrSvrSysView();
  1415. }
  1416. /*****************************************************************************
  1417.  * FUNCTION
  1418.  *  PhnsetScrSvrSysViewLskHdlr
  1419.  * DESCRIPTION
  1420.  *  This function is Left softkey for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> System ->View
  1421.  *  Ancestor Functions:
  1422.  * PARAMETERS
  1423.  *  void
  1424.  *  a(?)        [IN/OUT]        Void
  1425.  *  b(?)        [IN]            Void
  1426.  * RETURNS
  1427.  *  void
  1428.  *****************************************************************************/
  1429. void PhnsetScrSvrSysViewLskHdlr(void)
  1430. {
  1431.     /*----------------------------------------------------------------*/
  1432.     /* Local Variables                                                */
  1433.     /*----------------------------------------------------------------*/
  1434.     /*----------------------------------------------------------------*/
  1435.     /* Code Body                                                      */
  1436.     /*----------------------------------------------------------------*/
  1437.     g_phnset_cntx_p->curSsID = g_phnset_cntx_p->SysWPSSList[g_phnset_cntx_p->curHightlightItem];
  1438.     mmi_dispchar_set_img_id(NVRAM_CURRENT_SCREENSVER_ID, &(g_phnset_cntx_p->curSsID));
  1439.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetScrSvrSysViewLskHdlr: ID=%dn", g_phnset_cntx_p->curSsID));
  1440.     g_phnset_cntx_p->isCorrectSet = 1;
  1441.     DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  1442. }
  1443. #ifdef __MMI_THEMES_V2_SUPPORT__
  1444. /*****************************************************************************
  1445.  * FUNCTION
  1446.  *  ThemeManagerSetScreensaver
  1447.  * DESCRIPTION
  1448.  *  ...
  1449.  * PARAMETERS
  1450.  *  nId         [IN]            
  1451.  *  a(?)        [IN/OUT]        Void
  1452.  *  b(?)        [IN]            Void
  1453.  * RETURNS
  1454.  *  void
  1455.  *****************************************************************************/
  1456. void ThemeManagerSetScreensaver(U16 nId)
  1457. {
  1458.     /*----------------------------------------------------------------*/
  1459.     /* Local Variables                                                */
  1460.     /*----------------------------------------------------------------*/
  1461.     /*----------------------------------------------------------------*/
  1462.     /* Code Body                                                      */
  1463.     /*----------------------------------------------------------------*/
  1464.     g_phnset_cntx_p->curSsID = nId;
  1465.     mmi_dispchar_set_img_id(NVRAM_CURRENT_SCREENSVER_ID, &(g_phnset_cntx_p->curSsID));
  1466. }
  1467. #endif /* __MMI_THEMES_V2_SUPPORT__ */ 
  1468. /*****************************************************************************
  1469.  * FUNCTION
  1470.  *  DispIdleScrSvrBadFilePopup
  1471.  * DESCRIPTION
  1472.  *  To show a popup of selecting an invalid file
  1473.  * PARAMETERS
  1474.  *  void
  1475.  *  a(?)        [IN/OUT]        Void
  1476.  *  b(?)        [IN]            Void
  1477.  * RETURNS
  1478.  *  void
  1479.  *****************************************************************************/
  1480. void DispIdleScrSvrBadFilePopup(void)
  1481. {
  1482.     /*----------------------------------------------------------------*/
  1483.     /* Local Variables                                                */
  1484.     /*----------------------------------------------------------------*/
  1485.     /*----------------------------------------------------------------*/
  1486.     /* Code Body                                                      */
  1487.     /*----------------------------------------------------------------*/
  1488.     if (error_str_ptr)
  1489.     {
  1490.         DisplayPopup((PU8) error_str_ptr, IMG_GLOBAL_ERROR, 1, UI_POPUP_NOTIFYDURATION_TIME, ERROR_TONE);
  1491.     }
  1492.     else
  1493.     {
  1494.         DisplayPopup(
  1495.             (PU8) GetString(STR_IDLE_SS_DECODE_ERR),
  1496.             IMG_GLOBAL_ERROR,
  1497.             1,
  1498.             UI_POPUP_NOTIFYDURATION_TIME,
  1499.             ERROR_TONE);
  1500.     }
  1501.     error_str_ptr = NULL;
  1502. }
  1503. /*****************************************************************************
  1504.  * FUNCTION
  1505.  *  PhnsetScreenSaverBadFileCallBack
  1506.  * DESCRIPTION
  1507.  *  This function is call back function for showcategories33screen,
  1508.  *  If display user defined image got problem in idle screen, this function will be executed
  1509.  *  Follow functions:
  1510.  * PARAMETERS
  1511.  *  void
  1512.  *  a(?)        [IN/OUT]        Void
  1513.  *  b(?)        [IN]            Void
  1514.  * RETURNS
  1515.  *  void
  1516.  *****************************************************************************/
  1517. S32 PhnsetScreenSaverBadFileCallBack(void)
  1518. {
  1519.     /*----------------------------------------------------------------*/
  1520.     /* Local Variables                                                */
  1521.     /*----------------------------------------------------------------*/
  1522.     /*----------------------------------------------------------------*/
  1523.     /* Code Body                                                      */
  1524.     /*----------------------------------------------------------------*/
  1525.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetScreenSaverBadFileCallBackn"));
  1526.     PhnsetRstScrSvrDefault();
  1527.     error_str_ptr = NULL;
  1528.     DispIdleScrSvrBadFilePopup();
  1529.     return g_phnset_cntx_p->curSsID;
  1530. }
  1531. #ifdef __MMI_FILE_MANAGER__
  1532. /*****************************************************************************
  1533.  * FUNCTION
  1534.  *  PhnsetScrSvrForwardFromFmgr
  1535.  * DESCRIPTION
  1536.  *  Call back for File manager forwarding
  1537.  * PARAMETERS
  1538.  *  path            [?]         
  1539.  *  is_short        [IN]        
  1540.  * RETURNS
  1541.  *  void
  1542.  *****************************************************************************/
  1543. void PhnsetScrSvrForwardFromFmgr(void *path, FMGR_FILTER *filter, int is_short)
  1544. {
  1545.     /*----------------------------------------------------------------*/
  1546.     /* Local Variables                                                */
  1547.     /*----------------------------------------------------------------*/
  1548.     /*----------------------------------------------------------------*/
  1549.     /* Code Body                                                      */
  1550.     /*----------------------------------------------------------------*/
  1551.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetScrSvrForwardFromFmgr: short=%dn", is_short));
  1552.     if (!FMGR_FILTER_IS_SET(filter, FMGR_TYPE_GIF) &&
  1553. #ifdef JPG_DECODE
  1554.         !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_JPG) &&
  1555.         !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_JPEG) &&
  1556. #endif /* JPG_DECODE */ 
  1557. #if defined(GDI_USING_PNG)
  1558.         !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_PNG) &&
  1559. #endif 
  1560. #if defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) && defined(__MTK_TARGET__)
  1561. #ifdef MP4_CODEC
  1562.         !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_3GP) &&
  1563.         !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_MP4) &&
  1564.         !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_MPG) &&
  1565. #endif /* MP4_CODEC */ 
  1566. #ifdef MJPG_SUPPORT
  1567.         !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_AVI) &&
  1568. #endif 
  1569. #endif /* defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) && defined(__MTK_TARGET__) */ 
  1570. #ifdef M3D_MMI_SUPPORT
  1571.         !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_M3D) &&
  1572. #endif
  1573. #ifdef SVG_SUPPORT
  1574.         !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_SVG) &&
  1575. #endif
  1576. #ifdef __MMI_SWFLASH__
  1577.         !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_CMP) &&
  1578. #endif
  1579.         !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_BMP))
  1580.     {
  1581.         DisplayPopup((PU8) GetString(STR_GLOBAL_UNSUPPORTED_FORMAT), IMG_GLOBAL_ERROR, 0, 1000, ERROR_TONE);
  1582.         return;
  1583.     }
  1584.     if (path)
  1585.     {
  1586.         /* Prevent memory leck, after buffer is free, set pointer to NULL */
  1587.         ASSERT(phnset_dispchar_strp == NULL);
  1588.         g_phnset_cntx_p->isShort = is_short;
  1589.         phnset_dispchar_strp = OslMalloc(FMGR_PATH_BUFFER_SIZE);
  1590.         if (phnset_dispchar_strp)
  1591.         {
  1592.             pfnUnicodeStrcpy((S8*) phnset_dispchar_strp, (S8*) path);
  1593.         }
  1594.         else
  1595.         {
  1596.             GoBackToHistory(SCR_IDLE_SCR_DISP);
  1597.             return;
  1598.         }
  1599.         if (mmi_fmgr_forwardable_path((PS8) phnset_dispchar_strp))
  1600.         {
  1601.             error_str_ptr = (PS8) GetString(STR_ID_PHNSET_DISPCHAR_INVALID_PATH);
  1602.             DispIdleScrSvrBadFilePopup();
  1603.             PhnsetWpUsrDefFreeBuf();
  1604.             return;
  1605.         }
  1606.         /* file limitation check - limitation is define in file manager util */
  1607.         if (!mmi_fmgr_util_file_limit_check(FMGR_LIMIT_SCREEN_SAVER, (PS8) phnset_dispchar_strp, &error_str_ptr))
  1608.         {
  1609.             DispIdleScrSvrBadFilePopup();
  1610.             PhnsetWpUsrDefFreeBuf();
  1611.             return;
  1612.         }
  1613.         g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_SS;
  1614.         g_phnset_cntx_p->ScrAnchor = GetCurrScrnId();
  1615.         PhnsetWpUsrDefPreView();
  1616.     }
  1617.     else
  1618.         /* run to here means some kinds of image error occur */
  1619.     {
  1620.         DisplayPopup(
  1621.             (PU8) GetString(STR_GLOBAL_UNFINISHED),
  1622.             IMG_GLOBAL_ERROR,
  1623.             1,
  1624.             UI_POPUP_NOTIFYDURATION_TIME,
  1625.             ERROR_TONE);
  1626.     }
  1627. }
  1628. /*****************************************************************************
  1629.  * FUNCTION
  1630.  *  PhnsetSetScrSvrByFileName
  1631.  * DESCRIPTION
  1632.  *  Set Current screensaver by given path
  1633.  * PARAMETERS
  1634.  *  path        [?]     
  1635.  * RETURNS
  1636.  *  void
  1637.  *****************************************************************************/
  1638. void PhnsetSetScrSvrByFileName(S8 *path)
  1639. {
  1640.     /*----------------------------------------------------------------*/
  1641.     /* Local Variables                                                */
  1642.     /*----------------------------------------------------------------*/
  1643.     S16 error;
  1644.     /*----------------------------------------------------------------*/
  1645.     /* Code Body                                                      */
  1646.     /*----------------------------------------------------------------*/
  1647.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetSetScrSvrByFileName: short=%dn", g_phnset_cntx_p->isShort));
  1648.     if (g_phnset_cntx_p->isShort)
  1649.     {
  1650.         phnset_wpss_filename.isSSShort = 1;
  1651.     }
  1652.     else
  1653.     {
  1654.         phnset_wpss_filename.isSSShort = 0;
  1655.     }
  1656.     g_phnset_cntx_p->curSsID = 0;
  1657.     pfnUnicodeStrcpy((S8*) phnset_wpss_filename.screensave, (S8*) path);
  1658.     mmi_dispchar_set_img_id(NVRAM_CURRENT_SCREENSVER_ID, &(g_phnset_cntx_p->curSsID));
  1659.     WriteRecord(NVRAM_EF_WPSS_FILENAME_LID, 1, &phnset_wpss_filename, sizeof(phnset_wpss_filename), &error);
  1660.     g_phnset_cntx_p->isCorrectSet = 1;
  1661.     if (g_idle_context.IsOnIdleScreen)
  1662.     {
  1663.         EntryIdleScreen();
  1664.     }
  1665. }
  1666. /*****************************************************************************
  1667.  * FUNCTION
  1668.  *  PhnsetGetCurScrSvrFileName
  1669.  * DESCRIPTION
  1670.  *  get Current screensaver path
  1671.  * PARAMETERS
  1672.  *  void
  1673.  * RETURNS
  1674.  *  
  1675.  *****************************************************************************/
  1676. PS8 PhnsetGetCurScrSvrFileName(void)
  1677. {
  1678.     /*----------------------------------------------------------------*/
  1679.     /* Local Variables                                                */
  1680.     /*----------------------------------------------------------------*/
  1681.     /*----------------------------------------------------------------*/
  1682.     /* Code Body                                                      */
  1683.     /*----------------------------------------------------------------*/
  1684.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetCurScrSvrFileNamen"));
  1685.     return (PS8) phnset_wpss_filename.screensave;
  1686. }
  1687. /*****************************************************************************
  1688.  * FUNCTION
  1689.  *  PhnsetDwnlScrSvrHiliteHdlr
  1690.  * DESCRIPTION
  1691.  *  This function is highlight handler for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> Download
  1692.  *  Follow functions:
  1693.  * PARAMETERS
  1694.  *  nIndex      [IN]            
  1695.  *  a(?)        [IN/OUT]        
  1696.  *  b(?)        [IN]            
  1697.  * RETURNS
  1698.  *  void
  1699.  *****************************************************************************/
  1700. void PhnsetDwnlScrSvrHiliteHdlr(S32 nIndex)
  1701. {
  1702.     /*----------------------------------------------------------------*/
  1703.     /* Local Variables                                                */
  1704.     /*----------------------------------------------------------------*/
  1705.     /*----------------------------------------------------------------*/
  1706.     /* Code Body                                                      */
  1707.     /*----------------------------------------------------------------*/
  1708.     g_phnset_cntx_p->curHightlightItem = (U32) nIndex;
  1709. }
  1710. /*****************************************************************************
  1711.  * FUNCTION
  1712.  *  EntryPhnsetScrSvrDwnlView
  1713.  * DESCRIPTION
  1714.  *  This function is Entry function for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> Download -> View
  1715.  *  Following functions:   PhnsetScrSvrDwnlViewLskHdlr
  1716.  *  PhnsetScrSvrDwnlViewPre
  1717.  *  PhnsetScrSvrDwnlViewNext
  1718.  * PARAMETERS
  1719.  *  void
  1720.  *  a(?)        [IN/OUT]        
  1721.  *  b(?)        [IN]            
  1722.  * RETURNS
  1723.  *  void
  1724.  *****************************************************************************/
  1725. void EntryPhnsetScrSvrDwnlView(void)
  1726. {
  1727.     /*----------------------------------------------------------------*/
  1728.     /* Local Variables                                                */
  1729.     /*----------------------------------------------------------------*/
  1730.     PU8 ssName;
  1731.     U8 *guiBuffer;
  1732.     U16 screenSaverId = g_phnset_cntx_p->DwnlWPSSList[g_phnset_cntx_p->curHightlightItem];
  1733.     /*----------------------------------------------------------------*/
  1734.     /* Code Body                                                      */
  1735.     /*----------------------------------------------------------------*/
  1736.     guiBuffer = GetCurrGuiBuffer(SCR_SCREENSAVER_DOWNLOAD_VIEW);
  1737.     if (g_phnset_cntx_p->WPSSPreviewScrFlag)
  1738.     {
  1739.         EntryNewScreen(SCR_SCREENSAVER_DOWNLOAD_VIEW, ExitPhnsetScrSvrDwnlView, EntryPhnsetScrSvrDwnlView, NULL);
  1740.     }
  1741.     ssName = (PU8) PhnsetGetScrSvrNameById(screenSaverId);
  1742. #if defined(__MMI_TOUCH_SCREEN__)
  1743.     /* register the handlers for pen down event. */
  1744.     register_touch_button_handlers(NULL, PhnsetScrSvrDwnlViewPre, NULL, PhnsetScrSvrDwnlViewNext);
  1745. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1746.     wgui_set_touch_title_bar_buttons(); /* enable the display of title bar buttons */
  1747.     ShowCategory129Screen(
  1748.         ssName,
  1749.         0,
  1750.         STR_GLOBAL_OK,
  1751.         IMG_GLOBAL_OK,
  1752.         STR_GLOBAL_BACK,
  1753.         IMG_GLOBAL_BACK,
  1754.         screenSaverId,
  1755.         guiBuffer);
  1756.     SetLeftSoftkeyFunction(PhnsetScrSvrDwnlViewLskHdlr, KEY_EVENT_UP);
  1757.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1758.     /* changed the up-down arrow key handlers to left-right arrow key handlers
  1759.        for having the similar behaviour of keypad and touchscreen. */
  1760.     /* change the key handler for KEY UP event to KEY DOWN event. */
  1761.     SetKeyHandler(PhnsetScrSvrDwnlViewPre, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1762.     SetKeyHandler(PhnsetScrSvrDwnlViewPre, KEY_VOL_UP, KEY_EVENT_DOWN);
  1763.     SetKeyHandler(PhnsetScrSvrDwnlViewPre, KEY_VOL_UP, KEY_LONG_PRESS);
  1764.     SetKeyHandler(PhnsetScrSvrDwnlViewNext, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1765.     SetKeyHandler(PhnsetScrSvrDwnlViewNext, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  1766.     SetKeyHandler(PhnsetScrSvrDwnlViewNext, KEY_VOL_DOWN, KEY_LONG_PRESS);
  1767. }
  1768. /*****************************************************************************
  1769.  * FUNCTION
  1770.  *  ExitPhnsetScrSvrDwnlView
  1771.  * DESCRIPTION
  1772.  *  This function is Exit function for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> Download -> View
  1773.  *  Following functions:
  1774.  * PARAMETERS
  1775.  *  void
  1776.  *  a(?)        [IN/OUT]        
  1777.  *  b(?)        [IN]            
  1778.  * RETURNS
  1779.  *  void
  1780.  *****************************************************************************/
  1781. void ExitPhnsetScrSvrDwnlView(void)
  1782. {
  1783.     /*----------------------------------------------------------------*/
  1784.     /* Local Variables                                                */
  1785.     /*----------------------------------------------------------------*/
  1786.     /*----------------------------------------------------------------*/
  1787.     /* Code Body                                                      */
  1788.     /*----------------------------------------------------------------*/
  1789.     g_phnset_cntx_p->WPSSPreviewScrFlag = 1;
  1790. }
  1791. /*****************************************************************************
  1792.  * FUNCTION
  1793.  *  PhnsetScrSvrDwnlViewPre
  1794.  * DESCRIPTION
  1795.  *  This function is to view preview screen saver
  1796.  *  for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> Download -> View
  1797.  * PARAMETERS
  1798.  *  void
  1799.  *  a(?)        [IN/OUT]        
  1800.  *  b(?)        [IN]            
  1801.  * RETURNS
  1802.  *  void
  1803.  *****************************************************************************/
  1804. void PhnsetScrSvrDwnlViewPre(void)
  1805. {
  1806.     /*----------------------------------------------------------------*/
  1807.     /* Local Variables                                                */
  1808.     /*----------------------------------------------------------------*/
  1809.     /*----------------------------------------------------------------*/
  1810.     /* Code Body                                                      */
  1811.     /*----------------------------------------------------------------*/
  1812.     ExitCategoryFunction();
  1813.     if (g_phnset_cntx_p->curHightlightItem == 0)
  1814.     {
  1815.         g_phnset_cntx_p->curHightlightItem = g_phnset_cntx_p->SSDwnlImgNum;
  1816.     }
  1817.     g_phnset_cntx_p->curHightlightItem--;
  1818.     g_phnset_cntx_p->WPSSPreviewScrFlag = 0;
  1819.     EntryPhnsetScrSvrDwnlView();
  1820. }
  1821. /*****************************************************************************
  1822.  * FUNCTION
  1823.  *  PhnsetScrSvrDwnlViewNext
  1824.  * DESCRIPTION
  1825.  *  This function is to view next screen saver
  1826.  *  for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> Download -> View
  1827.  * PARAMETERS
  1828.  *  void
  1829.  *  a(?)        [IN/OUT]        
  1830.  *  b(?)        [IN]            
  1831.  * RETURNS
  1832.  *  void
  1833.  *****************************************************************************/
  1834. void PhnsetScrSvrDwnlViewNext(void)
  1835. {
  1836.     /*----------------------------------------------------------------*/
  1837.     /* Local Variables                                                */
  1838.     /*----------------------------------------------------------------*/
  1839.     /*----------------------------------------------------------------*/
  1840.     /* Code Body                                                      */
  1841.     /*----------------------------------------------------------------*/
  1842.     if (g_phnset_cntx_p->curHightlightItem >= g_phnset_cntx_p->SSDwnlImgNum - 1)
  1843.     {
  1844.         g_phnset_cntx_p->curHightlightItem = -1;
  1845.     }
  1846.     g_phnset_cntx_p->curHightlightItem++;
  1847.     g_phnset_cntx_p->WPSSPreviewScrFlag = 0;
  1848.     EntryPhnsetScrSvrDwnlView();
  1849. }
  1850. /*****************************************************************************
  1851.  * FUNCTION
  1852.  *  PhnsetScrSvrDwnlViewLskHdlrDone
  1853.  * DESCRIPTION
  1854.  *  This function is Left softkey handler
  1855.  *  for Phonesetup->IdleScreenDisplay->ScreenSaver -> Select -> Download -> View
  1856.  * PARAMETERS
  1857.  *  void
  1858.  *  a(?)        [IN/OUT]        
  1859.  *  b(?)        [IN]            
  1860.  * RETURNS
  1861.  *  void
  1862.  *****************************************************************************/
  1863. void PhnsetScrSvrDwnlViewLskHdlrDone(void)
  1864. {
  1865.     /*----------------------------------------------------------------*/
  1866.     /* Local Variables                                                */
  1867.     /*----------------------------------------------------------------*/
  1868.     /*----------------------------------------------------------------*/
  1869.     /* Code Body                                                      */
  1870.     /*----------------------------------------------------------------*/
  1871.     GoBackToHistory(SCR_MAIN_SCREENSAVER);
  1872. }
  1873. /*****************************************************************************
  1874.  * FUNCTION
  1875.  *  PhnsetScrSvrDwnlViewLskHdlr
  1876.  * DESCRIPTION
  1877.  *  ...
  1878.  * PARAMETERS
  1879.  *  void
  1880.  *  a(?)        [IN/OUT]        
  1881.  *  b(?)        [IN]            
  1882.  * RETURNS
  1883.  *  void
  1884.  *****************************************************************************/
  1885. void PhnsetScrSvrDwnlViewLskHdlr(void)
  1886. {
  1887.     /*----------------------------------------------------------------*/
  1888.     /* Local Variables                                                */
  1889.     /*----------------------------------------------------------------*/
  1890.     /*----------------------------------------------------------------*/
  1891.     /* Code Body                                                      */
  1892.     /*----------------------------------------------------------------*/
  1893.     DisplayPopupCallBack(
  1894.         (PU8) GetString(STR_GLOBAL_DONE),
  1895.         IMG_GLOBAL_ACTIVATED,
  1896.         1,
  1897.         ST_NOTIFYDURATION,
  1898.         SUCCESS_TONE,
  1899.         PhnsetScrSvrDwnlViewLskHdlrDone);
  1900.     g_phnset_cntx_p->curSsID = g_phnset_cntx_p->DwnlWPSSList[g_phnset_cntx_p->curHightlightItem];
  1901.     mmi_dispchar_set_img_id(NVRAM_CURRENT_SCREENSVER_ID, &(g_phnset_cntx_p->curSsID));
  1902. }
  1903. #endif /* defined(__MMI_FILE_MANAGER__) */ /* __MMI_WAP__ */
  1904. /*
  1905.  * Externel Interfaces
  1906.  */
  1907. /*****************************************************************************
  1908.  * FUNCTION
  1909.  *  PhnsetRstScrSvrDefault
  1910.  * DESCRIPTION
  1911.  *  This function is to set screen saver status/waiting time/image to default value
  1912.  * PARAMETERS
  1913.  *  void
  1914.  *  a(?)        [IN/OUT]        
  1915.  *  b(?)        [IN]            
  1916.  * RETURNS
  1917.  *  void
  1918.  *****************************************************************************/
  1919. void PhnsetRstScrSvrDefault(void)
  1920. {
  1921.     /*----------------------------------------------------------------*/
  1922.     /* Local Variables                                                */
  1923.     /*----------------------------------------------------------------*/
  1924.     /*----------------------------------------------------------------*/
  1925.     /* Code Body                                                      */
  1926.     /*----------------------------------------------------------------*/
  1927.     g_phnset_cntx_p->curSsID = RstGetScrSaverImgIdDefault();
  1928.     mmi_dispchar_set_img_id(NVRAM_CURRENT_SCREENSVER_ID, &(g_phnset_cntx_p->curSsID));
  1929.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetRstScrSvrDefault: ID=%dn", g_phnset_cntx_p->curSsID));
  1930. }
  1931. /*****************************************************************************
  1932.  * FUNCTION
  1933.  *  PhnsetGetCurScrSvr
  1934.  * DESCRIPTION
  1935.  *  This function is to get screen saver image ID to default value
  1936.  * PARAMETERS
  1937.  *  screenSaver     [?]             
  1938.  *  a(?)            [IN/OUT]        
  1939.  *  b(?)            [IN]            
  1940.  * RETURNS
  1941.  *  void
  1942.  *****************************************************************************/
  1943. void PhnsetGetCurScrSvr(U16 *screenSaver)
  1944. {
  1945.     /*----------------------------------------------------------------*/
  1946.     /* Local Variables                                                */
  1947.     /*----------------------------------------------------------------*/
  1948.     /*----------------------------------------------------------------*/
  1949.     /* Code Body                                                      */
  1950.     /*----------------------------------------------------------------*/
  1951.     *screenSaver = g_phnset_cntx_p->curSsID;
  1952.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetCurScrSvr: ID=%dn", g_phnset_cntx_p->curSsID));
  1953. }
  1954. /*****************************************************************************
  1955.  * FUNCTION
  1956.  *  PhnsetGetScrSvrSetings
  1957.  * DESCRIPTION
  1958.  *  This function is to get screen saver setting status
  1959.  * PARAMETERS
  1960.  *  ScreenSaverStatus       [?]             
  1961.  *  ScreenSaverWait         [?]             
  1962.  *  a(?)                    [IN/OUT]        
  1963.  *  b(?)                    [IN]            
  1964.  * RETURNS
  1965.  *  void
  1966.  *****************************************************************************/
  1967. void PhnsetGetScrSvrSetings(U8 *ScreenSaverStatus, U8 *ScreenSaverWait)
  1968. {
  1969.     /*----------------------------------------------------------------*/
  1970.     /* Local Variables                                                */
  1971.     /*----------------------------------------------------------------*/
  1972.     /*----------------------------------------------------------------*/
  1973.     /* Code Body                                                      */
  1974.     /*----------------------------------------------------------------*/
  1975.     *ScreenSaverStatus = (U8) g_phnset_cntx_p->curSSStatus;
  1976.     *ScreenSaverWait = (U8) g_phnset_cntx_p->curSSWaitTime;
  1977.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetScrSvrSetings: status=%d, time=%dn",
  1978.                          g_phnset_cntx_p->curSSStatus, g_phnset_cntx_p->curSSWaitTime));
  1979. }
  1980. /*****************************************************************************
  1981.  * FUNCTION
  1982.  *  PhnsetReadNvramScrSvrSettings
  1983.  * DESCRIPTION
  1984.  *  This function is to read screen saver setting status/waiting time/image from nvram
  1985.  * PARAMETERS
  1986.  *  void
  1987.  *  a(?)        [IN/OUT]        
  1988.  *  b(?)        [IN]            
  1989.  * RETURNS
  1990.  *  void
  1991.  *****************************************************************************/
  1992. void PhnsetReadNvramScrSvrSettings(void)
  1993. {
  1994.     /*----------------------------------------------------------------*/
  1995.     /* Local Variables                                                */
  1996.     /*----------------------------------------------------------------*/
  1997.     S16 error;
  1998.     PHNSET_TYPE_DISP type;
  1999.     phnset_wpss_type_enum temp_type = g_phnset_cntx_p->wpss_type;
  2000.     /*----------------------------------------------------------------*/
  2001.     /* Code Body                                                      */
  2002.     /*----------------------------------------------------------------*/
  2003.     ReadValue(NVRAM_SCREENSAVER_STATUS, &(g_phnset_cntx_p->curSSStatus), DS_BYTE, &error);
  2004.     ReadValue(NVRAM_SCREENSAVER_WAITING, &(g_phnset_cntx_p->curSSWaitTime), DS_BYTE, &error);
  2005.     mmi_dispchar_get_img_id(NVRAM_CURRENT_SCREENSVER_ID, &(g_phnset_cntx_p->curSsID));
  2006.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetReadNvramScrSvrSettings: ID=%d, status=%d, time=%dn",
  2007.                          g_phnset_cntx_p->curSsID, g_phnset_cntx_p->curSSStatus, g_phnset_cntx_p->curSSWaitTime));
  2008. #ifndef __MMI_LCD_PARTIAL_ON__
  2009.     /* If __MMI_LCD_PARTIAL_ON__ is turned off without reseting NVRAM */
  2010.     if (g_phnset_cntx_p->curSSStatus == (S32) SET_SS_STATUS_POWERSAVING)
  2011.     {
  2012.         g_phnset_cntx_p->curSSStatus = 0xFF;
  2013.     }
  2014. #endif /* __MMI_LCD_PARTIAL_ON__ */ 
  2015.     if (g_phnset_cntx_p->curSSStatus == 0xFF)
  2016.     {
  2017.         g_phnset_cntx_p->curSSStatus = RstGetScrSaverStatusDefault();
  2018.         WriteValue(NVRAM_SCREENSAVER_STATUS, &(g_phnset_cntx_p->curSSStatus), DS_BYTE, &error);
  2019.     }
  2020.     if (g_phnset_cntx_p->curSSWaitTime == 0xFF)
  2021.     {
  2022.         g_phnset_cntx_p->curSSWaitTime = RstGetScrSaverWaitingDefault();
  2023.         WriteValue(NVRAM_SCREENSAVER_WAITING, &g_phnset_cntx_p->curSSWaitTime, DS_BYTE, &error);
  2024.     }
  2025.     if ((type = PhnsetGetDisplayType(g_phnset_cntx_p->curSsID)) == PHNSET_TYPE_DISP_INVALID)
  2026.     {
  2027.         g_phnset_cntx_p->curSsID = RstGetScrSaverImgIdDefault();
  2028.         mmi_dispchar_set_img_id(NVRAM_CURRENT_SCREENSVER_ID, &(g_phnset_cntx_p->curSsID));
  2029.     }
  2030. #ifdef __MMI_FILE_MANAGER__    
  2031.     else if (type == PHNSET_TYPE_DISP_USER)
  2032.     {
  2033.         ReadRecord(NVRAM_EF_WPSS_FILENAME_LID, 1, &phnset_wpss_filename, sizeof(phnset_wpss_filename), &error);
  2034.         if (error != NVRAM_READ_SUCCESS)
  2035.         {
  2036.             memset(&phnset_wpss_filename, 0, sizeof(phnset_wpss_filename));
  2037.             g_phnset_cntx_p->curSsID = RstGetScrSaverImgIdDefault();
  2038.             mmi_dispchar_set_img_id(NVRAM_CURRENT_SCREENSVER_ID, &(g_phnset_cntx_p->curSsID));
  2039.         }
  2040.     }
  2041. #endif /* __MMI_FILE_MANAGER__ */
  2042.     g_phnset_cntx_p->wpss_type = temp_type;
  2043. }
  2044. /*****************************************************************************
  2045.  * FUNCTION
  2046.  *  PhnsetGetCurScrSvrName
  2047.  * DESCRIPTION
  2048.  *  This function is to get screen saver name string ptr
  2049.  * PARAMETERS
  2050.  *  void
  2051.  *  a(?)        [IN/OUT]        
  2052.  *  b(?)        [IN]            
  2053.  * RETURNS
  2054.  *  void
  2055.  *****************************************************************************/
  2056. PS8 PhnsetGetCurScrSvrName(void)
  2057. {
  2058.     /*----------------------------------------------------------------*/
  2059.     /* Local Variables                                                */
  2060.     /*----------------------------------------------------------------*/
  2061.     /*----------------------------------------------------------------*/
  2062.     /* Code Body                                                      */
  2063.     /*----------------------------------------------------------------*/
  2064.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetCurScrSvrName: ID=%dn", g_phnset_cntx_p->curSsID));
  2065. #ifdef __MMI_FILE_MANAGER__
  2066.     if (g_phnset_cntx_p->curSsID == 0)
  2067.     {
  2068.         if (phnset_wpss_filename.isSSShort == 1)
  2069.         {
  2070.             U8 *temp = phnset_dispchar_temp;
  2071.             PS8 p;
  2072.             /* rename short name file should pass converted short name to editor,
  2073.                so that the display will be the same as in File Manager */
  2074.             p = PhnsetGetFileNamePointer((S8*) phnset_wpss_filename.screensave);
  2075.             mmi_chset_mixed_text_to_ucs2_str(
  2076.                 (U8*) temp,
  2077.                 (FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH,
  2078.                 (U8*) p,
  2079.                 (mmi_chset_enum) PhnsetGetDefEncodingType());
  2080.             p = (PS8) & temp[0];
  2081.             return p;
  2082.         }
  2083.         else
  2084.         {
  2085.             return PhnsetGetFileNamePointer((S8*) phnset_wpss_filename.screensave);
  2086.         }
  2087.     }
  2088.     else
  2089. #endif /* __MMI_FILE_MANAGER__ */ 
  2090.         return PhnsetGetScrSvrNameById(g_phnset_cntx_p->curSsID);
  2091. }
  2092. /*****************************************************************************
  2093.  * FUNCTION
  2094.  *  PhnsetGetScrSvrNameById
  2095.  * DESCRIPTION
  2096.  *  This function is to get screen saver name string ptr by image ID
  2097.  * PARAMETERS
  2098.  *  Id          [IN]            
  2099.  *  a(?)        [IN/OUT]        
  2100.  *  b(?)        [IN]            
  2101.  * RETURNS
  2102.  *  void
  2103.  *****************************************************************************/
  2104. PS8 PhnsetGetScrSvrNameById(U16 Id)
  2105. {
  2106.     /*----------------------------------------------------------------*/
  2107.     /* Local Variables                                                */
  2108.     /*----------------------------------------------------------------*/
  2109.     PS8 ssName = NULL;
  2110.     U32 strID;
  2111.     /*----------------------------------------------------------------*/
  2112.     /* Code Body                                                      */
  2113.     /*----------------------------------------------------------------*/
  2114.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetScrSvrNameById: ID=%dn", Id));
  2115. #if defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) && defined(__MTK_TARGET__)
  2116.     if (Id >= IMG_ID_PHNSET_SS_VDO_START && Id <= IMG_ID_PHNSET_SS_VDO_MAX)
  2117.     {
  2118.         ssName = GetString((U16) STR_ID_PHNSET_DISPCHAR_VDOID_START + (Id - IMG_ID_PHNSET_SS_VDO_START));
  2119.     }
  2120.     else
  2121. #endif /* defined(__MMI_SCREENSAVER_DISPLAY_VIDEO__) && defined(__MTK_TARGET__) */ /* defined( __MMI_POWER_ON_OFF_DISPLAY_VIDEO__ ) && defined(__MTK_TARGET__) */
  2122.     if (Id >= IMG_ID_PHNSET_SS_START && Id <= IMG_ID_PHNSET_SS_MAX)
  2123.     {
  2124.         strID = STR_ID_PHNSET_DISPCHAR_IMGID_START + (Id - IMG_ID_PHNSET_SS_START);
  2125.         ssName = GetString((U16) strID);
  2126.     }
  2127.     else if ((strID = getFactoryImageRelativeIndex(Id)) != 0)
  2128.     {
  2129.         DYNIMAGEINFO *Info;
  2130.         U8 i;
  2131.         U8 noFactImages = GetFullScreenFactoryImagesInfo(&Info);
  2132.         for (i = 0; i < noFactImages; i++)
  2133.         {
  2134.             if (Id == Info[i].ImagesId)
  2135.             {
  2136.                 strID = STR_ID_PHNSET_DISPCHAR_IMGID_START + MAX_SCREENSAVER_IMG + i;
  2137.                 break;
  2138.             }
  2139.         }
  2140.         ssName = GetString((U16) strID);
  2141.     }
  2142. #ifndef __MMI_UI_TECHNO_IDLESCREEN_BAR__    
  2143. #ifdef __MMI_ANALOG_CLOCK__
  2144.     else if (Id == IMG_ID_DISPCHAR_ANALOG_CLK)
  2145.     {
  2146.         strID = STR_ID_PHNSET_DISPCHAR_ANALOG;
  2147.         ssName = GetString((U16) strID);
  2148.     }
  2149. #endif /* __MMI_ANALOG_CLOCK__ */ 
  2150. #ifdef __MMI_DIGITAL_CLOCK__
  2151.     else if (Id == IMG_ID_DISPCHAR_DIGITAL_CLK)
  2152.     {
  2153.         strID = STR_ID_PHNSET_DISPCHAR_DIGITAL;
  2154.         ssName = GetString((U16) strID);
  2155.     }
  2156. #endif /* __MMI_DIGITAL_CLOCK__ */ 
  2157. #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
  2158. #ifdef __MMI_THEMES_V2_SUPPORT__
  2159.     else if (Id == IMG_ID_DISPCHAR_THEME_SCREENSAVER)
  2160.     {
  2161.         strID = STR_ID_DISPCHAR_THEME_SCREENSAVER;
  2162.         ssName = GetString((U16) strID);
  2163.     }
  2164. #endif /* __MMI_THEMES_V2_SUPPORT__ */ 
  2165. #ifdef __MMI_SWFLASH__
  2166. else if (Id >= IMG_ID_DISPCHAR_SWFLASH_START && Id <= IMG_ID_DISPCHAR_SWFLASH_MAX)
  2167. {
  2168.     strID = STR_ID_DISPCHAR_SWFLASH_START + (Id - IMG_ID_DISPCHAR_SWFLASH_START);
  2169.     ssName = GetString((U16) strID);
  2170. }
  2171. #endif /* __MMI_SWFLASH__ */
  2172.     return ssName;
  2173. }
  2174. /*****************************************************************************
  2175.  * FUNCTION
  2176.  *  PhnsetGetCurScrSvrStatus
  2177.  * DESCRIPTION
  2178.  *  This function is to get screen saver status on/off
  2179.  * PARAMETERS
  2180.  *  void
  2181.  *  a(?)        [IN/OUT]        
  2182.  *  b(?)        [IN]            
  2183.  * RETURNS
  2184.  *  0 OFF, 1 ON
  2185.  *****************************************************************************/
  2186. SET_SS_SETTING_STATUS PhnsetGetCurScrSvrStatus(void)
  2187. {
  2188.     /*----------------------------------------------------------------*/
  2189.     /* Local Variables                                                */
  2190.     /*----------------------------------------------------------------*/
  2191.     /*----------------------------------------------------------------*/
  2192.     /* Code Body                                                      */
  2193.     /*----------------------------------------------------------------*/
  2194.     switch (g_phnset_cntx_p->curSSStatus)
  2195.     {
  2196.         case 1:
  2197.             return SET_SS_STATUS_ON;
  2198.     #ifdef __MMI_LCD_PARTIAL_ON__
  2199.         case 2:
  2200.             return SET_SS_STATUS_POWERSAVING;
  2201.     #endif /* __MMI_LCD_PARTIAL_ON__ */ 
  2202.         default:
  2203.             return SET_SS_STATUS_OFF;
  2204.     }
  2205. }
  2206. /*****************************************************************************
  2207.  * FUNCTION
  2208.  *  PhnsetIsScrSvrAnalogClock
  2209.  * DESCRIPTION
  2210.  *  This function is to query if screen set Analog Clock
  2211.  * PARAMETERS
  2212.  *  void
  2213.  *  a(?)        [IN/OUT]        
  2214.  *  b(?)        [IN]            
  2215.  * RETURNS
  2216.  *  0 OFF, 1 ON
  2217.  *****************************************************************************/
  2218. BOOL PhnsetIsScrSvrAnalogClock(void)
  2219. {
  2220.     /*----------------------------------------------------------------*/
  2221.     /* Local Variables                                                */
  2222.     /*----------------------------------------------------------------*/
  2223.     /*----------------------------------------------------------------*/
  2224.     /* Code Body                                                      */
  2225.     /*----------------------------------------------------------------*/
  2226. #ifndef __MMI_UI_TECHNO_IDLESCREEN_BAR__    
  2227. #ifdef __MMI_ANALOG_CLOCK__
  2228.     if (g_phnset_cntx_p->curSsID == IMG_ID_DISPCHAR_ANALOG_CLK)
  2229.     {
  2230.         return TRUE;
  2231.     }
  2232.     else
  2233. #endif /* __MMI_ANALOG_CLOCK__ */ 
  2234. #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
  2235.         return FALSE;
  2236. }
  2237. /*****************************************************************************
  2238.  * FUNCTION
  2239.  *  PhnsetIsScrSvrDigitalClock
  2240.  * DESCRIPTION
  2241.  *  This function is to query if screen set Digital Clock
  2242.  * PARAMETERS
  2243.  *  void
  2244.  *  a(?)        [IN/OUT]        
  2245.  *  b(?)        [IN]            
  2246.  * RETURNS
  2247.  *  0 OFF, 1 ON
  2248.  *****************************************************************************/
  2249. BOOL PhnsetIsScrSvrDigitalClock(void)
  2250. {
  2251.     /*----------------------------------------------------------------*/
  2252.     /* Local Variables                                                */
  2253.     /*----------------------------------------------------------------*/
  2254.     /*----------------------------------------------------------------*/
  2255.     /* Code Body                                                      */
  2256.     /*----------------------------------------------------------------*/
  2257. #ifndef __MMI_UI_TECHNO_IDLESCREEN_BAR__    
  2258. #ifdef __MMI_DIGITAL_CLOCK__
  2259.     if (g_phnset_cntx_p->curSsID == IMG_ID_DISPCHAR_DIGITAL_CLK)
  2260.     {
  2261.         return TRUE;
  2262.     }
  2263.     else
  2264. #endif /* __MMI_DIGITAL_CLOCK__ */ 
  2265. #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
  2266.         return FALSE;
  2267. }
  2268. /*****************************************************************************
  2269.  * FUNCTION
  2270.  *  PhnsetIsScrSvrPartialOn
  2271.  * DESCRIPTION
  2272.  *  To check if the current screensaver is the partial one.
  2273.  * PARAMETERS
  2274.  *  void
  2275.  *  a(?)        [IN/OUT]        
  2276.  *  b(?)        [IN]            
  2277.  * RETURNS
  2278.  *  0 OFF, 1 ON
  2279.  *****************************************************************************/
  2280. BOOL PhnsetIsScrSvrPartialOn(void)
  2281. {
  2282.     /*----------------------------------------------------------------*/
  2283.     /* Local Variables                                                */
  2284.     /*----------------------------------------------------------------*/
  2285.     /*----------------------------------------------------------------*/
  2286.     /* Code Body                                                      */
  2287.     /*----------------------------------------------------------------*/
  2288. #ifdef __MMI_LCD_PARTIAL_ON__
  2289.     if (g_phnset_cntx_p->curSSStatus == (S32) SET_SS_STATUS_POWERSAVING)
  2290.     {
  2291.         return TRUE;
  2292.     }
  2293.     else
  2294. #endif /* __MMI_LCD_PARTIAL_ON__ */ 
  2295.         return FALSE;
  2296. }
  2297. /*****************************************************************************
  2298.  * FUNCTION
  2299.  *  mmi_phnset_disable_partial_ss
  2300.  * DESCRIPTION
  2301.  *  To disable partial screensaver.
  2302.  * PARAMETERS
  2303.  *  void
  2304.  * RETURNS
  2305.  *  void
  2306.  *****************************************************************************/
  2307. void mmi_phnset_disable_partial_ss(void)
  2308. {
  2309.     /*----------------------------------------------------------------*/
  2310.     /* Local Variables                                                */
  2311.     /*----------------------------------------------------------------*/
  2312.     /*----------------------------------------------------------------*/
  2313.     /* Code Body                                                      */
  2314.     /*----------------------------------------------------------------*/
  2315. #ifdef __MMI_LCD_PARTIAL_ON__
  2316.     g_phnset_cntx_p->curSSStatus = (S32) SET_SS_STATUS_OFF;
  2317. #endif 
  2318. }
  2319. /*****************************************************************************
  2320.  * FUNCTION
  2321.  *  mmi_phnset_enable_partial_ss
  2322.  * DESCRIPTION
  2323.  *  To enable partial screensaver.
  2324.  * PARAMETERS
  2325.  *  void
  2326.  * RETURNS
  2327.  *  void
  2328.  *****************************************************************************/
  2329. void mmi_phnset_enable_partial_ss(void)
  2330. {
  2331.     /*----------------------------------------------------------------*/
  2332.     /* Local Variables                                                */
  2333.     /*----------------------------------------------------------------*/
  2334. #ifdef __MMI_LCD_PARTIAL_ON__
  2335.     S16 error;
  2336. #endif 
  2337.     /*----------------------------------------------------------------*/
  2338.     /* Code Body                                                      */
  2339.     /*----------------------------------------------------------------*/
  2340. #ifdef __MMI_LCD_PARTIAL_ON__
  2341.     ReadValue(NVRAM_SCREENSAVER_STATUS, &(g_phnset_cntx_p->curSSStatus), DS_BYTE, &error);
  2342. #endif 
  2343. }
  2344. #ifdef __MMI_THEMES_V2_SUPPORT__
  2345. /*****************************************************************************
  2346.  * FUNCTION
  2347.  *  PhnsetIsScrSvrCurrentTheme
  2348.  * DESCRIPTION
  2349.  *  To check if the current screensaver is the current theme.
  2350.  * PARAMETERS
  2351.  *  void
  2352.  *  a(?)        [IN/OUT]        
  2353.  *  b(?)        [IN]            
  2354.  * RETURNS
  2355.  *  0 OFF, 1 ON
  2356.  *****************************************************************************/
  2357. BOOL PhnsetIsScrSvrCurrentTheme(void)
  2358. {
  2359.     /*----------------------------------------------------------------*/
  2360.     /* Local Variables                                                */
  2361.     /*----------------------------------------------------------------*/
  2362.     /*----------------------------------------------------------------*/
  2363.     /* Code Body                                                      */
  2364.     /*----------------------------------------------------------------*/
  2365.     if (g_phnset_cntx_p->curSsID == IMG_ID_DISPCHAR_THEME_SCREENSAVER)
  2366.     {
  2367.         return TRUE;
  2368.     }
  2369.     else
  2370.     {
  2371.         return FALSE;
  2372.     }
  2373. }
  2374. #endif /* __MMI_THEMES_V2_SUPPORT__ */ 
  2375. #ifdef __USB_IN_NORMAL_MODE__
  2376. /*****************************************************************************
  2377.  * FUNCTION
  2378.  *  PhnsetSSUseDefault
  2379.  * DESCRIPTION
  2380.  *  Use default build-in screensaver
  2381.  * PARAMETERS
  2382.  *  void
  2383.  * RETURNS
  2384.  *  void
  2385.  *****************************************************************************/
  2386. void PhnsetSSUseDefault(void)
  2387. {
  2388. #ifdef __MMI_FILE_MANAGER__    
  2389.     /*----------------------------------------------------------------*/
  2390.     /* Local Variables                                                */
  2391.     /*----------------------------------------------------------------*/
  2392.     PHNSET_TYPE_DISP type;
  2393.     /*----------------------------------------------------------------*/
  2394.     /* Code Body                                                      */
  2395.     /*----------------------------------------------------------------*/
  2396.     if ((type = PhnsetGetDisplayType(g_phnset_cntx_p->curSsID)) == PHNSET_TYPE_DISP_USER
  2397.         && (mmi_usb_check_path_exported((S8*) phnset_wpss_filename.screensave)))
  2398.     {
  2399.         g_phnset_cntx_p->curSsID = RstGetScrSaverImgIdDefault();
  2400.     }
  2401.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetSSUseDefault: ID=%dn", g_phnset_cntx_p->curSsID));
  2402. #endif /* __MMI_FILE_MANAGER__ */
  2403. }
  2404. #endif /* __USB_IN_NORMAL_MODE__ */ 
  2405. #endif /* _SCREENSAVER_C */