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

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.  *   wgui_categories_idlescreen.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   Maui_Software
  44.  *
  45.  * Description:
  46.  * ------------
  47.  * Idle Screen related categories.
  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.  * removed!
  232.  * removed!
  233.  * removed!
  234.  *
  235.  * removed!
  236.  * removed!
  237.  * removed!
  238.  *
  239.  * removed!
  240.  * removed!
  241.  * removed!
  242.  *
  243.  * removed!
  244.  * removed!
  245.  * removed!
  246.  *
  247.  * removed!
  248.  * removed!
  249.  * removed!
  250.  *
  251.  * removed!
  252.  * removed!
  253.  * removed!
  254.  *
  255.  * removed!
  256.  * removed!
  257.  * removed!
  258.  *
  259.  * removed!
  260.  * removed!
  261.  * removed!
  262.  *
  263.  * removed!
  264.  * removed!
  265.  * removed!
  266.  *
  267.  * removed!
  268.  * removed!
  269.  * removed!
  270.  *
  271.  * removed!
  272.  * removed!
  273.  * removed!
  274.  *
  275.  * removed!
  276.  * removed!
  277.  * removed!
  278.  *
  279.  * removed!
  280.  * removed!
  281.  * removed!
  282.  *
  283.  * removed!
  284.  * removed!
  285.  * removed!
  286.  *
  287.  * removed!
  288.  * removed!
  289.  * removed!
  290.  *
  291.  * removed!
  292.  * removed!
  293.  * removed!
  294.  *
  295.  * removed!
  296.  * removed!
  297.  * removed!
  298.  *
  299.  * removed!
  300.  * removed!
  301.  * removed!
  302.  *
  303.  * removed!
  304.  * removed!
  305.  * removed!
  306.  *
  307.  * removed!
  308.  * removed!
  309.  * removed!
  310.  *
  311.  * removed!
  312.  * removed!
  313.  * removed!
  314.  *
  315.  * removed!
  316.  * removed!
  317.  * removed!
  318.  *
  319.  * removed!
  320.  * removed!
  321.  * removed!
  322.  *
  323.  * removed!
  324.  * removed!
  325.  * removed!
  326.  *
  327.  * removed!
  328.  * removed!
  329.  * removed!
  330.  *
  331.  * removed!
  332.  * removed!
  333.  * removed!
  334.  *
  335.  * removed!
  336.  * removed!
  337.  * removed!
  338.  *
  339.  * removed!
  340.  * removed!
  341.  * removed!
  342.  *
  343.  * removed!
  344.  * removed!
  345.  * removed!
  346.  *
  347.  * removed!
  348.  * removed!
  349.  * removed!
  350.  *
  351.  * removed!
  352.  * removed!
  353.  * removed!
  354.  *
  355.  * removed!
  356.  * removed!
  357.  * removed!
  358.  *
  359.  * removed!
  360.  * removed!
  361.  * removed!
  362.  *
  363.  * removed!
  364.  * removed!
  365.  * removed!
  366.  *
  367.  * removed!
  368.  * removed!
  369.  * removed!
  370.  *
  371.  * removed!
  372.  * removed!
  373.  * removed!
  374.  *
  375.  * removed!
  376.  * removed!
  377.  * removed!
  378.  *
  379.  * removed!
  380.  * removed!
  381.  * removed!
  382.  *
  383.  * removed!
  384.  * removed!
  385.  * removed!
  386.  *
  387.  * removed!
  388.  * removed!
  389.  * removed!
  390.  *
  391.  * removed!
  392.  * removed!
  393.  * removed!
  394.  *
  395.  * removed!
  396.  * removed!
  397.  * removed!
  398.  *
  399.  * removed!
  400.  * removed!
  401.  * removed!
  402.  *
  403.  * removed!
  404.  * removed!
  405.  * removed!
  406.  *
  407.  * removed!
  408.  * removed!
  409.  * removed!
  410.  *
  411.  * removed!
  412.  * removed!
  413.  * removed!
  414.  *
  415.  * removed!
  416.  * removed!
  417.  * removed!
  418.  *
  419.  *------------------------------------------------------------------------------
  420.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  421.  *============================================================================
  422.  ****************************************************************************/
  423. #include "MMI_features.h"
  424. #include "stdC.h"
  425. #include "L4Dr1.h"
  426. #include "PixtelDataTypes.h"
  427. #include "GlobalDefs.h"
  428. #include "gui_data_types.h"
  429. #include "CustDataProts.h"
  430. #include "CustMenuRes.h"
  431. #include "EventsDef.h"
  432. #include "gui_themes.h"
  433. #include "wgui.h"
  434. #include "CustThemesRes.h"
  435. #include "wgui_inputs.h"
  436. #include "wgui_categories.h"
  437. #include "wgui_softkeys.h"
  438. #include "wgui_status_icons.h"
  439. #include "wgui_categories_MM.h"
  440. #include "wgui_categories_idlescreen.h"
  441. #include "wgui_categories_multimedia.h"
  442. #include "IdleAppProt.h"
  443. #include "IdleAppDef.h"
  444. #include "SettingDefs.h"
  445. #include "PhoneSetup.h"
  446. #ifdef __MMI_AUDIO_PLAYER__
  447. /* dependent headers for AudioPlayerXXX.h" */
  448. #include "gui_data_types.h"
  449. #include "FrameworkStruct.h"
  450. #include "GlobalConstants.h"
  451. #include "mdi_datatype.h"
  452. #include "kal_release.h"
  453. #include "Conversions.h"
  454. #include "FileMgr.h"
  455. #include "CommonScreens.h"
  456. #include "AudioPlayerDef.h"
  457. #include "AudioPlayerType.h"
  458. #endif /* __MMI_AUDIO_PLAYER__ */ 
  459. /* Robin 1208 for Debug */
  460. #include "DebugInitDef.h"
  461. #include "lcd_sw_rnd.h"         /* required for macro BLACK_BACKLIGHT, WHITE_BACKLIGHT, BLUE_BACKLIGHT macro */
  462. #include "gdi_include.h"        /* include for graphic lib */
  463. #include "SATGProts.h"
  464. #include "wgui_draw_manager.h"
  465. #ifdef __MMI_TOUCH_SCREEN__
  466. #include "QuickAccessMenuItemProt.h"
  467. #include "wgui_touch_screen.h"
  468. #endif /* __MMI_TOUCH_SCREEN__ */ 
  469. /* PMT HIMANSHU FLIGHT MODE START 20050926 */
  470. #include "SimDetectionGprot.h"
  471. /* PMT HIMANSHU FLIGHT MODE END 2005926 */
  472. #include "fs_type.h"
  473. #include "fs_func.h"
  474. #include "ScrMemMgrGprot.h"
  475. #ifdef __MMI_RESOURCE_ENFB_SUPPORT__ 
  476. #include "ResMemMgrGprot.h"//120406 warning remove
  477. #endif
  478. #ifdef __DRM_SUPPORT__
  479. #include "Drm_gprot.h"//102406 DRM check
  480. #endif 
  481. scrolling_text scroll_sat_idleText;
  482. #define NORMAL_IDLE_SCREEN                   0
  483. #define ANALOG_IDLE_SCREEN                   1
  484. #define DIGITAL_IDLE_SCREEN                     2
  485. #define NORMAL_SCREEN_SAVER                     0
  486. #define ANALOG_SCREEN_SAVER                     1
  487. #define DIGITAL_SCREEN_SAVER                 2
  488. #define  VIEW_WALLPAPER_CLOCK                1
  489. #define  VIEW_SCREENSAVER_CLOCK                 2
  490. #define PREVIEW_CLOCK                        3
  491. #ifdef __MMI_ANALOG_CLOCK__
  492. void show_analog_clock(void);
  493. void analog_clock_initialize(void);
  494. #endif /* __MMI_ANALOG_CLOCK__ */ 
  495. /***************************************************************************/
  496. #ifdef __MMI_FM_RADIO__
  497. BOOL mmi_fmrdo_is_power_on(void);
  498. UI_string_type mmi_fmrdo_get_channel_name_or_freq(void);
  499. scrolling_text scroll_fmrdo_idleText;
  500. #endif /* __MMI_FM_RADIO__ */ 
  501. #ifdef __MMI_AUDIO_PLAYER__
  502. extern audply_struct g_audply;
  503. scrolling_text scroll_audply_idleText;
  504. UI_character_type idle_title[FMGR_MAX_FILE_LEN + 1];
  505. #endif /* __MMI_AUDIO_PLAYER__ */ 
  506. #include "lcd_if.h"
  507. gdi_handle wgui_layer_1 = GDI_LAYER_EMPTY_HANDLE;
  508. gdi_handle wgui_base_layer = GDI_LAYER_EMPTY_HANDLE;
  509. /* store Main lcd width */
  510. extern S32 MAIN_LCD_device_width;
  511. /* store Main LCD height */
  512. extern S32 MAIN_LCD_device_height;
  513. /* MTK Elvis for R2L characters */
  514. extern BOOL r2lMMIFlag;
  515. /* MTK end */
  516. U8 idle_screen_type = NORMAL_IDLE_SCREEN;
  517. static U8 display_network_name = TRUE;
  518. /* 122105 wallpaper Calvin */
  519. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  520. static U8 gIsWallpaperChange = 0;
  521. #endif 
  522. #ifdef __MMI_IDLE_FULL_SCREEN__
  523. extern U16 on_idle_screen;
  524. #endif 
  525. static S32 gis_on_idlescreen = 0;
  526. #if defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__)
  527. extern GDI_HANDLE animation_handle;
  528. #endif 
  529. /*****************************************************************************
  530.  * FUNCTION
  531.  *  is_on_idlescreen
  532.  * DESCRIPTION
  533.  *  
  534.  * PARAMETERS
  535.  *  void
  536.  * RETURNS
  537.  *  
  538.  *****************************************************************************/
  539. S32 is_on_idlescreen(void)
  540. {
  541.     /*----------------------------------------------------------------*/
  542.     /* Local Variables                                                */
  543.     /*----------------------------------------------------------------*/
  544.     /*----------------------------------------------------------------*/
  545.     /* Code Body                                                      */
  546.     /*----------------------------------------------------------------*/
  547.     return gis_on_idlescreen;
  548. }
  549. /*****************************************************************************
  550.  * FUNCTION
  551.  *  set_on_idlescreen
  552.  * DESCRIPTION
  553.  *  
  554.  * PARAMETERS
  555.  *  temp_on_idlescreen      [IN]        
  556.  * RETURNS
  557.  *  void
  558.  *****************************************************************************/
  559. void set_on_idlescreen(S32 temp_on_idlescreen)
  560. {
  561.     /*----------------------------------------------------------------*/
  562.     /* Local Variables                                                */
  563.     /*----------------------------------------------------------------*/
  564.     /*----------------------------------------------------------------*/
  565.     /* Code Body                                                      */
  566.     /*----------------------------------------------------------------*/
  567.     gis_on_idlescreen = temp_on_idlescreen;
  568. }
  569. /* color wgui_transparent_color={0,0,255,100};//112205 transparent color Calvin */
  570. extern S16 status_icon;
  571. /* Idle screen related wrappers  */
  572. /* store the adress of string which stores idle screen netwrok name */
  573. UI_string_type idle_screen_network_name = NULL;
  574. /* store teh address of string which store the netwrok name */
  575. UI_string_type idle_screen_network_status = NULL;
  576. /* store the image id of wallpaper */
  577. extern MMI_ID_TYPE idle_screen_wallpaper_ID;
  578. /* store the image name of wallpaper */
  579. extern S8 *idle_screen_wallpaper_name;
  580. extern S8 *idle_screen_wallpaper_name_original;
  581. extern S8 *idle_screen_screensaver_name;
  582. extern S8 *idle_screen_cache_name;
  583. extern MMI_ID_TYPE idle_screen_cache_id;
  584. /* PMT HIMANSHU START 20050721 */
  585. #if (defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__) && defined(__MMI_MAINLCD_240X320__))
  586. stFontAttribute idle_screen_network_name_font = {1, 0, 0, LARGE_FONT, 0, 0};
  587. #else 
  588. stFontAttribute idle_screen_network_name_font = {0, 0, 0, MEDIUM_FONT, 0, 0};
  589. #endif 
  590. /* PMT HIMANSHU END 20050721 */
  591. stFontAttribute idle_screen_network_status_font = {0, 0, 0, MEDIUM_FONT, 0, 0};
  592. /* MTK Leo end */
  593. /* store the x position of wallpaer of idle screen */
  594. S32 cat33_image_x;
  595. /* store the y position of wallpaer of idle screen */
  596. S32 cat33_image_y;
  597. /* store the image width  of wallpaer of idle screen */
  598. S32 cat33_image_width;
  599. /* store the image height  of wallpaer of idle screen */
  600. S32 cat33_image_height;
  601. /* store the total number frames  of animation wallpaper */
  602. S32 cat33_n_frames = 0;
  603. /* store the current frame number of animation wallppaer */
  604. S32 cat33_frame_number = 0;
  605. /* store the delay time to show next frame of animation wallpapaer */
  606. S32 cat33_animation_delay = 1000;
  607. /* store the image id ofcategory86 used foe analog clock */
  608. PU8 cat86_image;
  609. /* store x position of image,y position of image ,image widh ,image height */
  610. S32 cat86_image_x,cat86_image_y;//,cat86_image_width,cat86_image_height;//062106 cat128
  611. #ifdef __MMI_LCD_PARTIAL_ON__
  612. static UI_time cat161_time;
  613. static S32 cat161_last_y_offset;
  614. #endif /* __MMI_LCD_PARTIAL_ON__ */ 
  615. /* MTK Leo add 20040423, add new interface to show screensaver */
  616. /* store the type of screen saver like normal or analog/digital screen saver */
  617. U8 screen_saver_type = NORMAL_SCREEN_SAVER;
  618. U8 *ScreenSaverName;
  619. U8 disp_network_screeen_saver = 0;
  620. extern S32 PhnsetScreenSaverBadFileCallBack(void);
  621. extern void PhnsetWallpaperBadFileCallBack(U16 imgID);
  622. extern void dm_set_scr_bg_image_no_draw(U16 image_id, S8 *file_name, S32 x, S32 y, U8 opacity);        /* 092005 grayscale Calvin */
  623. S32 cat128_image_x, cat128_image_y;//, cat128_image_width, cat128_image_height;
  624. PU8 cat128_image;
  625. scrolling_text *extra_scrolling_text = NULL;
  626. S16 extra_text_x1 = -1;
  627. S16 extra_text_y1 = -1;
  628. S16 extra_text_x2 = -1;
  629. S16 extra_text_y2 = -1;
  630. /* 071205 Calvin Start */
  631. #if defined (__MMI_WALLPAPER_ON_BOTTOM__)
  632. static MMI_ID_TYPE idle_scr_bg_ID;
  633. static S8 *idle_scr_bg_filename;
  634. static S32 idle_scr_bg_x, idle_scr_bg_y;
  635. static U8 idle_scr_bg_opacity;  /* 070505 Calvin added */
  636. #endif /* defined (__MMI_WALLPAPER_ON_BOTTOM__) */ 
  637. /* 071205 Calvin End */
  638. /* PMT HIMANSHU START 20050809 */
  639. extern U16 title_bg_id;
  640. /* PMT HIMANSHU END 20050809 */
  641. /* 090605 Idlescreen Calvin Start */
  642. #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  643. extern MMI_BOOL PhnsetGetShowDateTimeStatus(void);
  644. MMI_ID_TYPE idlescreen_bar_id = IMG_TECHNO_IDLESCREEN_BAR;     //Old:IMG_TECHNO_ANALOG_CLOCK;//070306 Alpha layer        //KP Jerry modify for separate display IMG_TECHNO_IDLESCREEN_BAR and IMG_TECHNO_ANALOG_CLOCK/IMG_TECHNO_DIGITAL_CLOCK  on 2007-3-9
  645. #endif 
  646. /* 090605 Idlescreen Calvin End */
  647. /* PMT HIMANSHU START 20050625 */
  648. #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  649. /* PMT HIMANSHU START 20050721 */
  650. #ifdef __MMI_MAINLCD_240X320__
  651. #define IDLESCREEN_TEXT_GAP 10
  652. #else 
  653. #define IDLESCREEN_TEXT_GAP 5
  654. #endif 
  655. /* PMT HIMANSHU END 20050721 */
  656. #define X_INSERT 20     /* Gap from left and right end for audio. */
  657. #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */ 
  658. //PMT HIMANSHU END
  659. //PMT VIKAS START 20050707 
  660. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  661. extern is_status_bar_shuffled;
  662. #endif 
  663. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  664. extern is_button_bar_shuffled;
  665. #endif 
  666. #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
  667. #define X_INSERT 10     /* Gap from left and right end for audio. */
  668. #endif 
  669. /* PMT VIKAS END 20050707 */
  670. extern icontext_button MMI_softkeys[];
  671. extern void cat129_clear_icon_bg(void *button);
  672. fixed_icontext_menuitem    idle_list_menu_common_item;
  673. fixed_icontext_menuitem_type   idle_list_menu_item_list [6];
  674. void *            idle_list_menu_item_pointers [6];
  675. fixed_list_menu            idle_list_menu;
  676. /**************************************************************************/
  677. /* micha1111, michaSATc3, #212 */
  678. /*****************************************************************************
  679.  * FUNCTION
  680.  *  satIdleTextScrollTimer
  681.  * DESCRIPTION
  682.  *  handle scrolling text of SAT scrrem
  683.  * PARAMETERS
  684.  *  void
  685.  * RETURNS
  686.  *  void
  687.  *****************************************************************************/
  688. void satIdleTextScrollTimer(void)
  689. {
  690.     /*----------------------------------------------------------------*/
  691.     /* Local Variables                                                */
  692.     /*----------------------------------------------------------------*/
  693.     /*----------------------------------------------------------------*/
  694.     /* Code Body                                                      */
  695.     /*----------------------------------------------------------------*/
  696.     gui_handle_scrolling_text(&scroll_sat_idleText);
  697. }
  698. /*****************************************************************************
  699.  * FUNCTION
  700.  *  audply_idle_text_scroll_timer
  701.  * DESCRIPTION
  702.  *  
  703.  * PARAMETERS
  704.  *  void
  705.  * RETURNS
  706.  *  void
  707.  *****************************************************************************/
  708. void audply_idle_text_scroll_timer(void)
  709. {
  710.     /*----------------------------------------------------------------*/
  711.     /* Local Variables                                                */
  712.     /*----------------------------------------------------------------*/
  713.     /*----------------------------------------------------------------*/
  714.     /* Code Body                                                      */
  715.     /*----------------------------------------------------------------*/
  716. #ifdef __MMI_AUDIO_PLAYER__
  717.     gui_handle_scrolling_text(&scroll_audply_idleText);
  718. #endif 
  719. }
  720. /*****************************************************************************
  721.  * FUNCTION
  722.  *  fmrdo_idle_text_scroll_timer
  723.  * DESCRIPTION
  724.  *  
  725.  * PARAMETERS
  726.  *  void
  727.  * RETURNS
  728.  *  void
  729.  *****************************************************************************/
  730. void fmrdo_idle_text_scroll_timer(void)
  731. {
  732.     /*----------------------------------------------------------------*/
  733.     /* Local Variables                                                */
  734.     /*----------------------------------------------------------------*/
  735.     /*----------------------------------------------------------------*/
  736.     /* Code Body                                                      */
  737.     /*----------------------------------------------------------------*/
  738. #ifdef __MMI_FM_RADIO__
  739.     gui_handle_scrolling_text(&scroll_fmrdo_idleText);
  740. #endif 
  741. }
  742. /* 092005 draw_wallpaper Calvin Start */
  743. /*****************************************************************************
  744.  * FUNCTION
  745.  *  wgui_hide_background_with_wallpaper
  746.  * DESCRIPTION
  747.  *  redrwa the background by using the wallpaper
  748.  * PARAMETERS
  749.  *  x1      [IN]        Start x position
  750.  *  y1      [IN]        Start y poistion
  751.  *  x2      [IN]        End x position
  752.  *  y2      [IN]        End y postion
  753.  * RETURNS
  754.  *  void
  755.  *****************************************************************************/
  756. void wgui_hide_background_with_wallpaper(S32 x1, S32 y1, S32 x2, S32 y2)
  757. {
  758.     /*----------------------------------------------------------------*/
  759.     /* Local Variables                                                */
  760.     /*----------------------------------------------------------------*/
  761. #ifndef __GDI_MEMORY_PROFILE_2__
  762.     PU8 idle_screen_wallpaper;
  763. #endif 
  764.     /*----------------------------------------------------------------*/
  765.     /* Code Body                                                      */
  766.     /*----------------------------------------------------------------*/
  767. #ifdef __GDI_MEMORY_PROFILE_2__
  768.     /* gui_fill_rectangle(x1,y1,x2,y2,wgui_transparent_color); */
  769.     gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT); /* 112205 transparent color Calvin */
  770. #else /* __GDI_MEMORY_PROFILE_2__ */ 
  771.     gui_draw_filled_area(0, 0, UI_device_width - 1, UI_device_height - 1, current_MMI_theme->general_background_filler);        /* 012705 Calvin added */
  772.     if (idle_screen_wallpaper_ID == 0)
  773.     {
  774.         S32 disp_height = UI_device_height, disp_width = UI_device_width;
  775.     #ifndef __MMI_IDLE_FULL_SCREEN__
  776.         disp_height = UI_device_height - MMI_status_bar_height - MMI_button_bar_height;
  777.         disp_width = UI_device_width - 1;
  778.     #endif /* __MMI_IDLE_FULL_SCREEN__ */ 
  779.         if ((disp_width >= cat33_image_width) && (disp_height >= cat33_image_height))   /* image can be displayed entirely */
  780.         {
  781.             S32 offset_x = 0;
  782.             S32 offset_y = 0;
  783.             /* align preview window at the center of screen */
  784.             offset_x = (disp_width - cat33_image_width) >> 1;
  785.             offset_y = (disp_height - cat33_image_height) >> 1;
  786.             gdi_image_draw_file(offset_x, offset_y, (PS8) idle_screen_wallpaper_name);
  787.         }
  788.         else    /* image is larger than screen size */
  789.         {
  790.             S32 resized_offset_x;
  791.             S32 resized_offset_y;
  792.             S32 resized_width;
  793.             S32 resized_height;
  794.             gdi_image_util_fit_bbox(
  795.                 disp_width,
  796.                 disp_height,
  797.                 cat33_image_width,
  798.                 cat33_image_height,
  799.                 &resized_offset_x,
  800.                 &resized_offset_y,
  801.                 &resized_width,
  802.                 &resized_height);
  803.             gdi_image_draw_resized_file(
  804.                 resized_offset_x,
  805.                 resized_offset_y,
  806.                 resized_width,
  807.                 resized_height,
  808.                 (PS8) idle_screen_wallpaper_name);
  809.         }
  810.     }
  811.     else
  812.     {
  813.         idle_screen_wallpaper = get_image(idle_screen_wallpaper_ID);
  814.         if (cat33_n_frames > 1)
  815.         {
  816.             gui_show_animated_image_frame(
  817.                 cat33_image_x,
  818.                 cat33_image_y,
  819.                 idle_screen_wallpaper,
  820.                 (S16) cat33_frame_number);
  821.         }
  822.         else
  823.         {
  824.             gui_show_image(cat33_image_x, cat33_image_y, idle_screen_wallpaper);
  825.         }
  826.     }
  827. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  828. }
  829. /* 092005 draw_wallpaper Calvin End */
  830. /*****************************************************************************
  831.  * FUNCTION
  832.  *  idle_screen_sat_display_text_background_redraw
  833.  * DESCRIPTION
  834.  *  redrwa the background ofSAT scrolling text area
  835.  * PARAMETERS
  836.  *  x1      [IN]        Start x position
  837.  *  y1      [IN]        Start y poistion
  838.  *  x2      [IN]        End x position
  839.  *  y2      [IN]        End y postion
  840.  * RETURNS
  841.  *  void
  842.  *****************************************************************************/
  843. /* 092005 draw_wallpaper Calvin Start */
  844. #if 0
  845. /* under construction !*/
  846. /* under construction !*/
  847. /* under construction !*/
  848. /* under construction !*/
  849. /* under construction !*/
  850. #ifdef __GDI_MEMORY_PROFILE_2__
  851. /* under construction !*/
  852. #else
  853. /* under construction !*/
  854. /* under construction !*/
  855. /* under construction !*/
  856. /* under construction !*/
  857. /* under construction !*/
  858. /* under construction !*/
  859. /* under construction !*/
  860. /* under construction !*/
  861. /* under construction !*/
  862. #endif
  863. /* under construction !*/
  864. /* under construction !*/
  865. #else /* 0 */ 
  866. void idle_screen_sat_display_text_background_redraw(S32 x1, S32 y1, S32 x2, S32 y2)
  867. {
  868.     /*----------------------------------------------------------------*/
  869.     /* Local Variables                                                */
  870.     /*----------------------------------------------------------------*/
  871.     /*----------------------------------------------------------------*/
  872.     /* Code Body                                                      */
  873.     /*----------------------------------------------------------------*/
  874.     gui_push_clip();
  875.     gui_set_clip(x1, y1, x2, y2);
  876.     wgui_hide_background_with_wallpaper(x1, y1, x2, y2);
  877.     gui_pop_clip();
  878. }
  879. #endif /* 0 */ 
  880. /* 092005 draw_wallpaper Calvin End */
  881. #ifdef __MMI_AUDIO_PLAYER__
  882. extern BOOL mmi_audply_is_playing(void);
  883. #endif 
  884. /*****************************************************************************
  885.  * FUNCTION
  886.  *  idle_screen_show_network_details
  887.  * DESCRIPTION
  888.  *  show network name and network status on idle screen
  889.  * PARAMETERS
  890.  *  void
  891.  * RETURNS
  892.  *  void
  893.  *****************************************************************************/
  894. void idle_screen_show_network_details(void)
  895. {
  896.     /*----------------------------------------------------------------*/
  897.     /* Local Variables                                                */
  898.     /*----------------------------------------------------------------*/
  899.     color c;
  900.     S32 width, x, y = 0, h = 0, h2 = 0;
  901.     BOOL show_extra = FALSE;
  902.     UI_string_type extra_text = NULL;
  903.     /*----------------------------------------------------------------*/
  904.     /* Code Body                                                      */
  905.     /*----------------------------------------------------------------*/
  906.     void (*extra_scrolling_text_timer) (void) = NULL;
  907. #if !defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__) || !defined(__MMI_UI_DALMATIAN_IDLESCREEN__)
  908.     S32 w_inset = MMI_status_icon_bars[1].x2 - MMI_status_icon_bars[1].x1 + 1;
  909. #else 
  910.     S32 w_inset = X_INSERT;
  911. #endif 
  912. #ifdef __GDI_MEMORY_PROFILE_2__
  913.     gdi_layer_push_clip();
  914.     gdi_layer_set_clip(0, 0, UI_device_width, UI_device_height);
  915.     if (extra_text_x1 >= 0)
  916.     {
  917.         gdi_draw_solid_rect(extra_text_x1, extra_text_y1-1, extra_text_x2, extra_text_y2+2, GDI_COLOR_TRANSPARENT);
  918.     }
  919. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  920.     if (idle_screen_network_name != NULL)
  921.     {
  922.         /* set font according to string width */
  923.     #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  924.         gdi_layer_push_clip();
  925.         gdi_layer_set_clip(
  926.             MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].width,
  927.             0,
  928.             UI_device_width - (MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].width) - 1,
  929.             MMI_title_height);
  930.         if (gui_get_string_width(idle_screen_network_name) >
  931.             UI_device_width - MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].width -
  932.             MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].width - 1)
  933.         {
  934.             gui_set_font(&MMI_small_font);
  935.         }
  936.         else
  937.         {
  938.             gui_set_font(&MMI_medium_font);
  939.         }
  940.     #else /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  941.         gui_set_font(&idle_screen_network_name_font);
  942.     #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  943.         /*
  944.          * #if defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__)
  945.          * c = gui_color(255,255,255);
  946.          * #elif defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__)
  947.          * gui_set_font(&idle_screen_network_name_font);
  948.          * c=gui_color(255,255,255);
  949.          * #else
  950.          * gui_set_font(&idle_screen_network_name_font);
  951.          * c=gui_color(0,255,255);
  952.          * #endif
  953.          */
  954.         /*c = gui_color(255, 255, 255);*/
  955.  c = *current_MMI_theme->idle_scr_network_name_color;
  956.         gui_set_text_color(c);
  957.     //#if defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_IDLESCREEN__)
  958.     //  c = *current_MMI_theme->title_text_color;
  959.     //#elif defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__) && defined(__MMI_MAINLCD_240X320__)
  960.     //  c = gui_color(18, 114, 175);
  961.     //#else 
  962.         /*c = gui_color(0, 0, 0);*/
  963.         c = *current_MMI_theme->idle_scr_network_name_border_color;
  964.     //#endif 
  965.         gui_set_text_border_color(c);
  966.         gui_measure_string(idle_screen_network_name, &width, &h);
  967.         if (!r2lMMIFlag)
  968.         {
  969.             x = (UI_device_width >> 1) - (width >> 1);
  970.         }
  971.         else
  972.         {
  973.             x = (UI_device_width >> 1) - (width >> 1) + width;
  974.         }
  975.     #if defined(__MMI_UI_DALMATIAN_STATUSBAR__)
  976.         if (UI_font->type == MMI_small_font.type)
  977.         {
  978.             y = (MMI_title_height >> 1) - (h >> 1); /* for center in Title bar */
  979.         }
  980.         else
  981.         {
  982.             y = MMI_title_height - (h + 1); /* add 1 to create gap bottom of text */
  983.         }
  984.     #elif defined (__MMI_UI_TECHNO_IDLESCREEN_BAR__)
  985.         y = (UI_device_height >> 1) + (UI_device_height >> 2) - IDLESCREEN_TEXT_GAP - h;
  986.     #else 
  987.     #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  988.         y = MMI_status_bar_height + 4;
  989.     #else 
  990.         y = MMI_status_bar_height + 2;
  991.     #endif 
  992.     #endif 
  993. //N95 network name position
  994.     #ifdef __N95__
  995. x-=8;
  996. y=15;
  997.     #endif
  998. //End N95 network name position
  999.         gui_move_text_cursor(x, y);
  1000.         gui_print_bordered_text(idle_screen_network_name);
  1001.     #if defined(__MMI_UI_DALMATIAN_STATUSBAR__)
  1002.         gdi_layer_pop_clip();
  1003.         gdi_layer_blt_previous(
  1004.             MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].width,
  1005.             0,
  1006.             UI_device_width - (MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].width) - 1,
  1007.             MMI_title_height);
  1008.     #endif /* defined(__MMI_UI_DALMATIAN_STATUSBAR__) */ 
  1009.     }   /* idle_screen_network_name!=NULL */
  1010.     if (idle_screen_network_status != NULL)
  1011.     {
  1012.         gui_set_font(&idle_screen_network_status_font);
  1013.     //#if defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__)
  1014.     //#ifdef __MMI_MAINLCD_240X320__
  1015.     //    c = gui_color(18, 114, 175);
  1016.     //#else 
  1017.     //    c = gui_color(255, 255, 255);
  1018.     //#endif 
  1019.     //#else /* defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__) */ 
  1020.     //#ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
  1021.     //    c = *current_MMI_theme->title_text_color;
  1022.     //#else 
  1023.         /*c = gui_color(0, 255, 255);*/
  1024.         c = *current_MMI_theme->idle_scr_network_status_color;
  1025.     //#endif 
  1026.     //#endif /* defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__) */ 
  1027.         gui_set_text_color(c);
  1028.     //#if defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__) && defined(__MMI_MAINLCD_240X320__)
  1029.     //    c = gui_color(255, 255, 255);
  1030.     //#else 
  1031.         /*c = gui_color(0, 0, 0);*/
  1032.  c = *current_MMI_theme->idle_scr_network_status_border_color;
  1033.     //#endif 
  1034.         gui_set_text_border_color(c);
  1035.         width = gui_get_string_width(idle_screen_network_status);
  1036.         if (!r2lMMIFlag)
  1037.         {
  1038.             x = (UI_device_width >> 1) - (width >> 1);
  1039.         }
  1040.         else
  1041.         {
  1042.             x = (UI_device_width >> 1) - (width >> 1) + width;
  1043.         }
  1044.     #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  1045.         gui_measure_string(idle_screen_network_status, &width, &h2);
  1046.         if (PhnsetGetShowDateTimeStatus() != MMI_FALSE)
  1047.         {
  1048.             y = UI_device_height - (MMI_button_bar_height + (main_LCD_dt_object.time.height) * 3 + (BAR_CONTENT_GAP));
  1049.         }
  1050.         else
  1051.         {
  1052.             y = UI_device_height - (MMI_button_bar_height + (h2 + BAR_CONTENT_GAP) + (BAR_CONTENT_GAP));
  1053.         }
  1054.     #elif defined (__MMI_UI_TECHNO_IDLESCREEN_BAR__)
  1055.         y = y + h + IDLESCREEN_TEXT_GAP;
  1056.     #else 
  1057.         y = MMI_status_bar_height + h + 7;
  1058.     #endif 
  1059.         gui_move_text_cursor(x, y);
  1060.         gui_print_bordered_text(idle_screen_network_status);
  1061.         gui_measure_string(idle_screen_network_status, &width, &h2);
  1062.         h2 += 5;
  1063.     }   /* idle_screen_network_status!=NULL */
  1064.     /* stop previous text scrolling */
  1065.     if (extra_scrolling_text)
  1066.     {
  1067.         gui_scrolling_text_stop(extra_scrolling_text);
  1068.         extra_scrolling_text = NULL;
  1069.     }
  1070.     if (GetSATIdleText() != NULL)
  1071.     {
  1072.         show_extra = TRUE;
  1073.         extra_text = (UI_string_type) GetSATIdleText();
  1074.         extra_scrolling_text = &scroll_sat_idleText;
  1075.         extra_scrolling_text_timer = satIdleTextScrollTimer;
  1076.     }
  1077.     if (mmi_idle_is_allow_to_display_song_name() == MMI_TRUE)
  1078.     {
  1079. #ifdef __MMI_AUDIO_PLAYER__
  1080.         if (mmi_audply_is_playing())
  1081.         {
  1082.             show_extra = TRUE;
  1083.             memcpy(idle_title,g_audply.title,(FMGR_MAX_FILE_LEN + 1)*sizeof(UI_character_type));
  1084.             extra_text = (UI_string_type) idle_title;
  1085.             extra_scrolling_text = &scroll_audply_idleText;
  1086.             extra_scrolling_text_timer = audply_idle_text_scroll_timer;
  1087.         }
  1088. #endif /* __MMI_AUDIO_PLAYER__ */ 
  1089. #ifdef __MMI_FM_RADIO__
  1090.         if (mmi_fmrdo_is_power_on())
  1091.         {
  1092.             show_extra = TRUE;
  1093.             extra_text = (UI_string_type) mmi_fmrdo_get_channel_name_or_freq();
  1094.             extra_scrolling_text = &scroll_fmrdo_idleText;
  1095.             extra_scrolling_text_timer = fmrdo_idle_text_scroll_timer;
  1096.         }
  1097. #endif /* __MMI_FM_RADIO__ */ 
  1098.     }
  1099.     if (idle_screen_type == ANALOG_IDLE_SCREEN || idle_screen_type == DIGITAL_IDLE_SCREEN)
  1100.     {
  1101.         show_extra = FALSE;
  1102.     }
  1103.     if (show_extra && extra_scrolling_text != NULL)
  1104.     {
  1105.         color text_color, border_color;
  1106.     #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  1107.         y = (UI_device_height >> 1) - (h >> 1);
  1108.         gui_set_font(&MMI_medium_font);
  1109.     #elif defined(__MMI_UI_DALMATIAN_IDLESCREEN__)
  1110.         gui_set_font(&idle_screen_network_name_font);
  1111.         gui_measure_string(extra_text, &width, &h);
  1112.         if (PhnsetGetShowDateTimeStatus() != MMI_FALSE)
  1113.             if (idle_screen_network_status != NULL)
  1114.             {
  1115.                 y = UI_device_height - (MMI_button_bar_height + (main_LCD_dt_object.time.height) * 4 +
  1116.                                         (BAR_CONTENT_GAP));
  1117.             }
  1118.             else
  1119.             {
  1120.                 y = UI_device_height - (MMI_button_bar_height + (main_LCD_dt_object.time.height) * 3 +
  1121.                                         (BAR_CONTENT_GAP));
  1122.             }
  1123.         else if ((PhnsetGetShowDateTimeStatus() == MMI_FALSE) || (idle_screen_network_status != NULL))
  1124.         {
  1125.             y = UI_device_height - (MMI_button_bar_height + (h2 + BAR_CONTENT_GAP) * 2 + (BAR_CONTENT_GAP));
  1126.         }
  1127.         else
  1128.         {
  1129.             y = UI_device_height - (MMI_button_bar_height + (h + BAR_CONTENT_GAP) + (BAR_CONTENT_GAP));
  1130.         }
  1131.     #else 
  1132.         y = MMI_status_bar_height + h + 7 + h2;
  1133.         gui_set_font(&idle_screen_network_name_font);
  1134.     #endif 
  1135.     #ifndef __MMI_UI_DALMATIAN_IDLESCREEN__
  1136.         gui_set_font(&idle_screen_network_name_font);
  1137.         gui_measure_string(extra_text, &width, &h);
  1138.     #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */ 
  1139.         extra_text_x1 = (S16) w_inset;
  1140.         extra_text_y1 = (S16) y;
  1141.         extra_text_x2 = (S16) (UI_device_width - w_inset - 1);
  1142.         extra_text_y2 = (S16) (y + h);
  1143.     //#if defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__)
  1144.     //#ifdef __MMI_MAINLCD_240X320__
  1145.     //    text_color = gui_color(18, 114, 175);
  1146.     //#else 
  1147.     //   text_color = (current_MMI_theme->formatted_inputbox_normal_filler->shadow_color);
  1148.     //#endif 
  1149.     //#elif defined(__MMI_UI_DALMATIAN_IDLESCREEN__)
  1150.     //    text_color = *current_MMI_theme->title_text_color;
  1151.     //#else 
  1152.         /*text_color = gui_color(255, 255, 0);*/
  1153.  text_color = *current_MMI_theme->idle_scr_network_extra_color;
  1154. //#endif 
  1155.         gui_set_text_color(text_color);
  1156.     //#if defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__)
  1157.     //    border_color = gui_color(255, 255, 255);
  1158.     //#elif defined( __MMI_UI_DALMATIAN_IDLESCREEN__)
  1159.     //    border_color = gui_color(255, 255, 255);
  1160.     //#else 
  1161.         /*border_color = gui_color(0, 0, 0);*/
  1162.  border_color = *current_MMI_theme->idle_scr_network_extra_border_color;
  1163. //#endif
  1164.         gui_set_text_border_color(border_color);
  1165.         if (r2lMMIFlag)
  1166.         {
  1167.             gui_move_text_cursor(extra_text_x1 + gui_get_character_width((UI_character_type) '['), extra_text_y1);
  1168.         }
  1169.         else
  1170.         {
  1171.             gui_move_text_cursor(extra_text_x1, extra_text_y1);
  1172.         }
  1173.         gui_print_bordered_text(L"[");
  1174.         if (r2lMMIFlag)
  1175.         {
  1176.             gui_move_text_cursor(extra_text_x2 - 5 + gui_get_character_width((UI_character_type) ']'), extra_text_y1);
  1177.         }
  1178.         else
  1179.         {
  1180.             gui_move_text_cursor(extra_text_x2 - 5, extra_text_y1);
  1181.         }
  1182.         gui_print_bordered_text(L"]");
  1183.         if (width <= (UI_device_width - ((w_inset + 5) * 2)))
  1184.         {
  1185.             width = gui_get_string_width(extra_text);
  1186.             if (!r2lMMIFlag)
  1187.             {
  1188.                 x = (UI_device_width >> 1) - (width >> 1);
  1189.             }
  1190.             else
  1191.             {
  1192.                 x = (UI_device_width >> 1) + (width >> 1);
  1193.             }
  1194.             gui_move_text_cursor(x, y);
  1195.             gui_print_bordered_text(extra_text);
  1196.         }
  1197.         else
  1198.         {
  1199.             x = w_inset + 8;
  1200.             width = UI_device_width - (w_inset + 8) * 2;
  1201.         #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
  1202.             gui_create_scrolling_text(
  1203.                 extra_scrolling_text,
  1204.                 x,
  1205.                 y,
  1206.                 width,
  1207.                 h + 2,
  1208.                 extra_text,
  1209.                 extra_scrolling_text_timer,
  1210.                 idle_screen_sat_display_text_background_redraw,
  1211.                 text_color,
  1212.                 border_color);
  1213.         #else /* __MMI_UI_DALMATIAN_IDLESCREEN__ */ 
  1214.             gui_create_scrolling_text(
  1215.                 extra_scrolling_text,
  1216.                 x,
  1217.                 y,
  1218.                 width,
  1219.                 h + 2,
  1220.                 extra_text,
  1221.                 extra_scrolling_text_timer,
  1222.                 idle_screen_sat_display_text_background_redraw,
  1223.                 //KP Jerry modify on 2006-12-31 start
  1224.                 /*Old:
  1225.                 text_color,
  1226.                 border_color);
  1227.                 */
  1228.                 gui_color(18,114,175),
  1229.                 gui_color(255,255,255));
  1230.                 //KP Jerry modify on 2006-12-31 end
  1231.         #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */ 
  1232.             extra_scrolling_text->scroll_gap = 20;
  1233.             extra_scrolling_text->flags |= UI_SCROLLING_TEXT_BORDERED_TEXT;
  1234.             gui_show_scrolling_text(extra_scrolling_text);
  1235.         }
  1236.     }
  1237.     else    /* show_extra && extra_scrolling_text != NULL */
  1238.     {
  1239.         extra_text_x1 = -1; /* for indicate no draw extra_text this time, so no need to clean it next time */
  1240.     }
  1241. #ifdef __GDI_MEMORY_PROFILE_2__
  1242.     gdi_layer_pop_clip();
  1243.     gdi_layer_blt_previous(extra_text_x1, extra_text_y1-1, extra_text_x2, extra_text_y2+2);
  1244. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  1245.     if (GetSATIdleIcon())
  1246.     {
  1247.         y = MMI_status_bar_height + h + 7 + h2 + 20;
  1248.         gui_measure_image(GetSATIdleIcon(), &width, &h);
  1249.         x = (UI_device_width >> 1) - (width >> 1);
  1250.         gui_push_clip();
  1251.         gui_set_clip(x, y, x + width, y + h);
  1252.         gui_show_image(x, y, GetSATIdleIcon());
  1253.         gui_pop_clip();
  1254.     }
  1255. }
  1256. /*****************************************************************************
  1257.  * FUNCTION
  1258.  *  idle_screen_show_network_name
  1259.  * DESCRIPTION
  1260.  *  show network name  on idle screen
  1261.  * PARAMETERS
  1262.  *  void
  1263.  * RETURNS
  1264.  *  void
  1265.  *****************************************************************************/
  1266. void idle_screen_show_network_name(void)
  1267. {
  1268.     /*----------------------------------------------------------------*/
  1269.     /* Local Variables                                                */
  1270.     /*----------------------------------------------------------------*/
  1271.     color c;
  1272.     S32 width, x, y, h;
  1273.     /*----------------------------------------------------------------*/
  1274.     /* Code Body                                                      */
  1275.     /*----------------------------------------------------------------*/
  1276.     gui_reset_text_clip();
  1277.     if (idle_screen_network_name != NULL)
  1278.     {
  1279.     #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  1280.         gui_set_font(&idle_screen_network_name_font);
  1281.         //c = (current_MMI_theme->formatted_inputbox_normal_filler->shadow_color);
  1282.     #elif defined(__MMI_UI_DALMATIAN_IDLESCREEN__)
  1283.         gui_push_clip();
  1284.         gui_set_text_clip(
  1285.             MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].width,
  1286.             0,
  1287.             UI_device_width - (MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].width) - 1,
  1288.             MMI_title_height);
  1289.         if (gui_get_string_width(idle_screen_network_name) >
  1290.             UI_device_width - MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].width -
  1291.             MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].width - 1)
  1292.         {
  1293.             gui_set_font(&MMI_small_font);
  1294.         }
  1295.         else
  1296.         {
  1297.             gui_set_font(&MMI_medium_font);
  1298.         }
  1299.         //c = gui_color(255, 255, 255);   /* idle_scr_text_color; */
  1300.     #else 
  1301.         gui_set_font(&idle_screen_network_name_font);
  1302.         /*c = gui_color(0, 255, 255);*/
  1303.     #endif 
  1304.         /*c = gui_color(0, 255, 255);*/
  1305.  c = *current_MMI_theme->idle_scr_network_name_color;
  1306.         gui_set_text_color(c);
  1307.     //#if defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__)
  1308.     //    c = (current_UI_theme->window_title_theme->active_filler->c);
  1309.     //#elif defined(__MMI_UI_DALMATIAN_IDLESCREEN__)
  1310.     //    c = *current_MMI_theme->title_text_color;
  1311.     //#else 
  1312.         /*c = gui_color(0, 0, 0);*/
  1313.  c = *current_MMI_theme->idle_scr_network_name_border_color;
  1314.     //#endif 
  1315.         gui_set_text_border_color(c);
  1316.         gui_measure_string(idle_screen_network_name, &width, &h);
  1317.         if (r2lMMIFlag)
  1318.         {
  1319.             x = (UI_device_width >> 1) + (width >> 1);
  1320.         }
  1321.         else
  1322.         {
  1323.             x = (UI_device_width >> 1) - (width >> 1);
  1324.         }
  1325.     #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
  1326.         if (UI_font->type == MMI_small_font.type)
  1327.         {
  1328.             y = (MMI_title_height >> 1) - (h >> 1); /* for center in Title bar */
  1329.         }
  1330.         else
  1331.         {
  1332.             y = MMI_title_height - (h + 1);
  1333.         }
  1334.     #else /* __MMI_UI_DALMATIAN_IDLESCREEN__ */ 
  1335.     #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  1336.         y = MMI_status_bar_height + 4;
  1337.     #else 
  1338.         y = MMI_status_bar_height + 2;
  1339.     #endif 
  1340.     #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */ 
  1341.         gui_move_text_cursor(x, y);
  1342.         gui_print_bordered_text(idle_screen_network_name);
  1343.     #ifdef __MMI_UI_DALMATIAN_IDLESCREEN__
  1344.         gui_pop_clip();
  1345.         gui_BLT_double_buffer(
  1346.             MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].width,
  1347.             0,
  1348.             UI_device_width - (MMI_status_icons[STATUS_ICON_SIGNAL_STRENGTH].width) - 1,
  1349.             MMI_title_height);
  1350.         gui_reset_text_clip();
  1351.     #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */ 
  1352.     }   /* idle_screen_network_name!=NULL */
  1353. }
  1354. /*****************************************************************************
  1355.  * FUNCTION
  1356.  *  dummy_dt_hide_function
  1357.  * DESCRIPTION
  1358.  *  dummy func of hide date
  1359.  * PARAMETERS
  1360.  *  x1      [IN]        Start x position
  1361.  *  y1      [IN]        Start y position
  1362.  *  x2      [IN]        End x position
  1363.  *  y2      [IN]        End y position
  1364.  * RETURNS
  1365.  *  void
  1366.  *****************************************************************************/
  1367. void dummy_dt_hide_function(S32 x1, S32 y1, S32 x2, S32 y2)
  1368. {
  1369.     /*----------------------------------------------------------------*/
  1370.     /* Local Variables                                                */
  1371.     /*----------------------------------------------------------------*/
  1372.     /*----------------------------------------------------------------*/
  1373.     /* Code Body                                                      */
  1374.     /*----------------------------------------------------------------*/
  1375.     UI_UNUSED_PARAMETER(x1);
  1376.     UI_UNUSED_PARAMETER(y1);
  1377.     UI_UNUSED_PARAMETER(x2);
  1378.     UI_UNUSED_PARAMETER(y2);
  1379. }
  1380. extern void redraw_status_icon_bar(U8 j);
  1381. /*****************************************************************************
  1382.  * FUNCTION
  1383.  *  cat33_analog_clock_hide_dt_display
  1384.  * DESCRIPTION
  1385.  *  hide function of date display of analog clock
  1386.  * PARAMETERS
  1387.  *  x1      [IN]        Start x position
  1388.  *  y1      [IN]        Start y position
  1389.  *  x2      [IN]        End x position
  1390.  *  y2      [IN]        End y position
  1391.  * RETURNS
  1392.  *  void
  1393.  *****************************************************************************/
  1394. void cat33_analog_clock_hide_dt_display(S32 x1, S32 y1, S32 x2, S32 y2)
  1395. {
  1396.     /*----------------------------------------------------------------*/
  1397.     /* Local Variables                                                */
  1398.     /*----------------------------------------------------------------*/
  1399. #ifndef __GDI_MEMORY_PROFILE_2__
  1400.     PU8 idle_screen_wallpaper = get_image(idle_screen_wallpaper_ID);
  1401. #endif 
  1402.     /*----------------------------------------------------------------*/
  1403.     /* Code Body                                                      */
  1404.     /*----------------------------------------------------------------*/
  1405.     x1 = 0;
  1406.     /* PMT VIKAS START 20050707 */
  1407. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  1408.     y1 = MMI_status_bar_height + MMI_title_height;
  1409. #else /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  1410.     /* PMT VIKAS START 20051010 */
  1411. #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  1412.     /* for proper display of the status bar at analog clock */
  1413.     if (is_on_idlescreen())
  1414.     {
  1415.         y1 = 0;
  1416.     }
  1417.     else
  1418. #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */ 
  1419.         /* PMT VIKAS END 20051010 */
  1420.         y1 = MMI_status_bar_height;
  1421. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  1422.     /* PMT VIKAS END 20050707 */
  1423.     x2 = UI_device_width - 1;
  1424.     /* PMT VIKAS START 20051010 */
  1425. #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  1426.     /* for proper display of the status bar at analog clock */
  1427.     if (is_on_idlescreen())
  1428.     {
  1429.         y2 = (UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height - 4);
  1430.     }
  1431.     else
  1432. #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */ 
  1433.         /* PMT VIKAS END 20051010 */
  1434.         y2 = UI_device_height - MMI_button_bar_height;
  1435.     gui_set_clip(x1, y1, x2, y2);
  1436. #ifdef __GDI_MEMORY_PROFILE_2__
  1437.     /* gui_fill_rectangle(x1,y1,x2,y2,wgui_transparent_color); */
  1438.     gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT); /* 112205 transparent color Calvin */
  1439. #else /* __GDI_MEMORY_PROFILE_2__ */ 
  1440.     if (idle_screen_wallpaper_ID == 0)
  1441.     {
  1442.         ASSERT(idle_screen_wallpaper_ID == 0);  /* 092005 draw_wallpaper Calvin added //analog clock idle screen should predefined image */
  1443.         gdi_image_draw_file(cat33_image_x, cat33_image_y, idle_screen_wallpaper_name);
  1444.     }
  1445.     else
  1446.     {
  1447.         if (cat33_n_frames > 1)
  1448.         {
  1449.             gui_show_animated_image_frame(
  1450.                 cat33_image_x,
  1451.                 cat33_image_y,
  1452.                 idle_screen_wallpaper,
  1453.                 (S16) cat33_frame_number);
  1454.         }
  1455.         else
  1456.         {
  1457.             gui_show_image(cat33_image_x, cat33_image_y, idle_screen_wallpaper);
  1458.         }
  1459.     }
  1460. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  1461.     redraw_status_icon_bar(1);
  1462.     idle_screen_show_network_name();
  1463. }
  1464. /*****************************************************************************
  1465.  * FUNCTION
  1466.  *  cat33_digital_clock_hide_dt_display
  1467.  * DESCRIPTION
  1468.  *  hide function of date display of digital  clock
  1469.  * PARAMETERS
  1470.  *  x1      [IN]        Start x position
  1471.  *  y1      [IN]        Start y position
  1472.  *  x2      [IN]        End x position
  1473.  *  y2      [IN]        End y position
  1474.  * RETURNS
  1475.  *  void
  1476.  *****************************************************************************/
  1477. /* Assumes that the wallpaper displayed behind the digital clock is always full screen */
  1478. void draw_wallpaper(void);
  1479. void cat33_digital_clock_hide_dt_display(S32 x1, S32 y1, S32 x2, S32 y2)
  1480. {
  1481.     /*----------------------------------------------------------------*/
  1482.     /* Local Variables                                                */
  1483.     /*----------------------------------------------------------------*/
  1484.     /* 072605 Calvin added */
  1485. #ifndef __GDI_MEMORY_PROFILE_2__
  1486.     PU8 idle_screen_wallpaper = get_image(idle_screen_wallpaper_ID);
  1487. #endif 
  1488.     /*----------------------------------------------------------------*/
  1489.     /* Code Body                                                      */
  1490.     /*----------------------------------------------------------------*/
  1491.     /* 072605 Calvin end */
  1492.     /* PMT VIKAS START 20050707 */
  1493. #ifndef __MMI_UI_DALMATIAN_IDLESCREEN__
  1494.     /* To retain passing coordinates to the clip window */
  1495.     x1 = 0;
  1496.     x2 = UI_device_width - 1;
  1497.     /* PMT VIKAS START 20051010 */
  1498. #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  1499.     /* for proper display of the status bar at digital clock */
  1500.     if (is_on_idlescreen())
  1501.     {
  1502.         y1 = 0;
  1503.     }
  1504.     else
  1505. #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */ 
  1506.         /* PMT VIKAS END 20051010 */
  1507.         y1 = MMI_status_bar_height;
  1508.     /* PMT VIKAS START 20051010 */
  1509. #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  1510.     /* for proper display of the status bar at digital clock */
  1511.     if (is_on_idlescreen())
  1512.     {
  1513.         y2 = (UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height - 4);
  1514.     }
  1515.     else
  1516. #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */ 
  1517.         //PMT VIKAS END 20051010
  1518.         //PMT HIMANSHU START 20050809
  1519.         /* change for idlescreen shortcuts as their height is greater
  1520.            than MMI_button_bar_height */
  1521. #if defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)
  1522.         y2 = UI_device_height - max_touch_idle_screen_shortcut_height() - 1;
  1523. #else 
  1524.         y2 = UI_device_height - MMI_button_bar_height;
  1525. #endif 
  1526.     /* PMT HIMANSHU END 20050809 */
  1527. #endif /* __MMI_UI_DALMATIAN_IDLESCREEN__ */ 
  1528.     /* PMT VIKAS END 20050707 */
  1529.     gui_push_clip();
  1530.     gui_set_clip(x1, y1, x2, y2);
  1531.     /* 072605 Calvin modified */
  1532. #ifdef __GDI_MEMORY_PROFILE_2__
  1533.     /* gui_fill_rectangle(x1,y1,x2,y2,wgui_transparent_color); */
  1534.     gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT); /* 112205 transparent color Calvin */
  1535. #else /* __GDI_MEMORY_PROFILE_2__ */ 
  1536. #if 0
  1537. /* under construction !*/
  1538. /* under construction !*/
  1539. /* under construction !*/
  1540. /* under construction !*/
  1541. /* under construction !*/
  1542. /* under construction !*/
  1543. /* under construction !*/
  1544. #endif /* 0 */ 
  1545.     draw_wallpaper();
  1546. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  1547.     /* draw_wallpaper(); */
  1548.     /* 072605 Calvin end */
  1549.     redraw_status_icon_bar(1);
  1550.     gui_pop_clip();
  1551.     /* 101904 MTK Calvin changed to sync with every other digital idle screen */
  1552.     /* idle_screen_show_network_details(); */
  1553.     if (idle_screen_type == ANALOG_IDLE_SCREEN || idle_screen_type == DIGITAL_IDLE_SCREEN)
  1554.     {
  1555.         idle_screen_show_network_name();
  1556.     }
  1557.     else
  1558.     {
  1559.         idle_screen_show_network_details();
  1560.     }
  1561.     /* MTK Calvin end */
  1562. }
  1563. /* PMT HIMANSHU START 20050625 */
  1564. #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  1565. /*****************************************************************************
  1566.  * FUNCTION
  1567.  *  cat33_hide_date_display
  1568.  * DESCRIPTION
  1569.  *  hide function of date display on idlescreen
  1570.  * PARAMETERS
  1571.  *  x1      [IN]        Start x position
  1572.  *  y1      [IN]        Start y position
  1573.  *  x2      [IN]        End x position
  1574.  *  y2      [IN]        End y position
  1575.  * RETURNS
  1576.  *  void
  1577.  *****************************************************************************/
  1578. void cat33_hide_date_display(S32 x1, S32 y1, S32 x2, S32 y2)
  1579. {
  1580.     /*----------------------------------------------------------------*/
  1581.     /* Local Variables                                                */
  1582.     /*----------------------------------------------------------------*/
  1583.     /*----------------------------------------------------------------*/
  1584.     /* Code Body                                                      */
  1585.     /*----------------------------------------------------------------*/
  1586.     gui_push_clip();
  1587.     gui_set_clip(x1, y1, x2, y2);
  1588.     /* PMT HIMANSHU START 20050721 */
  1589. #ifdef __GDI_MEMORY_PROFILE_2__
  1590.     /* gui_fill_rectangle(x1, y1, x2, y2, wgui_transparent_color); */
  1591.     gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT); /* 112205 transparent color Calvin */
  1592. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  1593.     /* gui_fill_rectangle(x1, y1, x2, y2, current_MMI_theme->title_filler->c); */
  1594. //KP Jerry modify on 2007-1-5 start
  1595. #ifndef __MMI_UI_TECHNO_IDLESCREEN_BAR_HALF_TRANSPARENT_DISPLAY__
  1596.     gui_show_image(0, MMI_status_bar_height, get_image(idlescreen_bar_id));//070306 Alpha layer
  1597. #else
  1598. gui_reset_clip();
  1599. gui_lock_double_buffer();
  1600. gdi_draw_solid_rect(0,MMI_status_bar_height,UI_device_width-1,MMI_status_bar_height+MMI_IDLESCREEN_BAR_HEIGHT-1,GDI_COLOR_HALF_TRANSPARENT);
  1601. gui_unlock_double_buffer();
  1602. gui_BLT_double_buffer(0,MMI_status_bar_height,UI_device_width-1,MMI_status_bar_height+MMI_IDLESCREEN_BAR_HEIGHT-1);
  1603. #endif
  1604. //KP Jerry modify on 2007-1-5 end
  1605.     /* PMT HIMANSHU END 20050721 */
  1606.     gui_pop_clip();
  1607. }
  1608. /* PMT HIMANSHU START 20050721 */
  1609. /*****************************************************************************
  1610.  * FUNCTION
  1611.  *  cat33_hide_day_string_display
  1612.  * DESCRIPTION
  1613.  *  hide function of day display on idlescreen
  1614.  * PARAMETERS
  1615.  *  x1      [IN]        Start x position
  1616.  *  y1      [IN]        Start y position
  1617.  *  x2      [IN]        End x position
  1618.  *  y2      [IN]        End y position
  1619.  * RETURNS
  1620.  *  void
  1621.  *****************************************************************************/
  1622. void cat33_hide_day_string_display(S32 x1, S32 y1, S32 x2, S32 y2)
  1623. {
  1624.     /*----------------------------------------------------------------*/
  1625.     /* Local Variables                                                */
  1626.     /*----------------------------------------------------------------*/
  1627.     /*----------------------------------------------------------------*/
  1628.     /* Code Body                                                      */
  1629.     /*----------------------------------------------------------------*/
  1630.     gui_push_clip();
  1631.     gui_set_clip(x1, y1, x2, y2);
  1632. #ifdef __GDI_MEMORY_PROFILE_2__
  1633.     /* gui_fill_rectangle(x1,y1,x2,y2,wgui_transparent_color); */
  1634.     gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT); /* 112205 transparent color Calvin */
  1635. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  1636. //KP Jerry modify on 2007-1-5 start
  1637. #ifndef __MMI_UI_TECHNO_IDLESCREEN_BAR_HALF_TRANSPARENT_DISPLAY__
  1638.     gui_show_image(0, MMI_status_bar_height, get_image(idlescreen_bar_id));//070306 Alpha layer
  1639. #else
  1640. gui_reset_clip();
  1641. gui_lock_double_buffer();
  1642. gdi_draw_solid_rect(0,MMI_status_bar_height,UI_device_width-1,MMI_status_bar_height+MMI_IDLESCREEN_BAR_HEIGHT-1,GDI_COLOR_HALF_TRANSPARENT);
  1643. gui_unlock_double_buffer();
  1644. gui_BLT_double_buffer(0,MMI_status_bar_height,UI_device_width-1,MMI_status_bar_height+MMI_IDLESCREEN_BAR_HEIGHT-1);
  1645. #endif
  1646. //KP Jerry modify on 2007-1-5 end
  1647.     gui_pop_clip();
  1648. }
  1649. /* PMT HIMANSHU END 20050721 */
  1650. #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */ 
  1651. /* PMT HIMANSHU END */
  1652. /*****************************************************************************
  1653.  * FUNCTION
  1654.  *  cat33_hide_time_display
  1655.  * DESCRIPTION
  1656.  *  hide function of time display of analog/digital  clock
  1657.  * PARAMETERS
  1658.  *  x1      [IN]        Start x position
  1659.  *  y1      [IN]        Start y position
  1660.  *  x2      [IN]        End x position
  1661.  *  y2      [IN]        End y position
  1662.  * RETURNS
  1663.  *  void
  1664.  *****************************************************************************/
  1665. /* 092005 draw_wallpaper Calvin Start */
  1666. #if 0
  1667. /* under construction !*/
  1668. /* under construction !*/
  1669. #ifndef __GDI_MEMORY_PROFILE_2__
  1670. /* under construction !*/
  1671. #endif
  1672. /* under construction !*/
  1673. /* under construction !*/
  1674. /* under construction !*/
  1675. /* under construction !*/
  1676. #ifdef __GDI_MEMORY_PROFILE_2__
  1677. /* under construction !*/
  1678. /* under construction !*/
  1679. #else
  1680. /* under construction !*/
  1681. /* under construction !*/
  1682. /* under construction !*/
  1683. /* under construction !*/
  1684. /* under construction !*/
  1685. /* under construction !*/
  1686. /* under construction !*/
  1687. /* under construction !*/
  1688. /* under construction !*/
  1689. /* under construction !*/
  1690. /* under construction !*/
  1691. /* under construction !*/
  1692. /* under construction !*/
  1693. #endif
  1694. /* under construction !*/
  1695. /* under construction !*/
  1696. /* under construction !*/
  1697. #else /* 0 */ 
  1698. void cat33_hide_time_display(S32 x1, S32 y1, S32 x2, S32 y2)
  1699. {
  1700.     /*----------------------------------------------------------------*/
  1701.     /* Local Variables                                                */
  1702.     /*----------------------------------------------------------------*/
  1703.     /*----------------------------------------------------------------*/
  1704.     /* Code Body                                                      */
  1705.     /*----------------------------------------------------------------*/
  1706.     gui_push_clip();
  1707.     gui_set_clip(0, y1, MAIN_LCD_device_width - 1, y2);
  1708.     wgui_hide_background_with_wallpaper(x1, y1, x2, y2);
  1709.     redraw_status_icon_bar(1);
  1710.     gui_pop_clip();
  1711. }
  1712. #endif /* 0 */ 
  1713. /* 092005 draw_wallpaper Calvin End */
  1714. /*****************************************************************************
  1715.  * FUNCTION
  1716.  *  idle_screen_hide_status_icons_bar0
  1717.  * DESCRIPTION
  1718.  *  hide function of stats icon horizontal bar of idle screen
  1719.  * PARAMETERS
  1720.  *  void
  1721.  * RETURNS
  1722.  *  void
  1723.  *****************************************************************************/
  1724. void idle_screen_hide_status_icons_bar0(void)
  1725. {
  1726.     /*----------------------------------------------------------------*/
  1727.     /* Local Variables                                                */
  1728.     /*----------------------------------------------------------------*/
  1729.     S32 x1, y1, x2, y2;
  1730. #ifndef __MMI_IDLE_FULL_SCREEN__
  1731.     color c = *current_MMI_theme->statusbar0_background_color;
  1732. #endif 
  1733.     /*----------------------------------------------------------------*/
  1734.     /* Code Body                                                      */
  1735.     /*----------------------------------------------------------------*/
  1736.     gui_push_clip();
  1737.     get_status_icon_bar_clip(0, &x1, &y1, &x2, &y2);
  1738.     gui_set_clip(x1, y1, x2, y2);
  1739. #ifdef __MMI_IDLE_FULL_SCREEN__
  1740.     /* MTK Leo add 20040423, provide new interfaces to set wallpaper */
  1741.     if (idle_screen_wallpaper_ID == 0)
  1742. #ifdef __GDI_MEMORY_PROFILE_2__
  1743.         /* gui_fill_rectangle(x1,y1,x2,y2,wgui_transparent_color); */
  1744.         gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);     /* 112205 transparent color Calvin */
  1745. #else /* __GDI_MEMORY_PROFILE_2__ */ 
  1746.         draw_wallpaper();
  1747. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  1748.     else
  1749.     {
  1750.     #ifdef __GDI_MEMORY_PROFILE_2__
  1751.         /* gui_fill_rectangle(x1,y1,x2,y2,wgui_transparent_color); */
  1752.         gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);     /* 112205 transparent color Calvin */
  1753.     #else /* __GDI_MEMORY_PROFILE_2__ */ 
  1754.         /* PMT VIKAS START 20050707 */
  1755.     #if !((defined __MMI_UI_DALMATIAN_STATUSBAR__) && (defined __MMI_MAINLCD_176X220__))
  1756.         draw_wallpaper();
  1757.     #endif 
  1758.     #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  1759.         /* PMT VIKAS END 20050707 */
  1760.     }
  1761.     /* MTK Leo end */
  1762. #else /* __MMI_IDLE_FULL_SCREEN__ */ 
  1763.     gui_fill_rectangle(x1, y1, x2, y2, c);
  1764. #endif /* __MMI_IDLE_FULL_SCREEN__ */ 
  1765.     gui_pop_clip();
  1766. }
  1767. /*****************************************************************************
  1768.  * FUNCTION
  1769.  *  idle_screen_hide_status_icons_bar1
  1770.  * DESCRIPTION
  1771.  *  hide function of stats icon vertical  bar of idle screen
  1772.  * PARAMETERS
  1773.  *  void
  1774.  * RETURNS
  1775.  *  void
  1776.  *****************************************************************************/
  1777. void idle_screen_hide_status_icons_bar1(void)
  1778. {
  1779.     /*----------------------------------------------------------------*/
  1780.     /* Local Variables                                                */
  1781.     /*----------------------------------------------------------------*/
  1782.     S32 x1, y1, x2, y2;
  1783.     PU8 idle_screen_wallpaper;
  1784.     /*----------------------------------------------------------------*/
  1785.     /* Code Body                                                      */
  1786.     /*----------------------------------------------------------------*/
  1787.     idle_screen_wallpaper = get_image(idle_screen_wallpaper_ID);
  1788.     gui_push_clip();
  1789.     get_status_icon_bar_clip(1, &x1, &y1, &x2, &y2);
  1790.     /* PMT VIKAS START 20051010 */
  1791. #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  1792.     y1 = y1 + 4;    /* To restrict the clip area below from the time date area lines. */
  1793. #endif 
  1794.     /* PMT VIKAS END 20051010 */
  1795.     gui_set_clip(x1, y1, x2, y2);
  1796.     /* MTK Leo add 20040423, provide new interfaces to set wallpaper */
  1797.     if (idle_screen_wallpaper_ID == 0)
  1798. #ifdef __GDI_MEMORY_PROFILE_2__
  1799.         /* gui_fill_rectangle(x1,y1,x2,y2,wgui_transparent_color); */
  1800.         gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);     /* 112205 transparent color Calvin */
  1801. #else /* __GDI_MEMORY_PROFILE_2__ */ 
  1802.         draw_wallpaper();
  1803. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  1804.     else
  1805.     {
  1806.     #ifdef __GDI_MEMORY_PROFILE_2__
  1807.         /* gui_fill_rectangle(x1,y1,x2,y2,wgui_transparent_color); */
  1808.         gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);     /* 112205 transparent color Calvin */
  1809.     #else /* __GDI_MEMORY_PROFILE_2__ */ 
  1810.         draw_wallpaper();
  1811.     #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  1812.     }
  1813.     /* MTK Leo end */
  1814.     gui_pop_clip();
  1815. }
  1816. /*****************************************************************************
  1817.  * FUNCTION
  1818.  *  SetIdleScreenWallpaper
  1819.  * DESCRIPTION
  1820.  *  Sets the Image to be used by the idle screen
  1821.  * PARAMETERS
  1822.  *  image_ID        [IN]        
  1823.  * RETURNS
  1824.  *  void
  1825.  *****************************************************************************/
  1826. void SetIdleScreenWallpaper(U16 image_ID)
  1827. {
  1828.     /*----------------------------------------------------------------*/
  1829.     /* Local Variables                                                */
  1830.     /*----------------------------------------------------------------*/
  1831.     PU8 idle_screen_wallpaper;
  1832.     /*----------------------------------------------------------------*/
  1833.     /* Code Body                                                      */
  1834.     /*----------------------------------------------------------------*/
  1835. #ifndef __MMI_UI_TECHNO_IDLESCREEN_BAR__    
  1836. #ifdef __MMI_ANALOG_CLOCK__
  1837.     if ((image_ID == IMG_ID_DISPCHAR_ANALOG_CLK))
  1838.     {
  1839.         idle_screen_type = ANALOG_IDLE_SCREEN;
  1840.         idle_screen_wallpaper_ID = IMG_ID_DISPCHAR_ANALOG_CLK;
  1841.     }
  1842.     else
  1843. #endif /* __MMI_ANALOG_CLOCK__ */ 
  1844. #ifdef __MMI_DIGITAL_CLOCK__
  1845.     if ((image_ID == IMG_ID_DISPCHAR_DIGITAL_CLK))
  1846.     {
  1847.         idle_screen_wallpaper_ID = IMG_ID_DISPCHAR_DIGITAL_CLK;
  1848.         idle_screen_type = DIGITAL_IDLE_SCREEN;
  1849.     }
  1850.     else
  1851. #endif /* __MMI_DIGITAL_CLOCK__ */ 
  1852. #endif /* !__MMI_UI_TECHNO_IDLESCREEN_BAR__ */
  1853.     {
  1854.         idle_screen_type = NORMAL_IDLE_SCREEN;
  1855.         idle_screen_wallpaper_ID = image_ID;
  1856.     }
  1857.     idle_screen_wallpaper = get_image(idle_screen_wallpaper_ID);
  1858.     gui_measure_image(idle_screen_wallpaper, &cat33_image_width, &cat33_image_height);
  1859.     cat33_n_frames = gui_image_n_frames(idle_screen_wallpaper);
  1860.     //cat33_image_x=(UI_device_width>>1)-(cat33_image_width>>1);
  1861.     //cat33_image_y=(UI_device_height>>1)-(cat33_image_height>>1);
  1862.     cat33_image_x = (UI_device_width - cat33_image_width) >> 1; /* 032805 Calvin modified */
  1863.     cat33_image_y = (UI_device_height - cat33_image_height) >> 1;
  1864. }
  1865. /*****************************************************************************
  1866.  * FUNCTION
  1867.  *  SetIdleScreenNetworkName
  1868.  * DESCRIPTION
  1869.  *  Sets the network name to be displayed by the idle screen
  1870.  * PARAMETERS
  1871.  *  s       [?]     
  1872.  * RETURNS
  1873.  *  void
  1874.  *****************************************************************************/
  1875. void SetIdleScreenNetworkName(U8 *s)
  1876. {
  1877.     /*----------------------------------------------------------------*/
  1878.     /* Local Variables                                                */
  1879.     /*----------------------------------------------------------------*/
  1880.     U16 strlen, i, real_pos;
  1881.     S8 start_flag = 0;
  1882.     /*----------------------------------------------------------------*/
  1883.     /* Code Body                                                      */
  1884.     /*----------------------------------------------------------------*/
  1885.     /* Lisen 0921-1 */
  1886.     if (s == NULL)
  1887.     {
  1888.         idle_screen_network_name = NULL;
  1889.         return;
  1890.     }
  1891.     real_pos = 0;
  1892.     strlen = (U16) gui_strlen((UI_string_type) s) << 1;
  1893.     for (i = 0; i < strlen; i += 2)
  1894.     {
  1895.         if (s[i] != 0x20 || s[i + 1] != 0x00)
  1896.         {
  1897.             start_flag = 1;
  1898.         }
  1899.         if (start_flag == 1)    /* real data starts */
  1900.         {
  1901.             s[real_pos] = s[i];
  1902.             s[real_pos + 1] = s[i + 1];
  1903.             real_pos += 2;
  1904.         }
  1905.     }
  1906.     if (real_pos < strlen)
  1907.     {
  1908.         for (i = real_pos; i < strlen; i++)
  1909.         {
  1910.             s[i] = '';
  1911.         }
  1912.     }
  1913.     strlen = (U16) gui_strlen((UI_string_type) s) << 1;
  1914.     for (i = strlen - 2; i > 0; i -= 2)
  1915.     {
  1916.         if (s[i] != 0x20 || s[i + 1] != 0x00)
  1917.         {
  1918.             break;
  1919.         }
  1920.         else
  1921.         {
  1922.             s[i] = '';
  1923.             s[i + 1] = '';
  1924.         }
  1925.     }
  1926.     idle_screen_network_name = (UI_string_type) s;
  1927. }
  1928. /*****************************************************************************
  1929.  * FUNCTION
  1930.  *  SetIdleScreenNetworkStatus
  1931.  * DESCRIPTION
  1932.  *  Sets the network status to be displayed by the idle screen
  1933.  * PARAMETERS
  1934.  *  s       [?]     
  1935.  * RETURNS
  1936.  *  void
  1937.  *****************************************************************************/
  1938. void SetIdleScreenNetworkStatus(U8 *s)
  1939. {
  1940.     /*----------------------------------------------------------------*/
  1941.     /* Local Variables                                                */
  1942.     /*----------------------------------------------------------------*/
  1943.     S16 strlen, i, real_pos;    /* To avoid the strlen length 0 case */
  1944.     S8 start_flag = 0;
  1945.     /*----------------------------------------------------------------*/
  1946.     /* Code Body                                                      */
  1947.     /*----------------------------------------------------------------*/
  1948.     real_pos = 0;
  1949.     strlen = (S16) gui_strlen((UI_string_type) s) << 1;
  1950.     for (i = 0; i < strlen; i += 2)
  1951.     {
  1952.         if (s[i] != 0x20 || s[i + 1] != 0x00)
  1953.         {
  1954.             start_flag = 1;
  1955.         }
  1956.         if (start_flag == 1)    /* real data starts */
  1957.         {
  1958.             s[real_pos] = s[i];
  1959.             s[real_pos + 1] = s[i + 1];
  1960.             real_pos += 2;
  1961.         }
  1962.     }
  1963.     if (real_pos < strlen)
  1964.     {
  1965.         for (i = real_pos; i < strlen; i++)
  1966.         {
  1967.             s[i] = '';
  1968.         }
  1969.     }
  1970.     strlen = (S16) gui_strlen((UI_string_type) s) << 1;
  1971.     for (i = strlen - 2; i > 0; i -= 2)
  1972.     {
  1973.         if (s[i] != 0x20 || s[i + 1] != 0x00)
  1974.         {
  1975.             break;
  1976.         }
  1977.         else
  1978.         {
  1979.             s[i] = '';
  1980.             s[i + 1] = '';
  1981.         }
  1982.     }
  1983.     idle_screen_network_status = (UI_string_type) s;
  1984. }
  1985. /*****************************************************************************
  1986.  * FUNCTION
  1987.  *  cat33_animation_processor
  1988.  * DESCRIPTION
  1989.  *  a function which shows frames of animated wallpaper
  1990.  * PARAMETERS
  1991.  *  void
  1992.  * RETURNS
  1993.  *  void
  1994.  *****************************************************************************/
  1995. void cat33_animation_processor(void)
  1996. {
  1997.     /*----------------------------------------------------------------*/
  1998.     /* Local Variables                                                */
  1999.     /*----------------------------------------------------------------*/
  2000.     PU8 idle_screen_wallpaper = get_image(idle_screen_wallpaper_ID);
  2001.     /*----------------------------------------------------------------*/
  2002.     /* Code Body                                                      */
  2003.     /*----------------------------------------------------------------*/
  2004.     cat33_frame_number++;
  2005.     if (cat33_frame_number >= cat33_n_frames)
  2006.     {
  2007.         cat33_frame_number = 0;
  2008.     }
  2009.     gui_start_timer(cat33_animation_delay, cat33_animation_processor);
  2010.     gui_lock_double_buffer();
  2011. #ifndef __MMI_IDLE_FULL_SCREEN__
  2012.     gui_set_clip(0, MMI_status_bar_height, UI_device_width - 1, UI_device_height - MMI_button_bar_height);
  2013. #else /* __MMI_IDLE_FULL_SCREEN__ */ 
  2014.     /* PMT VIKAS START 20050707 */
  2015. #if defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__)
  2016.     gui_set_clip(
  2017.         0,
  2018.         MMI_status_bar_height + MMI_title_height,
  2019.         UI_device_width - 1,
  2020.         UI_device_height - MMI_button_bar_height);
  2021. #else /* defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) */ 
  2022.     /* PMT VIKAS END 20050707 */
  2023.     gui_reset_clip();
  2024. #endif /* defined(__MMI_UI_DALMATIAN_STATUSBAR__) || defined(__MMI_UI_DALMATIAN_SOFTKEYS__) */ 
  2025. #endif /* __MMI_IDLE_FULL_SCREEN__ */ 
  2026.     gui_draw_filled_area(0, 0, UI_device_width - 1, UI_device_height - 1, current_MMI_theme->general_background_filler);
  2027.     gui_show_animated_image_frame(cat33_image_x, cat33_image_y, idle_screen_wallpaper, (S16) cat33_frame_number);
  2028.     /* PMT HIMANSHU START 20050721 */
  2029. #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  2030.     /* 090605 Idlescreen Calvin Start */
  2031. #ifndef __MMI_UI_TECHNO_STATUS_ICON__
  2032.     if (PhnsetGetShowDateTimeStatus() == MMI_TRUE)
  2033. #endif 
  2034.         /* 090605 Idlescreen Calvin End */
  2035. //KP Jerry modify on 2007-1-5 start
  2036. #ifndef __MMI_UI_TECHNO_IDLESCREEN_BAR_HALF_TRANSPARENT_DISPLAY__
  2037. gui_show_image(0, MMI_status_bar_height, get_image(idlescreen_bar_id));//070306 Alpha layer
  2038. #else
  2039. gui_reset_clip();
  2040. gui_lock_double_buffer();
  2041. gdi_draw_solid_rect(0,MMI_status_bar_height,UI_device_width-1,MMI_status_bar_height+MMI_IDLESCREEN_BAR_HEIGHT-1,GDI_COLOR_HALF_TRANSPARENT);
  2042. gui_unlock_double_buffer();
  2043. gui_BLT_double_buffer(0,MMI_status_bar_height,UI_device_width-1,MMI_status_bar_height+MMI_IDLESCREEN_BAR_HEIGHT-1);
  2044. #endif
  2045. //KP Jerry modify on 2007-1-5 end
  2046. #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */ 
  2047.     /* PMT HIMANSHU END 20050721 */
  2048.     show_main_LCD_dt_display();
  2049.     /* PMT VIKAS START 20050707 */
  2050. #ifndef __MMI_UI_DALMATIAN_STATUSBAR__
  2051. #ifdef __MMI_IDLE_FULL_SCREEN__
  2052.     redraw_status_icon_bar(0);
  2053. #endif 
  2054.     redraw_status_icon_bar(1);
  2055. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  2056.     /* PMT VIKAS END 20050707 */
  2057.     idle_screen_show_network_details();
  2058.     /* PMT VIKAS START 20050707 */
  2059. #ifndef __MMI_UI_DALMATIAN_SOFTKEYS__
  2060. #ifdef __MMI_IDLE_FULL_SCREEN__
  2061.     if (cat33_image_height < UI_device_height)
  2062.     {
  2063.         show_softkey_background();
  2064.     }
  2065.     show_left_softkey();
  2066.     show_right_softkey();
  2067. #endif /* __MMI_IDLE_FULL_SCREEN__ */ 
  2068. #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  2069.     /* PMT VIKAS END 20050707 */
  2070.     gui_unlock_double_buffer();
  2071.     gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
  2072. }
  2073. /* MTK Leo add 20040422, provide new interfaces to set wallpaper */
  2074. /*****************************************************************************
  2075.  * FUNCTION
  2076.  *  wgui_set_wallpaper_change
  2077.  * DESCRIPTION
  2078.  *  Sets the Image to be used by the idle screen using ID
  2079.  * PARAMETERS
  2080.  *  void
  2081.  * RETURNS
  2082.  *  void
  2083.  *****************************************************************************/
  2084. /* 122105 wallpaper Calvin */
  2085. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  2086. void wgui_set_wallpaper_change(void)
  2087. {
  2088.     /*----------------------------------------------------------------*/
  2089.     /* Local Variables                                                */
  2090.     /*----------------------------------------------------------------*/
  2091.     /*----------------------------------------------------------------*/
  2092.     /* Code Body                                                      */
  2093.     /*----------------------------------------------------------------*/
  2094.     gIsWallpaperChange = 1;
  2095. }
  2096. /*****************************************************************************
  2097.  * FUNCTION
  2098.  *  wgui_is_wallpaper_change
  2099.  * DESCRIPTION
  2100.  *  
  2101.  * PARAMETERS
  2102.  *  void
  2103.  * RETURNS
  2104.  *  
  2105.  *****************************************************************************/
  2106. U8 wgui_is_wallpaper_change(void)
  2107. {
  2108.     /*----------------------------------------------------------------*/
  2109.     /* Local Variables                                                */
  2110.     /*----------------------------------------------------------------*/
  2111.     /*----------------------------------------------------------------*/
  2112.     /* Code Body                                                      */
  2113.     /*----------------------------------------------------------------*/
  2114.     return gIsWallpaperChange;
  2115. }
  2116. /*****************************************************************************
  2117.  * FUNCTION
  2118.  *  wgui_reset_wallpaper_change
  2119.  * DESCRIPTION
  2120.  *  
  2121.  * PARAMETERS
  2122.  *  void
  2123.  * RETURNS
  2124.  *  void
  2125.  *****************************************************************************/
  2126. void wgui_reset_wallpaper_change(void)
  2127. {
  2128.     /*----------------------------------------------------------------*/
  2129.     /* Local Variables                                                */
  2130.     /*----------------------------------------------------------------*/
  2131.     /*----------------------------------------------------------------*/
  2132.     /* Code Body                                                      */
  2133.     /*----------------------------------------------------------------*/
  2134.     gIsWallpaperChange = 0;
  2135. }
  2136. #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  2137. /*****************************************************************************
  2138.  * FUNCTION
  2139.  *  SetIdleScreenWallpaperID
  2140.  * DESCRIPTION
  2141.  *  
  2142.  * PARAMETERS
  2143.  *  image_ID        [IN]        
  2144.  * RETURNS
  2145.  *  void
  2146.  *****************************************************************************/
  2147. void SetIdleScreenWallpaperID(U16 image_ID, MMI_BOOL is_default)
  2148. {
  2149.     /*----------------------------------------------------------------*/
  2150.     /* Local Variables                                                */
  2151.     /*----------------------------------------------------------------*/
  2152.     PU8 idle_screen_wallpaper;
  2153.     
  2154.     /* 101705 Calvin Start */
  2155. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  2156.     U16 bg_img_id;
  2157.     S8 *bg_img_name;
  2158.     S32 bg_img_x, bg_img_y;
  2159.     U8 bg_img_opacity;
  2160. #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  2161.     /*----------------------------------------------------------------*/
  2162.     /* Code Body                                                      */
  2163.     /*----------------------------------------------------------------*/
  2164.     /* 101705 Calvin End */
  2165. /* 100206 ENFB support Start */
  2166. #ifdef __MMI_RESOURCE_ENFB_SUPPORT__ 
  2167.     if (idle_screen_wallpaper_ID != 0)
  2168.     {
  2169.         mmi_frm_resmem_dereg_retain((U16)idle_screen_wallpaper_ID);
  2170.     }
  2171. #endif
  2172. /* 100206 ENFB support End */
  2173. #ifndef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  2174. #ifdef __MMI_ANALOG_CLOCK__
  2175.     if ((image_ID == IMG_ID_DISPCHAR_ANALOG_CLK))
  2176.     {
  2177.         idle_screen_type = ANALOG_IDLE_SCREEN;
  2178.         /* __CUSTPACK_MULTIBIN Calvin BEGIN */
  2179.         idle_screen_wallpaper_ID = IMG_ID_DISPCHAR_ANALOG_CLK;
  2180.         /* __CUSTPACK_MULTIBIN Calvin END */
  2181.     }
  2182.     else
  2183. #endif /* __MMI_ANALOG_CLOCK__ */ 
  2184. #ifdef __MMI_DIGITAL_CLOCK__
  2185.     if ((image_ID == IMG_ID_DISPCHAR_DIGITAL_CLK))
  2186.     {
  2187.         idle_screen_wallpaper_ID = IMG_ID_DISPCHAR_DIGITAL_CLK;
  2188.         idle_screen_type = DIGITAL_IDLE_SCREEN;
  2189.     }
  2190.     else
  2191. #endif /* __MMI_DIGITAL_CLOCK__ */ 
  2192. #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
  2193.     {
  2194.         idle_screen_type = NORMAL_IDLE_SCREEN;
  2195.         idle_screen_wallpaper_ID = image_ID;
  2196.     }
  2197. /* 100206 ENFB support Start */
  2198. #ifdef __MMI_RESOURCE_ENFB_SUPPORT__ 
  2199.     mmi_frm_resmem_reg_retain((U16)idle_screen_wallpaper_ID);
  2200. #endif
  2201. /* 100206 ENFB support End */
  2202.     idle_screen_wallpaper = get_image(idle_screen_wallpaper_ID);
  2203.     gdi_image_get_dimension(idle_screen_wallpaper, &cat33_image_width, &cat33_image_height);
  2204.     gdi_image_get_frame_count_id(idle_screen_wallpaper_ID, &cat33_n_frames);
  2205.     cat33_image_x = (UI_device_width - cat33_image_width) >> 1;
  2206.     cat33_image_y = (UI_device_height - cat33_image_height) >> 1;
  2207. #ifdef __MTK_TARGET__
  2208.     if(cat33_n_frames > 1)
  2209.     {
  2210.         wgui_save_wallpaper_to_speedup(is_default);
  2211.     }
  2212.     else
  2213. #endif /* __MTK_TARGET__ */        
  2214.     {
  2215.     #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  2216.         idle_screen_cache_id = idle_screen_wallpaper_ID;
  2217.         idle_screen_cache_name = NULL;
  2218.             
  2219.         dm_set_scr_bg_redraw(MMI_TRUE);
  2220.         dm_get_scr_bg_image(&bg_img_id, &bg_img_name, &bg_img_x, &bg_img_y, &bg_img_opacity);
  2221.         dm_set_scr_bg_image(idle_screen_cache_id, idle_screen_cache_name, bg_img_x, bg_img_y, bg_img_opacity);
  2222.     #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  2223.     }
  2224. }
  2225. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  2226. /*****************************************************************************
  2227.  * FUNCTION
  2228.  *  SetIdleScreenWallpaperID
  2229.  * DESCRIPTION
  2230.  *  
  2231.  * PARAMETERS
  2232.  *  image_ID        [IN]        
  2233.  * RETURNS
  2234.  *  void
  2235.  *****************************************************************************/
  2236.  void SetListWallpaperID(U16 image_ID)
  2237. {
  2238.     /*----------------------------------------------------------------*/
  2239.     /* Local Variables                                                */
  2240.     /*----------------------------------------------------------------*/
  2241.     U16 bg_img_id;
  2242.     S8 *bg_img_name;
  2243.     S32 bg_img_x, bg_img_y;
  2244.     U8 bg_img_opacity;
  2245.     /*----------------------------------------------------------------*/
  2246.     /* Code Body                                                      */
  2247.     /*----------------------------------------------------------------*/
  2248.     idle_screen_type = NORMAL_IDLE_SCREEN;
  2249.     idle_screen_wallpaper_ID = image_ID;
  2250.     dm_set_scr_bg_redraw(MMI_TRUE);
  2251.     dm_get_scr_bg_image(&bg_img_id, &bg_img_name, &bg_img_x, &bg_img_y, &bg_img_opacity);
  2252.     dm_set_scr_bg_image(idle_screen_wallpaper_ID, NULL, bg_img_x, bg_img_y, bg_img_opacity);
  2253. }
  2254. #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  2255. /*****************************************************************************
  2256.  * FUNCTION
  2257.  *  SetIdleScreenWallpaperName
  2258.  * DESCRIPTION
  2259.  *  
  2260.  * PARAMETERS
  2261.  *  name        [IN]        
  2262.  * RETURNS
  2263.  *  void
  2264.  *****************************************************************************/
  2265. void SetIdleScreenWallpaperName(UI_string_type name)
  2266. {
  2267.     /*----------------------------------------------------------------*/
  2268.     /* Local Variables                                                */
  2269.     /*----------------------------------------------------------------*/
  2270.     S32 disp_height = UI_device_height, disp_width = UI_device_width;
  2271.     /*----------------------------------------------------------------*/
  2272.     /* Code Body                                                      */
  2273.     /*----------------------------------------------------------------*/
  2274. /* 100206 ENFB support Start */
  2275. #ifdef __MMI_RESOURCE_ENFB_SUPPORT__ 
  2276.     if (idle_screen_wallpaper_ID != 0)
  2277.     {
  2278.         mmi_frm_resmem_dereg_retain((U16)idle_screen_wallpaper_ID);
  2279.     }
  2280. #endif
  2281. /* 100206 ENFB support End */
  2282.     idle_screen_wallpaper_ID = 0;
  2283.     idle_screen_type = NORMAL_IDLE_SCREEN;
  2284. #ifndef __MMI_IDLE_FULL_SCREEN__
  2285.     disp_height = UI_device_height - MMI_status_bar_height - MMI_button_bar_height;
  2286.     disp_width = UI_device_width - 1;
  2287. #endif /* __MMI_IDLE_FULL_SCREEN__ */ 
  2288.     gdi_image_get_dimension_file((S8*) name, &cat33_image_width, &cat33_image_height);
  2289.     cat33_image_x = (disp_width - cat33_image_width) >> 1;  /* 032805 Calvin modified */
  2290.     cat33_image_y = (disp_height - cat33_image_height) >> 1;
  2291.     gdi_image_get_frame_count_file((U8 *)name, &cat33_n_frames);
  2292.     pfnUnicodeStrcpy(idle_screen_wallpaper_name_original, (S8*) name);
  2293.     idle_screen_wallpaper_name = idle_screen_wallpaper_name_original;
  2294. }
  2295. /*****************************************************************************
  2296.  * FUNCTION
  2297.  *  draw_wallpaper
  2298.  * DESCRIPTION
  2299.  *  Redraws the Idle screen
  2300.  * PARAMETERS
  2301.  *  void
  2302.  * RETURNS
  2303.  *  void
  2304.  *****************************************************************************/
  2305. void draw_wallpaper(void)
  2306. {
  2307.     /*----------------------------------------------------------------*/
  2308.     /* Local Variables                                                */
  2309.     /*----------------------------------------------------------------*/
  2310.     PU8 idle_screen_wallpaper = get_image(idle_screen_wallpaper_ID);
  2311.     /* Robin 1208 Display user define wallpaper */
  2312.     S32 disp_height = UI_device_height, disp_width = UI_device_width;
  2313.     GDI_RESULT ret = GDI_SUCCEED;
  2314.     /*----------------------------------------------------------------*/
  2315.     /* Code Body                                                      */
  2316.     /*----------------------------------------------------------------*/
  2317. #if defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__)
  2318.     if (animation_handle != GDI_ERROR_HANDLE)
  2319.     {
  2320.         gdi_image_stop_animation(animation_handle);
  2321.         animation_handle = GDI_ERROR_HANDLE;
  2322.     }
  2323. #endif /* defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__) */ 
  2324.     gui_draw_filled_area(0, 0, UI_device_width - 1, UI_device_height - 1, current_MMI_theme->general_background_filler);
  2325. #ifndef __MMI_IDLE_FULL_SCREEN__
  2326.     /* Robin 1208 Display user define wallpaper */
  2327.     disp_height = UI_device_height - MMI_status_bar_height - MMI_button_bar_height;
  2328.     disp_width = UI_device_width - 1;
  2329.     gui_set_clip(0, MMI_status_bar_height, UI_device_width - 1, UI_device_height - MMI_button_bar_height);
  2330. #endif /* __MMI_IDLE_FULL_SCREEN__ */ 
  2331.     if (idle_screen_wallpaper_ID != 0)  /* image comes from resource */
  2332.     {
  2333.         if (cat33_n_frames > 1)
  2334.     #if defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__)
  2335.             gdi_image_draw_animation_frames(
  2336.                 cat33_image_x,
  2337.                 cat33_image_y,
  2338.                 idle_screen_wallpaper,
  2339.                 &animation_handle,
  2340.                 (S16) cat33_frame_number);
  2341.     #else /* defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__) */ 
  2342.         {
  2343.             gdi_image_draw_animation_single_frame(
  2344.                 cat33_image_x,
  2345.                 cat33_image_y,
  2346.                 idle_screen_wallpaper,
  2347.                 (S16) cat33_frame_number);
  2348.             cat33_animation_delay = gdi_image_get_animation_delay();
  2349.         }
  2350.     #endif /* defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__) */ 
  2351.         else
  2352.         {
  2353.             gdi_image_draw(cat33_image_x, cat33_image_y, idle_screen_wallpaper);
  2354.         }
  2355.     }
  2356.     else
  2357.     {
  2358.         /* 102406 DRM check Start */
  2359.         FS_HANDLE originalPath = 0;
  2360.     #ifdef __DRM_SUPPORT__
  2361.         kal_bool DRM_ret = KAL_FALSE;
  2362.     #endif
  2363.         if (cat33_n_frames <= 1)//check if the original file of the cached static image still exists and the DRM right as well
  2364.         {
  2365.             if (idle_screen_wallpaper_name_original == NULL)
  2366.             {
  2367.                 ret = GDI_IMAGE_ERR_INVALID_FILE;
  2368.             }
  2369.             else
  2370.             {
  2371.             #ifdef __DRM_SUPPORT__
  2372.                 originalPath = DRM_open_file((PU16) idle_screen_wallpaper_name_original, FS_READ_ONLY | FS_OPEN_NO_DIR, DRM_PERMISSION_DISPLAY);
  2373.                 if (originalPath > 0)
  2374.                 {
  2375.                     DRM_ret = DRM_validate_permission(originalPath, DRM_PERMISSION_DISPLAY);
  2376.                 }
  2377.                 if (DRM_ret == KAL_FALSE)
  2378.             #else
  2379.                 originalPath = FS_Open((PU16) idle_screen_wallpaper_name_original, FS_READ_ONLY | FS_OPEN_NO_DIR);
  2380.                 if (originalPath < 0)
  2381.             #endif
  2382.                 {
  2383.                     ret = GDI_IMAGE_ERR_INVALID_FILE;
  2384.                 }
  2385.                 if (originalPath > 0)
  2386.                 {
  2387.                 #ifdef __DRM_SUPPORT__
  2388.                     DRM_close_file(originalPath);
  2389.                 #else
  2390.                     FS_Close(originalPath);
  2391.                 #endif
  2392.                     originalPath = 0;
  2393.                 }
  2394.              }
  2395.         }
  2396.         
  2397.         if (ret != GDI_IMAGE_ERR_INVALID_FILE)
  2398.         {
  2399.             S32 offset_x = 0;
  2400.             S32 offset_y = 0;
  2401.             gdi_image_get_dimension_file(idle_screen_wallpaper_name, &cat33_image_width, &cat33_image_height);
  2402.             cat33_image_x = (disp_width - cat33_image_width) >> 1;
  2403.             cat33_image_y = (disp_height - cat33_image_height) >> 1;
  2404.             if ((disp_width >= cat33_image_width) && (disp_height >= cat33_image_height))       /* image can be displayed entirely */
  2405.             {
  2406.                 /* align preview window at the center of screen */
  2407.                 offset_x = (disp_width - cat33_image_width) >> 1;
  2408.                 offset_y = (disp_height - cat33_image_height) >> 1;
  2409.             #if defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__)
  2410.                 ret = gdi_image_draw_animation_file(
  2411.                         offset_x,
  2412.                         offset_y,
  2413.                         (PS8) idle_screen_wallpaper_name,
  2414.                         &animation_handle);
  2415.             #else /* defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__) */ 
  2416.                 ret = gdi_image_draw_file(offset_x, offset_y, (PS8) idle_screen_wallpaper_name);
  2417.             #endif /* defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__) */ 
  2418.             }
  2419.             else    /* image is larger than screen size */
  2420.             {
  2421.                 S32 resized_offset_x;
  2422.                 S32 resized_offset_y;
  2423.                 S32 resized_width;
  2424.                 S32 resized_height;
  2425.                 gdi_image_util_fit_bbox(
  2426.                     disp_width,
  2427.                     disp_height,
  2428.                     cat33_image_width,
  2429.                     cat33_image_height,
  2430.                     &resized_offset_x,
  2431.                     &resized_offset_y,
  2432.                     &resized_width,
  2433.                     &resized_height);
  2434.                 /* for images of other formats, try to set center alignment */
  2435.             #if defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__)
  2436.                 ret = gdi_image_draw_animation_resized_file(
  2437.                         resized_offset_x,
  2438.                         resized_offset_y,
  2439.                         resized_width,
  2440.                         resized_height,
  2441.                         (PS8) idle_screen_wallpaper_name,
  2442.                         &animation_handle);
  2443.                 /* ret = gdi_image_draw_resized_file(resized_offset_x, resized_offset_y, resized_width, resized_height, (PS8)idle_screen_wallpaper_name); */
  2444.             #else /* defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__) */ 
  2445.                 ret = gdi_image_draw_resized_file(
  2446.                         resized_offset_x,
  2447.                         resized_offset_y,
  2448.                         resized_width,
  2449.                         resized_height,
  2450.                         (PS8) idle_screen_wallpaper_name);
  2451.             #endif /* defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__) */ 
  2452.             }
  2453.         }
  2454.         /* 102406 DRM check End */
  2455.         if (ret < 0 && ret != GDI_GIF_ERR_OUT_OF_CLIP_REGION && ret != GDI_BMP_ERR_OUT_OF_CLIP_REGION)
  2456.         {
  2457.             /* Robin 1208 Display user define wallpaper */
  2458.             PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "draw_wallpaper():[$$$]GDI_RESULT:%d[$$$]n", ret));
  2459.             PhnsetWallpaperBadFileCallBack(0);
  2460.             idle_screen_wallpaper = get_image(idle_screen_wallpaper_ID);
  2461.             cat33_n_frames = gui_image_n_frames(idle_screen_wallpaper);
  2462.             gdi_image_get_dimension(idle_screen_wallpaper, &cat33_image_width, &cat33_image_height);
  2463.             cat33_image_x = (disp_width - cat33_image_width) >> 1;
  2464.             cat33_image_y = (disp_height - cat33_image_height) >> 1;
  2465.             if (cat33_n_frames > 1)
  2466.         #if defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__)
  2467.                 gdi_image_draw_animation_frames(
  2468.                     cat33_image_x,
  2469.                     cat33_image_y,
  2470.                     idle_screen_wallpaper,
  2471.                     &animation_handle,
  2472.                     (S16) cat33_frame_number);
  2473.         #else /* defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__) */ 
  2474.                 gdi_image_draw_animation_single_frame(
  2475.                     cat33_image_x,
  2476.                     cat33_image_y,
  2477.                     idle_screen_wallpaper,
  2478.                     (S16) cat33_frame_number);
  2479.         #endif /* defined(ENABLE_ANIMATED_WALLPAPERS) && defined(__GDI_MEMORY_PROFILE_2__) */ 
  2480.             else
  2481.             {
  2482.                 gdi_image_draw(cat33_image_x, cat33_image_y, idle_screen_wallpaper);
  2483.             }
  2484.         }
  2485.     }
  2486. }
  2487. /*****************************************************************************
  2488.  * FUNCTION
  2489.  *  wgui_stop_wallpaper
  2490.  * DESCRIPTION
  2491.  *  Stop wallpaper animation
  2492.  * PARAMETERS
  2493.  *  void
  2494.  * RETURNS
  2495.  *  void
  2496.  *****************************************************************************/
  2497. void wgui_stop_wallpaper(void)
  2498. {
  2499.     animation_handle = cat129_get_image_handle();
  2500.     if (animation_handle != GDI_ERROR_HANDLE)
  2501.     {
  2502.         gdi_image_stop_animation(animation_handle);
  2503.         animation_handle = GDI_ERROR_HANDLE;
  2504.     }
  2505.         animation_handle = cat222_get_image_handle();
  2506.     if (animation_handle != GDI_ERROR_HANDLE)
  2507.     {
  2508.         gdi_image_stop_animation(animation_handle);
  2509.         animation_handle = GDI_ERROR_HANDLE;
  2510.     }
  2511.     
  2512. }
  2513. /*****************************************************************************
  2514.  * FUNCTION
  2515.  *  wgui_save_wallpaper_to_speedup
  2516.  * DESCRIPTION
  2517.  *  Save the layer of wallpaper as fast format
  2518.  * PARAMETERS
  2519.  *  void
  2520.  * RETURNS
  2521.  *  void
  2522.  *****************************************************************************/
  2523. void wgui_save_wallpaper_to_speedup(MMI_BOOL is_default)
  2524. {
  2525. #ifdef GDI_USING_LAYER
  2526.     /*----------------------------------------------------------------*/
  2527.     /* Local Variables                                                */
  2528.     /*----------------------------------------------------------------*/
  2529. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  2530.     U16 bg_img_id;
  2531.     S8 *bg_img_name;
  2532.     S32 bg_img_x, bg_img_y;
  2533.     U8 bg_img_opacity;
  2534. #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  2535.     U8 *outside_mem = NULL;
  2536.     gdi_handle temp_wallpaper_handle = GDI_NULL_HANDLE;
  2537.     S32 disp_height = UI_device_height, disp_width = UI_device_width;
  2538.     U16 type;
  2539.     MMI_BOOL isFile = MMI_FALSE;
  2540.     
  2541.     /*----------------------------------------------------------------*/
  2542.     /* Code Body                                                      */
  2543.     /*----------------------------------------------------------------*/
  2544.     PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "wgui_save_wallpaper_to_speedup"));
  2545.     
  2546.     if (idle_screen_wallpaper_ID)
  2547.     {
  2548.         type = gdi_image_get_type_from_id(idle_screen_wallpaper_ID);
  2549.     }
  2550.     else
  2551.     {
  2552.         type = gdi_image_get_type_from_file(idle_screen_wallpaper_name);
  2553.         isFile = MMI_TRUE;
  2554.     }
  2555.     wgui_stop_wallpaper();
  2556.     if ((isFile && cat33_n_frames <= 1) ||
  2557.         type == GDI_IMAGE_TYPE_M3D ||
  2558.         type == GDI_IMAGE_TYPE_M3D_FILE || 
  2559.         (type == GDI_IMAGE_TYPE_GIF && cat33_n_frames > 1) ||
  2560.         type == GDI_IMAGE_TYPE_GIF_FILE)
  2561.     {
  2562.         outside_mem = (U8 *)mmi_frm_scrmem_alloc(((GDI_LCD_WIDTH*GDI_LCD_HEIGHT*GDI_MAINLCD_BIT_PER_PIXEL)>>3));
  2563.         if (outside_mem)
  2564.             gdi_layer_create_using_outside_memory(0, 0, UI_device_width, UI_device_height, &temp_wallpaper_handle, outside_mem, ((GDI_LCD_WIDTH*GDI_LCD_HEIGHT*GDI_MAINLCD_BIT_PER_PIXEL)>>3));
  2565.         else
  2566.             temp_wallpaper_handle = dm_get_layer_handle(0);
  2567.         /* redraw the animation to get the first frame */
  2568.         #ifdef __GDI_MEMORY_PROFILE_2__
  2569.             gdi_layer_push_and_set_active(temp_wallpaper_handle);
  2570.             
  2571.             gdi_layer_clear(GDI_COLOR_WHITE);
  2572.         #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  2573.             
  2574.             draw_wallpaper();
  2575.         /* 
  2576.          * 1. idle_screen_wallpaper_ID == 0 means PhnsetWallpaperBadFileCallBack was not called 
  2577.          * 2. is file, just cache it no matter what type it is
  2578.          */
  2579.         if (idle_screen_wallpaper_ID <= 1 || !isFile)  
  2580.         {
  2581.             if (
  2582.         #ifdef __FS_QM_SUPPORT__
  2583.                    ((gdi_layer_get_bit_per_pixel() * UI_device_width * UI_device_height + 13) <
  2584.                     FS_QmGetFree((BYTE*) "Z:\@USER\")) &&
  2585.         #endif /* __FS_QM_SUPPORT__ */ 
  2586.                    (0 <= gdi_layer_save_pbm_file(temp_wallpaper_handle, (S8*) PHNSET_PREDEFINED_WP_PATH_PBM)))
  2587.             {
  2588.                 idle_screen_wallpaper_name = (S8*) PHNSET_PREDEFINED_WP_PATH_PBM;
  2589.             }
  2590.             else if (0 <= gdi_layer_save_jpeg_file(temp_wallpaper_handle, (S8*) PHNSET_PREDEFINED_WP_PATH_JPG))
  2591.             {
  2592.                 idle_screen_wallpaper_name = (S8*) PHNSET_PREDEFINED_WP_PATH_JPG;
  2593.             }
  2594.             else
  2595.             {
  2596.                 ;   /* use original file. */
  2597.             }
  2598.             
  2599.             /* To tell list menu the image size */
  2600.             if (idle_screen_wallpaper_name == (S8*) PHNSET_PREDEFINED_WP_PATH_PBM ||
  2601.                 idle_screen_wallpaper_name == (S8*) PHNSET_PREDEFINED_WP_PATH_JPG)
  2602.             {
  2603.             #ifndef __MMI_IDLE_FULL_SCREEN__
  2604.                 disp_height = UI_device_height - MMI_status_bar_height - MMI_button_bar_height;
  2605.                 disp_width = UI_device_width - 1;
  2606.             #endif /* __MMI_IDLE_FULL_SCREEN__ */ 
  2607.                 cat33_image_width = disp_width;
  2608.                 cat33_image_height = disp_height;
  2609.                 
  2610.             }
  2611.             
  2612.         }
  2613.         #ifdef __GDI_MEMORY_PROFILE_2__
  2614.             gdi_layer_pop_and_restore_active();
  2615.         #endif 
  2616.         if (dm_get_layer_handle(0) != temp_wallpaper_handle)
  2617.         {
  2618.             gdi_layer_free(temp_wallpaper_handle);
  2619.         }
  2620.         if (outside_mem)
  2621.             mmi_frm_scrmem_free(outside_mem);
  2622.     #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  2623.         idle_screen_cache_name = idle_screen_wallpaper_name;
  2624.         idle_screen_cache_id = 0;
  2625.    
  2626.         /* make listmenu apply still image */
  2627.         dm_set_scr_bg_redraw(MMI_TRUE);
  2628.         dm_get_scr_bg_image(&bg_img_id, &bg_img_name, &bg_img_x, &bg_img_y, &bg_img_opacity);
  2629.         dm_set_scr_bg_image(idle_screen_cache_id, idle_screen_wallpaper_name, bg_img_x, bg_img_y, bg_img_opacity);
  2630.     #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  2631.     
  2632.         if (cat33_n_frames > 1 || type == GDI_IMAGE_TYPE_SVG_FILE)
  2633.         {
  2634.             /* make idlescreen apply animate image */
  2635.             idle_screen_wallpaper_name = idle_screen_wallpaper_name_original;
  2636.         }
  2637.         
  2638.     }
  2639. #endif /* GDI_USING_LAYER */ 
  2640. }
  2641. /*****************************************************************************
  2642. * FUNCTION
  2643. *  wgui_get_wallpaper_frame_count
  2644. * DESCRIPTION
  2645. *  Provide wallpaper frame count. 
  2646. * PARAMETERS
  2647. *  void
  2648. * RETURNS
  2649. *   void
  2650. *****************************************************************************/
  2651. MMI_BOOL wgui_check_wallpaper_frame_count(S8 *name, S8 **error_str)
  2652. {
  2653.     /*----------------------------------------------------------------*/
  2654.     /* Local Variables                                                */
  2655.     /*----------------------------------------------------------------*/
  2656.     S32 wallpaper_frames = 0;
  2657.     /*----------------------------------------------------------------*/
  2658.     /* Code Body                                                      */
  2659.     /*----------------------------------------------------------------*/
  2660.     gdi_image_gif_get_frame_count_file(name, &wallpaper_frames);
  2661.     PRINT_INFORMATION_2 ((MMI_TRACE_G7_MISC, "Wallpaper frame count = %d",  wallpaper_frames));
  2662.     if(wallpaper_frames > PHNSET_MAX_WALLPAPER_FRAME)
  2663.     {
  2664.         *error_str = (PS8)GetString(STR_ID_WP_FRAME_ERR);
  2665.         return MMI_FALSE;
  2666.     }
  2667.     else
  2668.     {
  2669.         *error_str = NULL;
  2670.         return MMI_TRUE;
  2671.     }
  2672. }
  2673. /* [~PMT  MANISH   20050623 */
  2674. #if ( defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) || defined(__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__) )    //KP Jerry add "__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__" on 2006-11-2
  2675. //KP Jerry modify on 2007-3-6 start
  2676. #if defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)
  2677. #define MAX_IDLE_SCREEN_SHORTCUTS   4
  2678. #elif defined(__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__)
  2679. #define MAX_IDLE_SCREEN_SHORTCUTS 5
  2680. #endif
  2681. //KP Jerry modify on 2007-3-6 end
  2682. typedef struct
  2683. {
  2684.     S32 x;
  2685.     S32 y;
  2686.     S32 width;
  2687.     S32 height;
  2688.     FuncPtr entryfn;
  2689. } idle_touch_screen_shortcut;
  2690. static idle_touch_screen_shortcut touch_idle_shortcuts[MAX_IDLE_SCREEN_SHORTCUTS];
  2691. static S32 touch_idle_screen_highlighted_shortcut;
  2692. static S32 touch_idle_screen_highlight_changed;
  2693. extern void mmi_phb_entry_main_menu(void);
  2694. extern void EntryScrMessagesMenuList(void);
  2695. /* PMT HIMANSHU START 20050721 */
  2696. extern void EntryMainMenuFromIdleScreen(void);
  2697. /* PMT HIMANSHU END 20050721 */
  2698. //KP Jerry add on 2006-11-5 start
  2699. extern void mmi_camera_entry_app_screen(void);
  2700. extern void mmi_vdoply_entry_app(void);
  2701. //KP Jerry add on 2006-11-5 end
  2702. /*****************************************************************************
  2703.  * FUNCTION
  2704.  *  setup_touch_idle_screen_shortcuts
  2705.  * DESCRIPTION
  2706.  *  This function is used to set up touch screen shortcuts
  2707.  * PARAMETERS
  2708.  *  void
  2709.  * RETURNS
  2710.  *  void
  2711.  * REMARKS
  2712.  *  This routine is dependent on Order of Image Id's of Shortcut Item Images.
  2713.  *  DON'T CHANGE THE ORDER OF IMAGE ID's
  2714.  *****************************************************************************/
  2715. void setup_touch_idle_screen_shortcuts(void)
  2716. {
  2717.     /*----------------------------------------------------------------*/
  2718.     /* Local Variables                                                */
  2719.     /*----------------------------------------------------------------*/
  2720. //KP Jerry modify on 2007-3-7 start
  2721. #if defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)     
  2722.     S32 image_width[MAX_IDLE_SCREEN_SHORTCUTS], image_height[MAX_IDLE_SCREEN_SHORTCUTS], total_width = 0, x, x_margin;
  2723. #endif     
  2724. S32 i;
  2725. //KP Jerry modify on 2007-3-7 end
  2726.     /*----------------------------------------------------------------*/
  2727.     /* Code Body                                                      */
  2728.     /*----------------------------------------------------------------*/
  2729.     for (i = 0; i < MAX_IDLE_SCREEN_SHORTCUTS; i++)
  2730.     {
  2731. //KP Jerry modify on 2007-3-7 start