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

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.  *   FunAndGamesSrc.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *   Fun And Game source file
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  * -------
  53.  * -------
  54.  *
  55.  *============================================================================
  56.  *             HISTORY
  57.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  58.  *------------------------------------------------------------------------------
  59.  * removed!
  60.  *
  61.  * removed!
  62.  * removed!
  63.  * removed!
  64.  *
  65.  * removed!
  66.  * removed!
  67.  * removed!
  68.  *
  69.  * removed!
  70.  * removed!
  71.  * removed!
  72.  *
  73.  * removed!
  74.  * removed!
  75.  * removed!
  76.  *
  77.  * removed!
  78.  * removed!
  79.  * removed!
  80.  *
  81.  * removed!
  82.  * removed!
  83.  * removed!
  84.  *
  85.  * removed!
  86.  * removed!
  87.  * removed!
  88.  *
  89.  * removed!
  90.  * removed!
  91.  * removed!
  92.  *
  93.  * removed!
  94.  * removed!
  95.  * removed!
  96.  *
  97.  * removed!
  98.  * removed!
  99.  * removed!
  100.  *
  101.  * removed!
  102.  * removed!
  103.  * removed!
  104.  *
  105.  * removed!
  106.  * removed!
  107.  * removed!
  108.  *
  109.  * removed!
  110.  * removed!
  111.  * removed!
  112.  *
  113.  * removed!
  114.  * removed!
  115.  * removed!
  116.  *
  117.  * removed!
  118.  * removed!
  119.  * removed!
  120.  *
  121.  * removed!
  122.  * removed!
  123.  * removed!
  124.  *
  125.  * removed!
  126.  * removed!
  127.  * removed!
  128.  *
  129.  * removed!
  130.  * removed!
  131.  * removed!
  132.  *
  133.  * removed!
  134.  * removed!
  135.  * removed!
  136.  *
  137.  * removed!
  138.  * removed!
  139.  * removed!
  140.  *
  141.  * removed!
  142.  * removed!
  143.  * removed!
  144.  *
  145.  * removed!
  146.  * removed!
  147.  * removed!
  148.  *
  149.  * removed!
  150.  * removed!
  151.  * removed!
  152.  *
  153.  * removed!
  154.  * removed!
  155.  * removed!
  156.  *
  157.  * removed!
  158.  * removed!
  159.  * removed!
  160.  *
  161.  * removed!
  162.  * removed!
  163.  * removed!
  164.  *
  165.  * removed!
  166.  * removed!
  167.  * removed!
  168.  *
  169.  * removed!
  170.  * removed!
  171.  * removed!
  172.  *
  173.  * removed!
  174.  * removed!
  175.  * removed!
  176.  *
  177.  * removed!
  178.  * removed!
  179.  * removed!
  180.  *
  181.  * removed!
  182.  * removed!
  183.  * removed!
  184.  *
  185.  * removed!
  186.  * removed!
  187.  * removed!
  188.  *
  189.  * removed!
  190.  * removed!
  191.  * removed!
  192.  *
  193.  * removed!
  194.  * removed!
  195.  * removed!
  196.  *
  197.  * removed!
  198.  * removed!
  199.  * removed!
  200.  *
  201.  * removed!
  202.  * removed!
  203.  * removed!
  204.  *
  205.  * removed!
  206.  * removed!
  207.  * removed!
  208.  *
  209.  * removed!
  210.  * removed!
  211.  * removed!
  212.  *
  213.  * removed!
  214.  * removed!
  215.  * removed!
  216.  *
  217.  * removed!
  218.  * removed!
  219.  * removed!
  220.  *
  221.  * removed!
  222.  * removed!
  223.  * removed!
  224.  *
  225.  * removed!
  226.  * removed!
  227.  * removed!
  228.  *
  229.  * removed!
  230.  * removed!
  231.  * removed!
  232.  *
  233.  *------------------------------------------------------------------------------
  234.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  235.  *============================================================================
  236.  ****************************************************************************/
  237. #include "MMI_features.h"
  238. #include "GlobalDefs.h" /* global define */
  239. #include "MainMenuDef.h"
  240. #include "CustMenuRes.h"
  241. #include "EventsGprot.h"        /* display screen, history related */
  242. #include "historyGprot.h"
  243. #include "wgui_categories.h"
  244. #include "wgui_inline_edit.h"
  245. #include "FunAndGamesDefs.h"    /* app header files */
  246. #include "FunAndGamesProts.h"
  247. #include "GameProts.h"
  248. #include "MMIThemes.h"
  249. #include "DownloadProtos.h"
  250. #include "ComposeRingToneProts.h"
  251. #include "VoiceMemoProt.h"
  252. #include "SettingProfile.h"     /* SUCCESS_TONE */
  253. #include "SettingDefs.h"        /* ST_NOTIFCATION */
  254. #include "CommonScreens.h"      /* popup */
  255. #include "wapadp.h"
  256. #include "SimDetectionGprot.h"
  257. #include "CommonScreens.h"
  258. #if defined(__MMI_GAME__)
  259. #include "GameFramework.h"
  260. #endif 
  261. #if defined(__MMI_3D_GAME__)
  262. #include "Game3DGprot.h"
  263. #endif 
  264. #if defined(__MMI_PICTURE_EDITOR_SUPPORT__)
  265. #include "PictureEditorProts.h"
  266. #endif 
  267. #if defined(__J2ME__)
  268. #include "JavaAgencyDef.h"
  269. #include "JavaAgencyGprot.h"
  270. #include "wapadp.h"
  271. #include "wap_ps_struct.h"
  272. #include "jam_msg_handler.h"
  273. #include "jvm_interface.h"
  274. #include "j2me_custom.h"
  275. #include "j2me_custom_option.h"
  276. #include "j2me_custom_param.h"
  277. #include "j2me_custom.h"
  278. #endif /* defined(__J2ME__) */ 
  279. #if defined(__MMI_RING_COMPOSER__) && defined(__MMI_IMELODY_SUPPORT__)
  280. #include "ComposeRingToneProts.h"
  281. #endif 
  282. #if defined(__MMI_VOICE_MEMO__)
  283. #include "VoiceMemoProt.h"
  284. #endif 
  285. #if defined(__MMI_AUDIO_PLAYER__)
  286. #include "PixtelDataTypes.h"    /* dependent headers for AudioPlayerProt.h" */
  287. #include "mdi_datatype.h"       /* dependent headers for AudioPlayerProt.h" */
  288. #include "AudioPlayerProt.h"
  289. #endif /* defined(__MMI_AUDIO_PLAYER__) */ 
  290. #if defined(__MMI_SOUND_RECORDER__)
  291. #include "SoundRecorderProt.h"
  292. #endif 
  293. #if defined(__MMI_IMAGE_VIEWER__)
  294. #include "FileManagerGprot.h"
  295. #include "filemgr.h"
  296. #include "ImageViewer.h"
  297. #endif 
  298. #if defined(__MMI_CAMERA__)
  299. #include "mdi_datatype.h"       /* dependent headers for mdi_camera.h" */
  300. #include "mdi_camera.h"
  301. #include "CameraApp.h"
  302. #endif /* defined(__MMI_CAMERA__) */ 
  303. #if defined(__MMI_VIDEO_PLAYER__)
  304. #include "VdoPlyGProt.h"
  305. #endif 
  306. #if defined(__MMI_VIDEO_RECORDER__)
  307. #include "VdoRecGProt.h"
  308. #endif 
  309. #if defined(__MMI_PHOTOEDITOR__)
  310. #include "PhotoEditorGProt.h"
  311. #endif 
  312. #ifdef __MMI_FM_RADIO__
  313. #include "FMRadioProt.h"
  314. #ifdef __MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__
  315. extern void mmi_fmrdo_skip_highlight_hdlr(S32 index);   /* defined in FMRadioSrc.c */
  316. extern U16 mmi_fmrdo_check_chip_or_hide(U16 n_items, U16 *string_ids, U16 *icon_ids); /* defined in FMRadioSrc.c */
  317. #endif /* __MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__ */ 
  318. #endif /* __MMI_FM_RADIO__ */ 
  319. #if defined(__MMI_PHB_CALLER_RES_SETTING__)
  320. #include "MessagesEXDcl.h"
  321. #include "SimDetectionGexdcl.h"
  322. #endif /* defined(__MMI_PHB_CALLER_RES_SETTING__) */ 
  323. #ifdef __MMI_AB_REPEATER__
  324. #include "mdi_datatype.h"
  325. #include "ABRepeaterProt.h"
  326. #endif /* __MMI_AB_REPEATER__ */ 
  327. /***************************************************************************** 
  328. * Constance
  329. *****************************************************************************/
  330. #define MAX_MEMORY_SIZE 16
  331. /***************************************************************************** 
  332. * Struct
  333. *****************************************************************************/
  334. #if defined (__J2ME__)
  335. typedef enum
  336. {
  337.     FNG_SETTING_JAVA_AUD,
  338.     FNG_SETTING_JAVA_VIB,
  339. #ifdef __MMI_FOURWAYS_KEY_DISABLE__
  340.     FNG_SETTING_JAVA_VK,
  341. #endif
  342.     FNG_SETTING_JAVA_PROF,
  343. #ifdef JAVA_SETTING_SHOW_FREE_STORAGE
  344.     FNG_SETTING_JAVA_STORAGE,
  345. #endif
  346.     FNG_SETTING_JAVA_HEAP,
  347.     FNG_SETTING_JAVA_ITEM_COUNT
  348. } fng_setting_java_inline_enum;
  349. typedef struct
  350. {
  351. #define MAX_WAP_PROF_SUM 16
  352.     UI_string_type java_aud_str[7];
  353.     S32 java_aud_selected;
  354.     UI_string_type java_vib_str[2];
  355.     S32 java_vib_selected;
  356. #ifdef __MMI_FOURWAYS_KEY_DISABLE__
  357.     UI_string_type java_vk_permission_str[3];
  358.     S32 java_vk_permission_selected;
  359. #endif /* __MMI_FOURWAYS_KEY_DISABLE__ */ 
  360.     U8 java_prof_id[MAX_WAP_PROF_SUM + 2];              /* default + disable + profiles */
  361.     UI_string_type java_prof_str[MAX_WAP_PROF_SUM + 2]; /* default + disable + profiles */
  362.     S32 java_prof_selected;
  363.     S32 java_prof_sum;
  364.     UI_character_type java_prof_strs[MAX_WAP_PROF_SUM][WAP_PROF_MAX_NAME_SIZE];
  365. #ifdef JAVA_SETTING_SHOW_FREE_STORAGE
  366.     UI_string_type java_storage_str[1];
  367.     S32 java_storage_selected;
  368.     UI_character_type java_storage_strs[1][MAX_MEMORY_SIZE];
  369. #endif
  370.     UI_string_type java_heap_str[1];
  371.     S32 java_heap_selected;
  372.     UI_character_type java_heap_strs[1][MAX_MEMORY_SIZE];
  373.     /* inline selection item */
  374.     InlineItem inline_java_items[FNG_SETTING_JAVA_ITEM_COUNT *2];      /* one for caption, one for selection */
  375. } fng_setting_inline_data_struct;
  376. typedef struct
  377. {
  378.     fng_setting_inline_data_struct setting_inline;
  379.     #ifdef OGDR_SECURITY_SETTING
  380.     S32 domain_selected;
  381.     S32 total_domain;
  382.     U16 domains[11][30];  /* 10+1 (Reset) */
  383.     #endif
  384. } fng_cntx_struct;
  385. #endif /* defined (__J2ME__) */ 
  386. /***************************************************************************** 
  387. * Global Variable
  388. *****************************************************************************/
  389. extern wgui_inline_item wgui_inline_items[];
  390. /***************************************************************************** 
  391. * Local Variable
  392. *****************************************************************************/
  393. #if defined (__J2ME__)
  394. fng_cntx_struct g_fng_cntx;
  395. #endif 
  396. /***************************************************************************** 
  397. * Local Function
  398. *****************************************************************************/
  399. void mmi_fng_highlight_setting_java(void);
  400. void mmi_fng_real_entry_setting_java_screen(void);
  401. #ifdef OGDR_SECURITY_SETTING
  402. void mmi_fng_highlight_security_java(void);
  403. void mmi_fng_real_entry_security_java(void);
  404. #endif
  405. /***************************************************************************** 
  406. * External Function
  407. *****************************************************************************/
  408. extern kal_uint32 get_mids_avail_storage(void);
  409. /*****************************************************************************
  410.  * FUNCTION
  411.  *  mmi_fng_entry_screen
  412.  * DESCRIPTION
  413.  *  entry FunAndGame menu
  414.  * PARAMETERS
  415.  *  void
  416.  * RETURNS
  417.  *  void
  418.  *****************************************************************************/
  419. void mmi_fng_entry_screen(void)
  420. {
  421.     /*----------------------------------------------------------------*/
  422.     /* Local Variables                                                */
  423.     /*----------------------------------------------------------------*/
  424.     U16 ItemList[MAX_SUB_MENUS];
  425.     U16 ItemIcons[MAX_SUB_MENUS];
  426.     U16 nItems;
  427.     U8 *guiBuffer;
  428.     /*----------------------------------------------------------------*/
  429.     /* Code Body                                                      */
  430.     /*----------------------------------------------------------------*/
  431.     EntryNewScreen(SCR3000_FUNANDGAMES, NULL, mmi_fng_entry_screen, NULL);
  432.     guiBuffer = GetCurrGuiBuffer(SCR3000_FUNANDGAMES);
  433.     nItems = GetNumOfChild(MAIN_MENU_FUNANDGAMES_MENUID);
  434.     GetSequenceStringIds(MAIN_MENU_FUNANDGAMES_MENUID, ItemList);
  435.     GetSequenceImageIds(MAIN_MENU_FUNANDGAMES_MENUID, ItemIcons);
  436.     SetParentHandler(MAIN_MENU_FUNANDGAMES_MENUID);
  437. #if defined(__MMI_FM_RADIO__) && defined(__MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__)
  438.     RegisterHighlightHandler(mmi_fmrdo_skip_highlight_hdlr);
  439.     nItems = mmi_fmrdo_check_chip_or_hide(nItems, ItemList, ItemIcons);
  440. #else /* defined(__MMI_FM_RADIO__) && defined(__MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__) */ 
  441.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  442. #endif /* defined(__MMI_FM_RADIO__) && defined(__MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__) */ 
  443. #if defined(__MMI_PHB_CALLER_RES_SETTING__)
  444.     /* No SIM, remove caller picture menu items */
  445.     if (mmi_bootup_is_sim_valid() == MMI_FALSE)
  446.     {
  447.         S32 MenuItemId;
  448.         MenuItemId = GetChildMenuIDIndexByParentMenuID(MAIN_MENU_FUNANDGAMES_MENUID, MENU_ID_PHB_CALLER_RING_1);
  449.         if (MenuItemId != -1)   /* Menu Exists. */
  450.         {
  451.             nItems -= 1;
  452.         }
  453.     }
  454. #endif /* defined(__MMI_PHB_CALLER_RES_SETTING__) */ 
  455.     /* MTK Leo add, mini_tab_bar */
  456. #ifdef __MMI_WGUI_MINI_TAB_BAR__
  457.     wgui_enable_mini_tab_bar(MAIN_MENU_FUNANDGAMES_MENUID);
  458. #endif 
  459.     /* MTK Leo end */
  460.     ShowCategory52Screen(
  461.         STR_SCR3000_FUNANDGAMES_CAPTION,
  462.         MAIN_MENU_TITLE_FUNANDGAMES_ICON,
  463.         STR_GLOBAL_OK,
  464.         IMG_GLOBAL_OK,
  465.         STR_GLOBAL_BACK,
  466.         IMG_GLOBAL_BACK,
  467.         nItems,
  468.         ItemList,
  469.         ItemIcons,
  470.         0,
  471.         0,
  472.         0,
  473.         guiBuffer);
  474.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  475.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  476. }
  477. /*****************************************************************************
  478.  * FUNCTION
  479.  *  mmi_fng_no_support_java
  480.  * DESCRIPTION
  481.  *  FunAndGame intilize funtion for each app and hilite hdlr
  482.  * PARAMETERS
  483.  *  void
  484.  * RETURNS
  485.  *  void
  486.  *****************************************************************************/
  487. #if !defined(__J2ME__)
  488. #if !defined(__MTK_TARGET__)
  489. void mmi_fng_no_support_java(void)
  490. {
  491.     /*----------------------------------------------------------------*/
  492.     /* Local Variables                                                */
  493.     /*----------------------------------------------------------------*/
  494.     /*----------------------------------------------------------------*/
  495.     /* Code Body                                                      */
  496.     /*----------------------------------------------------------------*/
  497.     SetLeftSoftkeyFunction(PopupNoSupport, KEY_EVENT_UP);
  498.     SetKeyHandler(PopupNoSupport, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  499. }
  500. #endif /* !defined(__MTK_TARGET__) */ 
  501. #endif /* !defined(__J2ME__) */ 
  502. /*****************************************************************************
  503.  * FUNCTION
  504.  *  mmi_fng_no_support_eureka
  505.  * DESCRIPTION
  506.  *  FunAndGame intilize funtion for each app and hilite hdlr
  507.  * PARAMETERS
  508.  *  void
  509.  * RETURNS
  510.  *  void
  511.  *****************************************************************************/
  512. #if !defined(__MTK_TARGET__)
  513. void mmi_fng_no_support_eureka(void)
  514. {
  515.     /*----------------------------------------------------------------*/
  516.     /* Local Variables                                                */
  517.     /*----------------------------------------------------------------*/
  518.     /*----------------------------------------------------------------*/
  519.     /* Code Body                                                      */
  520.     /*----------------------------------------------------------------*/
  521.     SetLeftSoftkeyFunction(PopupNoSupport, KEY_EVENT_UP);
  522.     SetKeyHandler(PopupNoSupport, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  523. }
  524. #endif /* !defined(__MTK_TARGET__) */ 
  525. //KP Jerry add on 2007-4-6 start
  526. #if defined(__GAME_SIMU__)
  527. extern void mmi_gamesimu_highlight_app(void);
  528. #endif
  529. //KP Jerry add on 2007-4-6 end
  530. /*****************************************************************************
  531.  * FUNCTION
  532.  *  mmi_fng_init_app
  533.  * DESCRIPTION
  534.  *  
  535.  * PARAMETERS
  536.  *  void
  537.  * RETURNS
  538.  *  void
  539.  *****************************************************************************/
  540. void mmi_fng_init_app(void)
  541. {
  542.     /*----------------------------------------------------------------*/
  543.     /* Local Variables                                                */
  544.     /*----------------------------------------------------------------*/
  545.     /*----------------------------------------------------------------*/
  546.     /* Code Body                                                      */
  547.     /*----------------------------------------------------------------*/
  548. #if defined(__MMI_VOICE_MEMO__)
  549.     InitVoiceMemoApp();
  550. #endif 
  551. #if defined(__MMI_GAME__)
  552.     SetHiliteHandler(MENU3105_GAMES, mmi_game_highlight_app);
  553. #endif 
  554. #if defined(__MMI_3D_GAME__)
  555.     SetHiliteHandler(MENU_ID_FNG_3D_GAME, mmi_game3d_highlight_app);
  556. #endif 
  557. //KP Jerry add on 2007-4-6 start
  558. #if defined(__GAME_SIMU__)
  559.     SetHiliteHandler(MENU_ID_GAME_SIMU, mmi_gamesimu_highlight_app);
  560.     InitGameSimuEntryListApp();
  561. #endif
  562. //KP Jerry add on 2007-4-6 end
  563. #if defined(__MMI_MOTION_APP__)
  564.     SetHiliteHandler(MENU_ID_MOTION_APP, mmi_motion_highlight_app);
  565.     mmi_motion_init();
  566. #endif /* defined(__MMI_MOTION_APP__) */ /* __MMI_GAME__ */
  567. #if defined(__MMI_AUDIO_PLAYER__)
  568.     InitAudioPlayerApp();
  569. #endif 
  570. #if defined( __MMI_BARCODEREADER__)
  571.     mmi_barcodereader_init_app();
  572. #endif /* __MMI_BARCODEREADER__ */
  573. #ifdef __MMI_AB_REPEATER__
  574.     InitABRepeaterApp();
  575. #endif 
  576. #if defined(__MMI_CAMERA__)
  577.     mmi_camera_init_app();
  578. #endif 
  579. #if defined(__MMI_IMAGE_VIEWER__)
  580.     mmi_imgview_init_app();
  581. #endif 
  582. #if defined(__MMI_VIDEO_PLAYER__)
  583.     mmi_vdoply_init_app();
  584. #endif 
  585. #if defined(__MMI_VIDEO_RECORDER__)
  586.     mmi_vdorec_init_app();
  587. #endif 
  588. #if defined(__MMI_PHOTOEDITOR__)
  589.     mmi_phoedt_init_app();
  590. #endif 
  591.     /* [Tim][FM Radio] begin */
  592. #ifdef __MMI_FM_RADIO__
  593.     mmi_fmrdo_init_app();
  594. #endif 
  595.     /* [Tim][FM Radio] end */
  596. #if defined(__MMI_PICTURE_EDITOR_SUPPORT__)
  597.     SetHiliteHandler(MENU_PICTURE_EDITOR, Highlight_MENU_PICTURE_EDITOR);
  598.     InitPictureEditor();
  599. #endif /* defined(__MMI_PICTURE_EDITOR_SUPPORT__) */
  600. #if defined(__J2ME__)
  601.     SetHiliteHandler(MENU3108_JAVA, mmi_java_highlight_menu);
  602.     SetHiliteHandler(MENU_ID_FNG_SETTING_JAVA, mmi_fng_highlight_setting_java);
  603.     InitJAVA();
  604.     #ifdef OGDR_SECURITY_SETTING
  605.     SetHiliteHandler(MENU_ID_FNG_SECURITY_JAVA, mmi_fng_highlight_security_java);
  606.     #endif
  607.     #ifdef __SUPPORT_INFUSIO__
  608.     SetHiliteHandler(MENU_ID_FNG_JAVA_EUREKA, mmi_java_highlight_eureka);
  609.     #endif
  610. #elif !defined(__MTK_TARGET__) /* for PC simulator */
  611.     SetHiliteHandler(MENU3108_JAVA, mmi_fng_no_support_java);
  612.     SetHiliteHandler(MENU_ID_FNG_SETTING_JAVA, mmi_fng_no_support_java);
  613.     #ifdef OGDR_SECURITY_SETTING
  614.     SetHiliteHandler(MENU_ID_FNG_SECURITY_JAVA, mmi_fng_no_support_java);
  615.     #endif
  616.     #ifdef __SUPPORT_INFUSIO__
  617.     SetHiliteHandler(MENU_ID_FNG_JAVA_EUREKA, mmi_fng_no_support_eureka);
  618.     #endif
  619. #endif 
  620. }
  621. #if defined(__J2ME__)
  622. /*****************************************************************************
  623.  * FUNCTION
  624.  *  mmi_fng_setting_java_done_hdlr
  625.  * DESCRIPTION
  626.  *  done hdlr for java setting
  627.  * PARAMETERS
  628.  *  void
  629.  * RETURNS
  630.  *  void
  631.  *****************************************************************************/
  632. void mmi_fng_setting_java_done_hdlr(void)
  633. {
  634.     /*----------------------------------------------------------------*/
  635.     /* Local Variables                                                */
  636.     /*----------------------------------------------------------------*/
  637.     /*----------------------------------------------------------------*/
  638.     /* Code Body                                                      */
  639.     /*----------------------------------------------------------------*/
  640.     /* java effect */
  641.     g_mmi_java_aud_volume_level = g_fng_cntx.setting_inline.java_aud_selected;
  642.     g_mmi_java_is_vib_on = g_fng_cntx.setting_inline.java_vib_selected;
  643. #ifdef __MMI_FOURWAYS_KEY_DISABLE__
  644.     g_mmi_java_vk_permission = g_fng_cntx.setting_inline.java_vk_permission_selected;
  645. #endif 
  646.     g_mmi_java_wap_prof_id = g_fng_cntx.setting_inline.java_prof_id[g_fng_cntx.setting_inline.java_prof_selected];
  647.     mmi_java_store_setting();
  648.     DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  649.     DeleteNHistory(1);
  650. }
  651. /*****************************************************************************
  652.  * FUNCTION
  653.  *  mmi_fng_setting_java_highlight_hdlr
  654.  * DESCRIPTION
  655.  *  highlight hdlr
  656.  * PARAMETERS
  657.  *  index       [IN]        
  658.  * RETURNS
  659.  *  void
  660.  *****************************************************************************/
  661. void mmi_fng_highlight_setting_java_item(S32 index)
  662. {
  663.     /*----------------------------------------------------------------*/
  664.     /* Local Variables                                                */
  665.     /*----------------------------------------------------------------*/
  666.     /*----------------------------------------------------------------*/
  667.     /* Code Body                                                      */
  668.     /*----------------------------------------------------------------*/
  669.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  670.     SetCategory57LeftSoftkeyFunction(mmi_fng_setting_java_done_hdlr);
  671. }
  672. /*****************************************************************************
  673.  * FUNCTION
  674.  *  mmi_fng_exit_setting_java_screen
  675.  * DESCRIPTION
  676.  *  exit point for java setting screen
  677.  * PARAMETERS
  678.  *  void
  679.  *  viud(?)     [IN]        
  680.  * RETURNS
  681.  *  void
  682.  *****************************************************************************/
  683. void mmi_fng_exit_setting_java_screen(void)
  684. {
  685.     /*----------------------------------------------------------------*/
  686.     /* Local Variables                                                */
  687.     /*----------------------------------------------------------------*/
  688.     U16 inputBufferSize;
  689.     history h;
  690.     S16 nHistory = 0;
  691.     /*----------------------------------------------------------------*/
  692.     /* Code Body                                                      */
  693.     /*----------------------------------------------------------------*/
  694.     h.scrnID = SCR_ID_FNG_SETTING_JAVA;
  695.     CloseCategory57Screen();
  696.     h.entryFuncPtr = mmi_fng_real_entry_setting_java_screen;
  697.     pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
  698.     GetCategory57History(h.guiBuffer);
  699.     inputBufferSize = (U16) GetCategory57DataSize();
  700.     GetCategory57Data((U8*) h.inputBuffer);
  701.     AddNHistory(h, inputBufferSize);
  702. }
  703. /*****************************************************************************
  704.  * FUNCTION
  705.  *  mmi_fng_recv_wap_prof_list_rsp
  706.  * DESCRIPTION
  707.  *  response handler of recv_wap_prof_list_req
  708.  * PARAMETERS
  709.  *  MSG     [IN]        
  710.  * RETURNS
  711.  *  void
  712.  *****************************************************************************/
  713. void mmi_fng_recv_wap_prof_list_rsp(void *MSG)
  714. {
  715.     /*----------------------------------------------------------------*/
  716.     /* Local Variables                                                */
  717.     /*----------------------------------------------------------------*/
  718.     S32 i;
  719.     wap_get_prof_list_rsp_struct *msg = (wap_get_prof_list_rsp_struct*) MSG;
  720.     /*----------------------------------------------------------------*/
  721.     /* Code Body                                                      */
  722.     /*----------------------------------------------------------------*/
  723.     if (!mmi_java_is_no_sim() && msg->result != WAP_PROF_SUCCESS)
  724.     {
  725.         mmi_java_display_is_busy();
  726.         return;
  727.     }
  728.     g_fng_cntx.setting_inline.java_prof_sum = msg->number+1;
  729.     /* the first item is "Default" */
  730.     UCS2Strcpy((S8*)g_fng_cntx.setting_inline.java_prof_strs[0], GetString(STR_JAVA_NETWORK_SETTING_DEFAULT));
  731.     g_fng_cntx.setting_inline.java_prof_str[0] = g_fng_cntx.setting_inline.java_prof_strs[0];
  732.     g_fng_cntx.setting_inline.java_prof_id[0] = 0xFF;
  733.     /* real profiles start from second item */
  734.     for (i = 0; i < g_fng_cntx.setting_inline.java_prof_sum && i < MAX_WAP_PROF_SUM; i++)
  735.     {
  736.         memcpy(g_fng_cntx.setting_inline.java_prof_strs[i+1], msg->prof_list[i].name.value, msg->prof_list[i].name.len);
  737.         g_fng_cntx.setting_inline.java_prof_strs[i+1][msg->prof_list[i].name.len / 2] = L'';
  738.         g_fng_cntx.setting_inline.java_prof_str[i+1] = g_fng_cntx.setting_inline.java_prof_strs[i+1];
  739.         g_fng_cntx.setting_inline.java_prof_id[i+1] = msg->prof_list[i].id;
  740.     }
  741.     if (msg->prof_list)
  742.     {
  743.         OslMfree(msg->prof_list);
  744.     }
  745.     mmi_fng_real_entry_setting_java_screen();
  746. }
  747. /*****************************************************************************
  748.  * FUNCTION
  749.  *  mmi_fng_entry_setting_java_screen
  750.  * DESCRIPTION
  751.  *  entry point for java setting screen
  752.  * PARAMETERS
  753.  *  void
  754.  * RETURNS
  755.  *  void
  756.  *****************************************************************************/
  757. void mmi_fng_entry_setting_java_screen(void)
  758. {
  759.     /*----------------------------------------------------------------*/
  760.     /* Local Variables                                                */
  761.     /*----------------------------------------------------------------*/
  762.     MYQUEUE Message;
  763.     /*----------------------------------------------------------------*/
  764.     /* Code Body                                                      */
  765.     /*----------------------------------------------------------------*/
  766.     SetProtocolEventHandler(mmi_fng_recv_wap_prof_list_rsp, MSG_ID_WAP_GET_PROF_LIST_RSP);
  767.     Message.oslSrcId = MOD_MMI;
  768.     Message.oslDestId = MOD_WAP;
  769.     Message.oslMsgId = MSG_ID_WAP_GET_PROF_LIST_REQ;
  770.     Message.oslDataPtr = (local_para_struct*) NULL;
  771.     Message.oslPeerBuffPtr = NULL;
  772.     OslMsgSendExtQueue(&Message);
  773. }
  774. /*****************************************************************************
  775.  * FUNCTION
  776.  *  mmi_fng_real_entry_setting_java_screen
  777.  * DESCRIPTION
  778.  *  real entry point for java setting screen
  779.  * PARAMETERS
  780.  *  void
  781.  * RETURNS
  782.  *  void
  783.  *****************************************************************************/
  784. void mmi_fng_real_entry_setting_java_screen(void)
  785. {
  786.     /*----------------------------------------------------------------*/
  787.     /* Local Variables                                                */
  788.     /*----------------------------------------------------------------*/
  789.     U8 *guiBuffer;
  790.     U8 *inputBuffer;
  791.     U16 inputBufferSize;
  792.     S32 item_offset = 0;
  793.     S8 javaTempString[2][MAX_MEMORY_SIZE];
  794.     MMI_ID_TYPE item_icons[] = 
  795.     {
  796.         IMG_ID_FNG_SETTING_JAVA_AUD,
  797.         0,
  798.         IMG_ID_FNG_SETTING_JAVA_VIB,
  799.         0,
  800.     #ifdef __MMI_FOURWAYS_KEY_DISABLE__
  801.         IMG_ID_FNG_SETTING_JAVA_VK,
  802.         0,
  803.     #endif /* __MMI_FOURWAYS_KEY_DISABLE__ */ 
  804. //KP Jerry disable on 2007-1-30 start
  805. /*
  806. IMG_ID_FNG_SETTING_JAVA_PROF_ID,
  807. 0,
  808. */
  809. //KP Jerry disable on 2007-1-30 end
  810.     #ifdef JAVA_SETTING_SHOW_FREE_STORAGE
  811.         IMG_ID_FNG_SETTING_JAVA_STORAGE,
  812.         0,
  813.     #endif
  814.         IMG_ID_FNG_SETTING_JAVA_HEAP,
  815.         0,
  816.     #ifdef __SUPPORT_INFUSIO__
  817.         IMG_ID_FNG_JAVA_EUREKA,
  818.         0,
  819.     #endif /* __SUPPORT_INFUSIO__ */
  820.     };
  821.     /*----------------------------------------------------------------*/
  822.     /* Code Body                                                      */
  823.     /*----------------------------------------------------------------*/
  824.     if (mmi_java_check_and_display_is_busy())
  825.     {
  826.         return;
  827.     }
  828.     EntryNewScreen(SCR_ID_FNG_SETTING_JAVA, mmi_fng_exit_setting_java_screen, NULL, NULL);
  829.    /***************************************************************************** 
  830.    * JAVA  
  831.    *****************************************************************************/
  832.     /* JAVA TODO: Set value here */
  833.     g_fng_cntx.setting_inline.java_aud_selected = g_mmi_java_aud_volume_level;
  834.     g_fng_cntx.setting_inline.java_vib_selected = g_mmi_java_is_vib_on;
  835. #ifdef __MMI_FOURWAYS_KEY_DISABLE__
  836.     g_fng_cntx.setting_inline.java_vk_permission_selected = g_mmi_java_vk_permission;
  837. #endif 
  838.     if( g_mmi_java_wap_prof_id == 0xFF) /* default */
  839.         g_fng_cntx.setting_inline.java_prof_selected = 0;
  840.     else
  841.         g_fng_cntx.setting_inline.java_prof_selected = g_mmi_java_wap_prof_id+1;
  842. #ifdef JAVA_SETTING_SHOW_FREE_STORAGE
  843.     g_fng_cntx.setting_inline.java_storage_selected = 0;
  844. #endif
  845.     g_fng_cntx.setting_inline.java_heap_selected = 0;
  846.     g_fng_cntx.setting_inline.java_aud_str[0] = (UI_string_type) GetString((U16) (STR_GLOBAL_OFF));
  847.     g_fng_cntx.setting_inline.java_aud_str[1] = (UI_string_type) L"1";
  848.     g_fng_cntx.setting_inline.java_aud_str[2] = (UI_string_type) L"2";
  849.     g_fng_cntx.setting_inline.java_aud_str[3] = (UI_string_type) L"3";
  850.     g_fng_cntx.setting_inline.java_aud_str[4] = (UI_string_type) L"4";
  851.     g_fng_cntx.setting_inline.java_aud_str[5] = (UI_string_type) L"5";
  852.     g_fng_cntx.setting_inline.java_aud_str[6] = (UI_string_type) L"6";
  853.     g_fng_cntx.setting_inline.java_vib_str[0] = (UI_string_type) GetString((U16) (STR_GLOBAL_OFF));
  854.     g_fng_cntx.setting_inline.java_vib_str[1] = (UI_string_type) GetString((U16) (STR_GLOBAL_ON));
  855. #ifdef __MMI_FOURWAYS_KEY_DISABLE__
  856.     g_fng_cntx.setting_inline.java_vk_permission_str[0] = (UI_string_type) GetString((U16) STR_JAVA_PERM_BLANKET);
  857.     g_fng_cntx.setting_inline.java_vk_permission_str[1] = (UI_string_type) GetString((U16) STR_JAVA_PERM_ONESHOT);
  858.     g_fng_cntx.setting_inline.java_vk_permission_str[2] = (UI_string_type) GetString((U16) STR_JAVA_PERM_USERDENY);
  859. #endif /* __MMI_FOURWAYS_KEY_DISABLE__ */ 
  860. #ifdef JAVA_SETTING_SHOW_FREE_STORAGE
  861.     memset(javaTempString[0], 0, sizeof(javaTempString[0]));
  862.     sprintf(javaTempString[0], "%8u ", get_mids_avail_storage());
  863.     AnsiiToUnicodeString((S8*) g_fng_cntx.setting_inline.java_storage_strs[0], (S8*) javaTempString[0]);
  864.     UCS2Strcpy((S8*) g_fng_cntx.setting_inline.java_storage_strs[0] + 18, GetString((U16) STR_JAVA_INFO_BYTE));
  865.     g_fng_cntx.setting_inline.java_storage_str[0] = g_fng_cntx.setting_inline.java_storage_strs[0];
  866. #endif
  867.     memset(javaTempString[1], 0, sizeof(javaTempString[1]));
  868.     sprintf(javaTempString[1], "%8u ", jvm_get_heap_size());
  869.     AnsiiToUnicodeString((S8*) g_fng_cntx.setting_inline.java_heap_strs[0], (S8*) javaTempString[1]);
  870.     UCS2Strcpy((S8*) g_fng_cntx.setting_inline.java_heap_strs[0] + 18, GetString((U16) STR_JAVA_INFO_BYTE));
  871.     g_fng_cntx.setting_inline.java_heap_str[0] = g_fng_cntx.setting_inline.java_heap_strs[0];
  872.     memset(
  873.         (void*)g_fng_cntx.setting_inline.inline_java_items,
  874.         0,
  875.         sizeof(InlineItem) * FNG_SETTING_JAVA_ITEM_COUNT * 2);
  876.     InitializeCategory57Screen();
  877.     /* java audio */
  878.     SetInlineItemCaption(
  879.         &g_fng_cntx.setting_inline.inline_java_items[item_offset++],
  880.         (PU8) GetString((U16) (STR_ID_FNG_SETTING_JAVA_AUD)));
  881.     SetInlineItemActivation(
  882.         &g_fng_cntx.setting_inline.inline_java_items[item_offset],
  883.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  884.         0);
  885.     SetInlineItemSelect(
  886.         &g_fng_cntx.setting_inline.inline_java_items[item_offset++],
  887.         7,
  888.         (U8 **) g_fng_cntx.setting_inline.java_aud_str,
  889.         &g_fng_cntx.setting_inline.java_aud_selected);
  890.     /* java vibration */
  891.     SetInlineItemCaption(
  892.         &g_fng_cntx.setting_inline.inline_java_items[item_offset++],
  893.         (PU8) GetString((U16) (STR_ID_FNG_SETTING_JAVA_VIB)));
  894.     SetInlineItemActivation(
  895.         &g_fng_cntx.setting_inline.inline_java_items[item_offset],
  896.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  897.         0);
  898.     SetInlineItemSelect(
  899.         &g_fng_cntx.setting_inline.inline_java_items[item_offset++],
  900.         2,
  901.         (U8 **) g_fng_cntx.setting_inline.java_vib_str,
  902.         &g_fng_cntx.setting_inline.java_vib_selected);
  903. #ifdef __MMI_FOURWAYS_KEY_DISABLE__
  904.     /* java vk permission */
  905.     SetInlineItemCaption(
  906.         &g_fng_cntx.setting_inline.inline_java_items[item_offset++],
  907.         (PU8) GetString((U16) (STR_ID_FNG_SETTING_JAVA_VK)));
  908.     SetInlineItemActivation(
  909.         &g_fng_cntx.setting_inline.inline_java_items[item_offset],
  910.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  911.         0);
  912.     SetInlineItemSelect(
  913.         &g_fng_cntx.setting_inline.inline_java_items[item_offset++],
  914.         3,
  915.         (U8 **) g_fng_cntx.setting_inline.java_vk_permission_str,
  916.         &g_fng_cntx.setting_inline.java_vk_permission_selected);
  917. #endif /* __MMI_FOURWAYS_KEY_DISABLE__ */ 
  918.     /* java prof */
  919.     if (!mmi_java_is_no_sim())
  920.     {
  921.         SetInlineItemCaption(
  922.             &g_fng_cntx.setting_inline.inline_java_items[item_offset++],
  923.             (PU8) GetString((U16) (STR_ID_FNG_SETTING_JAVA_PROF_ID)));
  924.         SetInlineItemActivation(
  925.             &g_fng_cntx.setting_inline.inline_java_items[item_offset],
  926.             INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  927.             0);
  928.         SetInlineItemSelect(
  929.             &g_fng_cntx.setting_inline.inline_java_items[item_offset++],
  930.             g_fng_cntx.setting_inline.java_prof_sum,
  931.             (U8 **) g_fng_cntx.setting_inline.java_prof_str,
  932.             &g_fng_cntx.setting_inline.java_prof_selected);
  933.     }
  934. #ifdef JAVA_SETTING_SHOW_FREE_STORAGE
  935.     /* java storage */
  936.     SetInlineItemCaption(
  937.         &g_fng_cntx.setting_inline.inline_java_items[item_offset++],
  938.         (PU8) GetString((U16) (STR_ID_FNG_SETTING_JAVA_STORAGE)));
  939.     SetInlineItemActivation(
  940.         &g_fng_cntx.setting_inline.inline_java_items[item_offset],
  941.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  942.         0);
  943.     SetInlineItemDisplayOnly(
  944.         &g_fng_cntx.setting_inline.inline_java_items[item_offset++],
  945.         (U8*) g_fng_cntx.setting_inline.java_storage_str[0]);
  946. #endif
  947.     /* java heap */
  948.     SetInlineItemCaption(
  949.         &g_fng_cntx.setting_inline.inline_java_items[item_offset++],
  950.         (PU8) GetString((U16) (STR_ID_FNG_SETTING_JAVA_HEAP)));
  951.     SetInlineItemActivation(
  952.         &g_fng_cntx.setting_inline.inline_java_items[item_offset],
  953.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  954.         0);
  955.     SetInlineItemDisplayOnly(
  956.         &g_fng_cntx.setting_inline.inline_java_items[item_offset++],
  957.         (U8*) g_fng_cntx.setting_inline.java_heap_str[0]);
  958.     guiBuffer = GetCurrGuiBuffer(SCR_ID_FNG_SETTING_JAVA);
  959.     inputBuffer = GetCurrNInputBuffer(SCR_ID_FNG_SETTING_JAVA, &inputBufferSize);
  960.     if (inputBuffer != NULL)
  961.     {
  962.         SetCategory57Data(g_fng_cntx.setting_inline.inline_java_items, FNG_SETTING_JAVA_ITEM_COUNT * 2, inputBuffer);
  963.     }
  964.     RegisterHighlightHandler(mmi_fng_highlight_setting_java_item);
  965.     /* show category */
  966.     ShowCategory57Screen(
  967.         STR_ID_FNG_SETTING_JAVA,
  968.         MAIN_MENU_TITLE_FUNANDGAMES_ICON,
  969.         STR_GLOBAL_OK,
  970.         IMG_GLOBAL_OK,
  971.         STR_GLOBAL_BACK,
  972.         IMG_GLOBAL_BACK,
  973.         item_offset,
  974.         item_icons,
  975.         g_fng_cntx.setting_inline.inline_java_items,
  976.         0,
  977.         guiBuffer);
  978.     /* set key hdlr */
  979.     SetCategory57LeftSoftkeyFunction(mmi_fng_setting_java_done_hdlr);
  980.     SetCategory57RightSoftkeyFunctions(GoBackHistory, GoBackHistory);
  981.     DisableCategory57ScreenDone();
  982. }
  983. /*****************************************************************************
  984.  * FUNCTION
  985.  *  mmi_fng_highlight_setting_java
  986.  * DESCRIPTION
  987.  *  highlight java setting
  988.  * PARAMETERS
  989.  *  void
  990.  * RETURNS
  991.  *  void
  992.  *****************************************************************************/
  993. void mmi_fng_highlight_setting_java(void)
  994. {
  995.     /*----------------------------------------------------------------*/
  996.     /* Local Variables                                                */
  997.     /*----------------------------------------------------------------*/
  998.     /*----------------------------------------------------------------*/
  999.     /* Code Body                                                      */
  1000.     /*----------------------------------------------------------------*/
  1001.     SetLeftSoftkeyFunction(mmi_fng_entry_setting_java_screen, KEY_EVENT_UP);
  1002.     SetKeyHandler(mmi_fng_entry_setting_java_screen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1003. }
  1004. #ifdef OGDR_SECURITY_SETTING
  1005. /*****************************************************************************
  1006.  * FUNCTION
  1007.  *
  1008.  * DESCRIPTION
  1009.  *
  1010.  * PARAMETERS
  1011.  *
  1012.  * RETURNS
  1013.  *
  1014.  *****************************************************************************/
  1015. void mmi_fng_recv_reset_default_setting_cnf(void *MsgStruct)
  1016. {
  1017.     /*----------------------------------------------------------------*/
  1018.     /* Local Variables                                                */
  1019.     /*----------------------------------------------------------------*/
  1020. S32 i;
  1021.     mmi_java_reset_default_domain_cnf_struct *msg;
  1022.     /*----------------------------------------------------------------*/
  1023.     /* Code Body                                                      */
  1024.     /*----------------------------------------------------------------*/
  1025.     msg = (mmi_java_reset_default_domain_cnf_struct *) MsgStruct;
  1026.     if (msg->error_code != J2ME_NO_ERROR)
  1027.     {
  1028.         mmi_java_display_is_busy();
  1029.         return;
  1030.     }
  1031.     else
  1032.     {
  1033.         DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  1034.     }
  1035. }
  1036. /*****************************************************************************
  1037.  * FUNCTION
  1038.  *  mmi_fng_send_get_domain_list_req
  1039.  * DESCRIPTION
  1040.  *  Get Java Domain List
  1041.  * PARAMETERS
  1042.  *  void
  1043.  * RETURNS
  1044.  *  void
  1045.  *****************************************************************************/
  1046. void mmi_fng_send_reset_default_setting_req(void)
  1047. {
  1048.     /*----------------------------------------------------------------*/
  1049.     /* Local Variables                                                */
  1050.     /*----------------------------------------------------------------*/
  1051.     MYQUEUE Message;
  1052.     mmi_java_reset_default_domain_req_struct *msg;
  1053.     /*----------------------------------------------------------------*/
  1054.     /* Code Body                                                      */
  1055.     /*----------------------------------------------------------------*/
  1056.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1057.     msg = (mmi_java_reset_default_domain_req_struct*) OslConstructDataPtr(sizeof(mmi_java_reset_default_domain_req_struct));
  1058.     msg->type = GAMETYPE_JAVA_GAME;
  1059.     Message.oslSrcId = MOD_MMI;
  1060.     Message.oslDestId = MOD_J2ME;
  1061.     Message.oslMsgId = MSG_ID_MMI_JAVA_RESET_DEFAULT_DOMAIN_REQ;
  1062.     Message.oslDataPtr = (local_para_struct*) msg;
  1063.     Message.oslPeerBuffPtr = NULL;
  1064.     OslMsgSendExtQueue(&Message);
  1065. }
  1066. /*****************************************************************************
  1067.  * FUNCTION
  1068.  *
  1069.  * DESCRIPTION
  1070.  *
  1071.  * PARAMETERS
  1072.  *
  1073.  * RETURNS
  1074.  *
  1075.  *****************************************************************************/
  1076. void mmi_fng_recv_get_domain_list_cnf(void *MsgStruct)
  1077. {
  1078.     /*----------------------------------------------------------------*/
  1079.     /* Local Variables                                                */
  1080.     /*----------------------------------------------------------------*/
  1081. S32 i;
  1082.     mmi_java_get_domain_list_cnf_struct *msg;
  1083.     /*----------------------------------------------------------------*/
  1084.     /* Code Body                                                      */
  1085.     /*----------------------------------------------------------------*/
  1086.     msg = (mmi_java_get_domain_list_cnf_struct *) MsgStruct;
  1087.     if (msg->error_code != J2ME_NO_ERROR)
  1088.     {
  1089.         DisplayPopup(
  1090.             (PU8) GetString(STR_JAVA_ERROR_CODE_UNKNOWN_FAILURE),
  1091.             IMG_JAVA_POWERED,
  1092.             1,
  1093.             UI_POPUP_NOTIFYDURATION_TIME,
  1094.             ERROR_TONE);
  1095.         return;
  1096.     }
  1097.     ASSERT(msg->total_domain < 10 && msg->total_domain > 0);
  1098.     g_fng_cntx.total_domain = msg->total_domain;
  1099.     for(i = 0 ;i < g_fng_cntx.total_domain ;i ++)
  1100.     {
  1101.         UCS2Strcpy( (S8*) g_fng_cntx.domains[i], (S8*) msg->domains[i] );
  1102.     }
  1103.     mmi_fng_real_entry_security_java();
  1104. }
  1105. /*****************************************************************************
  1106.  * FUNCTION
  1107.  *  mmi_fng_send_get_domain_list_req
  1108.  * DESCRIPTION
  1109.  *  Get Java Domain List
  1110.  * PARAMETERS
  1111.  *  void
  1112.  * RETURNS
  1113.  *  void
  1114.  *****************************************************************************/
  1115. void mmi_fng_send_get_domain_list_req(void)
  1116. {
  1117.     /*----------------------------------------------------------------*/
  1118.     /* Local Variables                                                */
  1119.     /*----------------------------------------------------------------*/
  1120.     MYQUEUE Message;
  1121.     mmi_java_get_domain_list_req_struct *msg;
  1122.     /*----------------------------------------------------------------*/
  1123.     /* Code Body                                                      */
  1124.     /*----------------------------------------------------------------*/
  1125.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1126.     msg = (mmi_java_get_domain_list_req_struct*) OslConstructDataPtr(sizeof(mmi_java_get_domain_list_req_struct));
  1127.     msg->type = GAMETYPE_JAVA_GAME;
  1128.     Message.oslSrcId = MOD_MMI;
  1129.     Message.oslDestId = MOD_J2ME;
  1130.     Message.oslMsgId = MSG_ID_MMI_JAVA_GET_DOMAIN_LIST_REQ;
  1131.     Message.oslDataPtr = (local_para_struct*) msg;
  1132.     Message.oslPeerBuffPtr = NULL;
  1133.     OslMsgSendExtQueue(&Message);
  1134. }
  1135. /*****************************************************************************
  1136.  * FUNCTION
  1137.  *
  1138.  * DESCRIPTION
  1139.  *
  1140.  * PARAMETERS
  1141.  *
  1142.  * RETURNS
  1143.  *  void
  1144.  *****************************************************************************/
  1145. void mmi_fng_security_java_item_lsk_hdlr(void)
  1146. {
  1147.     /*----------------------------------------------------------------*/
  1148.     /* Local Variables                                                */
  1149.     /*----------------------------------------------------------------*/
  1150.     /*----------------------------------------------------------------*/
  1151.     /* Code Body                                                      */
  1152.     /*----------------------------------------------------------------*/
  1153.     mmi_java_entry_default_domain_setting(g_fng_cntx.domain_selected);
  1154. }
  1155. /*****************************************************************************
  1156.  * FUNCTION
  1157.  *  mmi_fng_highlight_security_java_item
  1158.  * DESCRIPTION
  1159.  *
  1160.  * PARAMETERS
  1161.  *
  1162.  * RETURNS
  1163.  *  void
  1164.  *****************************************************************************/
  1165. void mmi_fng_highlight_security_java_item(S32 index)
  1166. {
  1167.     /*----------------------------------------------------------------*/
  1168.     /* Local Variables                                                */
  1169.     /*----------------------------------------------------------------*/
  1170.     /*----------------------------------------------------------------*/
  1171.     /* Code Body                                                      */
  1172.     /*----------------------------------------------------------------*/
  1173.     g_fng_cntx.domain_selected = index;
  1174.     if( index == g_fng_cntx.total_domain)
  1175.     {
  1176.         SetProtocolEventHandler(mmi_fng_recv_reset_default_setting_cnf, MSG_ID_MMI_JAVA_RESET_DEFAULT_DOMAIN_CNF);
  1177.         SetLeftSoftkeyFunction(mmi_fng_send_reset_default_setting_req, KEY_EVENT_UP);
  1178.     }
  1179.     else
  1180.     {
  1181.         SetLeftSoftkeyFunction(mmi_fng_security_java_item_lsk_hdlr, KEY_EVENT_UP);
  1182.     }
  1183. }
  1184. /*****************************************************************************
  1185.  * FUNCTION
  1186.  *  mmi_fng_entry_setting_java_screen
  1187.  * DESCRIPTION
  1188.  *  entry point for java setting screen
  1189.  * PARAMETERS
  1190.  *  void
  1191.  * RETURNS
  1192.  *  void
  1193.  *****************************************************************************/
  1194. void mmi_fng_entry_secuiry_java(void)
  1195. {
  1196.     /*----------------------------------------------------------------*/
  1197.     /* Local Variables                                                */
  1198.     /*----------------------------------------------------------------*/
  1199.     /*----------------------------------------------------------------*/
  1200.     /* Code Body                                                      */
  1201.     /*----------------------------------------------------------------*/
  1202.     if (mmi_java_check_and_display_is_busy())
  1203.     {
  1204.         return;
  1205.     }
  1206.     SetProtocolEventHandler(mmi_fng_recv_get_domain_list_cnf, MSG_ID_MMI_JAVA_GET_DOMAIN_LIST_CNF);
  1207.     mmi_fng_send_get_domain_list_req();
  1208. }
  1209. /*****************************************************************************
  1210.  * FUNCTION
  1211.  *  mmi_fng_real_entry_security_java_screen
  1212.  * DESCRIPTION
  1213.  *  real entry point for java setting screen
  1214.  * PARAMETERS
  1215.  *  void
  1216.  * RETURNS
  1217.  *  void
  1218.  *****************************************************************************/
  1219. void mmi_fng_real_entry_security_java(void)
  1220. {
  1221.     /*----------------------------------------------------------------*/
  1222.     /* Local Variables                                                */
  1223.     /*----------------------------------------------------------------*/
  1224.     U8 i;
  1225.     U8 *item[MAX_SUB_MENUS];
  1226.     U8 *icon[MAX_SUB_MENUS];
  1227.     U8 *guiBuffer;
  1228.     /*----------------------------------------------------------------*/
  1229.     /* Code Body                                                      */
  1230.     /*----------------------------------------------------------------*/
  1231.     UCS2Strcpy( (S8*) g_fng_cntx.domains[g_fng_cntx.total_domain],
  1232.         (S8*) GetString(STR_ID_FNG_SECURITY_JAVA_RESTORE));
  1233.     for (i = 0; i < g_fng_cntx.total_domain +1; i++)
  1234.     {
  1235.         item[i] = (PU8) g_fng_cntx.domains[i];
  1236.         icon[i] = (PU8) GetImage(gIndexIconsImageList[i]);
  1237.     }
  1238.     guiBuffer = GetCurrGuiBuffer(SCR_ID_FNG_SECURITY_JAVA);
  1239.     EntryNewScreen(SCR_ID_FNG_SECURITY_JAVA, NULL, mmi_fng_real_entry_security_java, NULL);
  1240.     RegisterHighlightHandler(mmi_fng_highlight_security_java_item);
  1241.     ShowCategory170Screen(
  1242.         (PU8) GetString(STR_JAVA_APP_OPTION_SELECT),
  1243.         (PU8) GetImage(MAIN_MENU_TITLE_FUNANDGAMES_ICON),
  1244.         (PU8) GetString(STR_GLOBAL_OK),
  1245.         (PU8) GetImage(IMG_GLOBAL_OK),
  1246.         (PU8) GetString(STR_GLOBAL_BACK),
  1247.         (PU8) GetImage(IMG_GLOBAL_BACK),
  1248.         g_fng_cntx.total_domain + 1 ,
  1249.         item,
  1250.         icon,
  1251.         0,
  1252.         0,
  1253.         guiBuffer);
  1254.     SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_UP);
  1255.     SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1256.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1257.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1258. }
  1259. /*****************************************************************************
  1260.  * FUNCTION
  1261.  *  mmi_fng_highlight_security_java
  1262.  * DESCRIPTION
  1263.  *  highlight java security
  1264.  * PARAMETERS
  1265.  *  void
  1266.  * RETURNS
  1267.  *  void
  1268.  *****************************************************************************/
  1269. void mmi_fng_highlight_security_java(void)
  1270. {
  1271.     /*----------------------------------------------------------------*/
  1272.     /* Local Variables                                                */
  1273.     /*----------------------------------------------------------------*/
  1274.     /*----------------------------------------------------------------*/
  1275.     /* Code Body                                                      */
  1276.     /*----------------------------------------------------------------*/
  1277.     SetLeftSoftkeyFunction(mmi_fng_entry_secuiry_java, KEY_EVENT_UP);
  1278.     SetKeyHandler(mmi_fng_entry_secuiry_java, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1279. }
  1280. #endif
  1281. #endif /* __J2ME__ */
  1282. /* NOTICE */
  1283. /* THIS FUNCTION should move to picture_editor's source, shall not put here */
  1284. /*****************************************************************************
  1285.  * FUNCTION
  1286.  *  Highlight_MENU_PICTURE_EDITOR
  1287.  * DESCRIPTION
  1288.  *  highlight picture editor
  1289.  * PARAMETERS
  1290.  *  void
  1291.  * RETURNS
  1292.  *  void
  1293.  *****************************************************************************/
  1294. /* Yogesh 01032004:  Added for Image Editor */
  1295. #ifdef __MMI_PICTURE_EDITOR_SUPPORT__
  1296. void Highlight_MENU_PICTURE_EDITOR(void)
  1297. {
  1298.     /*----------------------------------------------------------------*/
  1299.     /* Local Variables                                                */
  1300.     /*----------------------------------------------------------------*/
  1301.     /*----------------------------------------------------------------*/
  1302.     /* Code Body                                                      */
  1303.     /*----------------------------------------------------------------*/
  1304.     SetLeftSoftkeyFunction(EntryScr4PicEditSelectMenu, KEY_EVENT_UP);
  1305.     SetKeyHandler(EntryScr4PicEditSelectMenu, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1306. }
  1307. #endif /* __MMI_PICTURE_EDITOR_SUPPORT__ */ 
  1308. /* End Added Yogesh 01032004 */