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

MTK

开发平台:

C/C++

  1.    ********************************************************************************/
  2.     /* video is successfully opened, create video playback layer */
  3.     if (cat_vdoply_is_video_open)
  4.     {
  5.         /* we need play video on an extra layer, so will use multi-layer */
  6.         gdi_layer_multi_layer_enable();
  7.         gdi_layer_get_base_handle(&wgui_base_layer);
  8.         if (wgui_is_touch_title_bar_buttons())
  9.         {
  10.             gBlack_buf = mmi_frm_scrmem_alloc(BLACK_BUFFER_SIZE);
  11.             if (GDI_LAYER_SUCCEED != dm_create_layer_using_outside_memory(
  12.                                         0,
  13.                                         0,
  14.                                         UI_device_width,
  15.                                         UI_device_height,
  16.                                         &gBlack_layer,
  17.                                         gBlack_buf,
  18.                                         BLACK_BUFFER_SIZE,
  19.                                         DM_LAYER_BOTTOM))
  20.             {
  21.                 MMI_ASSERT(0);
  22.             }
  23.             gdi_layer_push_and_set_active(*gBlack_layer);
  24.             gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
  25.             gdi_layer_clear(GDI_COLOR_BLACK);
  26.             gdi_layer_pop_and_restore_active();
  27.         }
  28.         if ((wgui_video_info.width > content_width) || (wgui_video_info.height > content_height))
  29.         {
  30.             /* video larger than drawable region, need resize */
  31.             /* calc draw size */
  32.             gdi_util_fit_box(
  33.                 GDI_UTIL_MODE_LONG_SIDE_FIT,
  34.                 content_width,
  35.                 content_height,
  36.                 wgui_video_info.width,
  37.                 wgui_video_info.height,
  38.                 &resized_offset_x,
  39.                 &resized_offset_y,
  40.                 &resized_width,
  41.                 &resized_height);
  42.         }
  43.         else
  44.         {
  45.             /* video smaller than content region */
  46.             if (!cat_vdoply_is_full_screen)
  47.             {
  48.                 /* not full screen mode, play default size */
  49.                 resized_offset_x = (content_width - wgui_video_info.width) >> 1;
  50.                 resized_offset_y = (content_height - wgui_video_info.height) >> 1;
  51.                 resized_width = wgui_video_info.width;
  52.                 resized_height = wgui_video_info.height;
  53.             }
  54.             else
  55.             {
  56.                 /* full screen mode, stretch (enlarge) it to fit content region */
  57.                 gdi_util_fit_box(
  58.                     GDI_UTIL_MODE_LONG_SIDE_FIT,
  59.                     content_width,
  60.                     content_height,
  61.                     wgui_video_info.width,
  62.                     wgui_video_info.height,
  63.                     &resized_offset_x,
  64.                     &resized_offset_y,
  65.                     &resized_width,
  66.                     &resized_height);
  67.             }
  68.         }
  69.         /* shift to content position */
  70.         resized_offset_x += content_offset_x;
  71.         resized_offset_y += content_offset_y;
  72.         if (wgui_is_touch_title_bar_buttons())
  73.         {
  74.             dm_create_layer(
  75.                 resized_offset_x,
  76.                 resized_offset_y,
  77.                 resized_width,
  78.                 resized_height,
  79.                 &cat_vdoply_video_layer,
  80.                 DM_LAYER_ACTIVE_TOP);
  81.         }
  82.         else
  83.         {
  84.             dm_create_layer(
  85.                 resized_offset_x,
  86.                 resized_offset_y,
  87.                 resized_width,
  88.                 resized_height,
  89.                 &cat_vdoply_video_layer,
  90.                 DM_LAYER_ACTIVE_BOTTOM);
  91.         }
  92.         /* clear this layer with black */
  93.         gdi_layer_push_and_set_active(cat_vdoply_video_layer);
  94.         gdi_layer_clear(GDI_COLOR_BLACK);
  95.         gdi_layer_pop_and_restore_active();
  96.         /* Get first frame and start to play */
  97.         video_ret = mdi_video_ply_seek_and_get_frame(0, cat_vdoply_video_layer);
  98.         if (video_ret < 0)
  99.         {
  100.             cat_vdoply_is_video_play = FALSE;
  101.         }
  102.         else
  103.         {
  104.             cat_vdoply_is_video_play = TRUE;
  105.         }
  106.         cat_vdoply_is_video_play_result = video_ret;
  107.     }
  108. }
  109. /*****************************************************************************
  110. * [ShowCategoryVdoplyScreen]
  111. *
  112. * Generic video play screen.
  113. *
  114. *  **********************
  115. *  *                    *
  116. *  *                    *
  117. *  *                    *
  118. *  *                    *
  119. *  *                    *
  120. *  * (Fullscreen Video) *
  121. *  *                    *
  122. *  *                    *
  123. *  *                    *
  124. *  *                    *
  125. *  *                    *
  126. *  **********************
  127. *
  128. *  **********************
  129. *  *        Title       *
  130. *  **********************
  131. *  *                    *
  132. *  *                    *
  133. *  *                    *
  134. *  *       (Video)      *
  135. *  *                    *
  136. *  *                    *
  137. *  *                    *
  138. *  ********      ********
  139. *  * LSK  *      *  RSK *
  140. *  **********************
  141. *
  142. *****************************************************************************/
  143. /*****************************************************************************
  144.  * FUNCTION
  145.  *  ShowCategoryVdoplyScreen
  146.  * DESCRIPTION
  147.  *  Show Generic Play Video Category.
  148.  * PARAMETERS
  149.  *  is_fullscreen               [IN]        Is full screen display, if false, will draw title and softkeys
  150.  *  title_str                   [IN]        Title string id
  151.  *  title_icon                  [IN]        Title icon id
  152.  *  lsk_str                     [IN]        Lsk str id
  153.  *  lsk_icon                    [IN]        Lsk icon id
  154.  *  rsk_str                     [IN]        Lsk str id
  155.  *  rsk_icon                    [IN]        Lsk icon id
  156.  *  video_id                    [IN]        Video ID
  157.  *  video_filename              [IN]        Video filename
  158.  *  repeat_count                [IN]        Repeat count, 0 means infinite
  159.  *  is_visual_update            [IN]        Update visual to LCM or not
  160.  *  is_play_audio               [IN]        Play audio or not
  161.  *  is_lcd_no_sleep             [IN]        Will let lcd no sleep. This shall always TRUE unless u will handle lcd sleeping event
  162.  *  bg_color                    [IN]        Backgroud color
  163.  *  play_finish_callback        [IN]        Play finish call back hdlr
  164.  *  gui_buffer                  [IN]        Gui_buffer, use to detemin if it is newly enter
  165.  * RETURNS
  166.  *  void
  167.  *****************************************************************************/
  168. static void ShowCategoryVdoplyScreen(
  169.                 BOOL is_fullscreen,
  170.                 U16 title_str,
  171.                 U16 title_icon,
  172.                 U16 lsk_str,
  173.                 U16 lsk_icon,
  174.                 U16 rsk_str,
  175.                 U16 rsk_icon,
  176.                 U16 video_id,
  177.                 PS8 video_filename,
  178.                 U16 repeat_count,
  179.                 BOOL is_visual_update,
  180.                 BOOL is_play_audio,
  181.                 BOOL is_lcd_no_sleep,
  182.                 GDI_COLOR bg_color,
  183.                 void (*play_finish_callback) (MDI_RESULT),
  184.                 void *gui_buffer)
  185. {
  186.     /*----------------------------------------------------------------*/
  187.     /* Local Variables                                                */
  188.     /*----------------------------------------------------------------*/
  189.     dm_data_struct dm_data;
  190.     U16 btn_prev_item_id, btn_next_item_id;
  191.     S32 content_width, content_height;
  192.     S32 content_offset_x, content_offset_y;
  193.     MDI_RESULT video_ret = 0;
  194.     /*----------------------------------------------------------------*/
  195.     /* Code Body                                                      */
  196.     /*----------------------------------------------------------------*/
  197.     /* enter a sublcd screen with static image */
  198.     /* 
  199.      * this is very important since we cant draw anything on sublcd while video is playing,
  200.      * which will casue driver assert.
  201.      * 
  202.      * caller of this category may ignore sublcd handling, it will be handled in this category 
  203.      */
  204. #ifdef __MMI_SUBLCD__
  205.     if (!cat_vdoply_is_sublcd_display)
  206.     {
  207.         ForceSubLCDScreen(EnterCategoryVdoplySubScreen);
  208.     }
  209. #endif /* __MMI_SUBLCD__ */ 
  210.     /* arg check */
  211.     MMI_ASSERT((video_id == 0 && video_filename != NULL) || (video_id != 0 && video_filename == NULL));
  212.     /* clear keys */
  213.     clear_category_screen_key_handlers();
  214.     clear_key_handlers();
  215.     clear_left_softkey();
  216.     clear_right_softkey();
  217.     /* init var */
  218.     cat_vdoply_is_video_from_id = (video_id != 0) ? TRUE : FALSE;
  219.     cat_vdoply_video_is_visual_update = is_visual_update;
  220.     cat_vdoply_video_is_play_audio = is_play_audio;
  221.     cat_vdoply_video_is_lcd_no_sleep = is_lcd_no_sleep;
  222.     cat_vdoply_play_finish_callback = play_finish_callback;
  223.     /* stop MMI sleep */
  224.     if (cat_vdoply_video_is_lcd_no_sleep)
  225.     {
  226.         TurnOnBacklight(0);
  227.     }
  228.     /* set audio volumn */
  229.     if (gui_buffer == NULL)
  230.     {
  231.         /* first time enter */
  232.         cat_vdoply_audio_volumn = LEVEL5;
  233.     }
  234.     if (cat_vdoply_video_is_play_audio)
  235.     {
  236.         /* full screen play do not allows vol adjustment */
  237.         if (!is_fullscreen)
  238.         {
  239.             SetKeyHandler(CatVdoplyVolUp, KEY_VOL_UP, KEY_EVENT_DOWN);
  240.             SetKeyHandler(CatVdoplyVolDown, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  241.         }
  242.         /* suspend background audio */
  243.         mdi_audio_suspend_background_play();
  244.         
  245.         /* init audio volumn */
  246.         mdi_audio_set_volume(MDI_VOLUME_MEDIA, cat_vdoply_audio_volumn);
  247.     }
  248.     /*
  249.      * user may request to repeat play many times, and wants a callback bewteen each play,
  250.      * so we have to handle repeat play within this category by seeking to first frame 
  251.      * after play finished each time, instead of using driver's repeat play.
  252.      */
  253.     cat_vdoply_video_repeat_count = (repeat_count == 0) ? 0xffff : repeat_count;        /* 0xff means infinte play */
  254.     if (repeat_count != 0)
  255.     {
  256.         cat_vdoply_video_repeat_count--;
  257.     }
  258.    /********************************************************************************
  259.    *  Draw non-full screen UI
  260.    ********************************************************************************/
  261.     if (!is_fullscreen)
  262.     {
  263.         /* not fullscreen, draw title and softkey */
  264.         /* init softkey */
  265.         change_left_softkey(lsk_str, lsk_icon);
  266.         change_right_softkey(rsk_str, rsk_icon);
  267.         register_left_softkey_handler();
  268.         register_right_softkey_handler();
  269.         register_default_hide_softkeys();
  270.         /* init title */
  271.         MMI_title_string = (UI_string_type) get_string(title_str);
  272.         MMI_title_icon = (PU8) get_image(title_icon);
  273.         /* set content size */
  274.         if (wgui_is_touch_title_bar_buttons())
  275.         {
  276.             content_width = UI_device_width;
  277.             content_height = UI_device_height;
  278.             content_offset_x = 0;
  279.             content_offset_y = 0;
  280.             cat_vdoply_is_full_screen = TRUE;
  281.             title_bg_id = IMAGE_VIEW_TITLEBAR_BG;
  282.             wgui_set_wallpaper_on_bottom(MMI_TRUE);
  283.         }
  284.         else
  285.         {
  286.             content_width = MMI_content_width;
  287.             content_height = MMI_content_height;
  288.             content_offset_x = MMI_content_x;
  289.             content_offset_y = MMI_content_y;
  290.             cat_vdoply_is_full_screen = FALSE;
  291.         }
  292.         /* clear shortcut num */
  293.         MMI_menu_shortcut_number = -1;
  294.         /* draw to buffer, but not blt to LCM by using lock */
  295.         gdi_layer_lock_frame_buffer();
  296.         gdi_layer_reset_clip();
  297.         gdi_layer_reset_text_clip();
  298.         /* clear content color */
  299.         if (wgui_is_touch_title_bar_buttons())
  300.         {
  301.             gdi_draw_solid_rect(0, 0, UI_device_width - 1, UI_device_height - 1, GDI_COLOR_TRANSPARENT);
  302.         }
  303.         else
  304.         {
  305.             gdi_draw_solid_rect(
  306.                 MMI_content_x,
  307.                 MMI_content_y,
  308.                 MMI_content_x + MMI_content_width - 1,
  309.                 MMI_content_y + MMI_content_height - 1,
  310.                 GDI_COLOR_WHITE);
  311.             clear_buttonbar();
  312.         }
  313.         /* 061506 double buffer Start */
  314.         if (wgui_is_touch_title_bar_buttons())
  315.         {
  316.         #if defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
  317.             gOnFullScreen = MMI_IN_NORMAL_SCREEN;//063006 title shift
  318.             show_status_icon_bar(0);
  319.             register_hide_status_icon_bar(0, hide_status_icons_bar0);
  320.         #endif
  321.         }
  322.         //show_title_status_icon();
  323.         /* 061506 double buffer End */
  324.         draw_title();
  325.         show_softkey_background();
  326.         show_left_softkey();
  327.         show_right_softkey();
  328.         gdi_layer_unlock_frame_buffer();
  329.     }
  330.     else
  331.     {
  332.         /* entry full screen */
  333.         entry_full_screen();
  334.         /* clear full screen */
  335.         gdi_layer_clear(bg_color);
  336.         /* full screen */
  337.         content_width = UI_device_width;
  338.         content_height = UI_device_height;
  339.         content_offset_x = 0;
  340.         content_offset_y = 0;
  341.         cat_vdoply_is_full_screen = TRUE;
  342.     }
  343.    /********************************************************************************
  344.    *  Open Video
  345.    ********************************************************************************/
  346.     if (video_id != 0)
  347.     {
  348.         /* source from id */
  349.         /* always open with audio, if do not want audio, mute it by calling mdi function */
  350.         video_ret = mdi_video_ply_open_clip_id(video_id, &wgui_video_info);
  351.         cat_vdoply_is_video_open = (video_ret >= 0) ? TRUE : FALSE;
  352.     }
  353.     else if (video_filename != NULL)
  354.     {
  355.         /* source from file */
  356.         /* always open with audio, if do not want audio, dsiable it in play function */
  357.         video_ret = mdi_video_ply_open_clip_file(video_filename, &wgui_video_info);
  358.         cat_vdoply_is_video_open = (video_ret >= 0) ? TRUE : FALSE;
  359.     }
  360.     else
  361.     {
  362.         /* no proper source */
  363.         MMI_ASSERT(0);
  364.     }
  365.     /* check if the title bar buttons are enabled for the particular screen. */
  366.     if (wgui_is_touch_title_bar_buttons())
  367.     {
  368.         btn_prev_item_id = dm_add_button(
  369.                             NULL,
  370.                             get_image(LEFT_RED_ARROW),
  371.                             get_image(LEFT_RED_ARROW),
  372.                             cat226_hide_button_full_screen);
  373.         btn_next_item_id = dm_add_button(
  374.                             NULL,
  375.                             get_image(RIGHT_RED_ARROW),
  376.                             get_image(RIGHT_RED_ARROW),
  377.                             cat226_hide_button_full_screen);
  378.     #if defined(__MMI_TOUCH_SCREEN__)
  379.         /* register the handler for pen event down istead of pen event up. */
  380.         dm_register_button_functions(btn_prev_item_id, KEY_EVENT_UP, gMMI_touch_title_button1_down_handler);
  381.         dm_register_button_functions(btn_next_item_id, KEY_EVENT_UP, gMMI_touch_title_button2_down_handler);
  382.     #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  383.     }
  384.     RedrawCategoryFunction = dm_redraw_category_screen;
  385.     ExitCategoryFunction = ExitCategoryVdoplyScreen;
  386.     GetCategoryHistory = dummy_get_history;
  387.     GetCategoryHistorySize = dummy_get_history_size;
  388.     if (wgui_is_touch_title_bar_buttons())
  389.     {
  390.         dm_data.s32CatId = MMI_CATEGORY_VDOPLY_BUTTON;
  391.     }
  392.     else
  393.     {
  394.         dm_data.s32CatId = MMI_CATEGORY_VDOPLY;
  395.     }
  396.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  397.     if (is_fullscreen)
  398.     {
  399.         dm_data.s32flags = DM_NO_TITLE | DM_NO_STATUS_BAR | DM_NO_SOFTKEY | DM_BUTTON_DISABLE_BACKGROUND;
  400.     }
  401.     else
  402.     {
  403.         dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  404.     }
  405.     dm_setup_data(&dm_data);
  406.     dm_register_category_controlled_callback(DrawCateVdoCategoryControlArea);
  407.     dm_redraw_category_screen();
  408.     /* 
  409.      * register exit category function befor calling the callback function, 
  410.      * since this call back may exit this category 
  411.      */
  412.     video_ret = cat_vdoply_is_video_play_result;
  413.     if (cat_vdoply_is_video_play == TRUE)
  414.     {
  415.         //gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);//061506 double buffer
  416.         if (wgui_is_touch_title_bar_buttons())
  417.         {
  418.         /* 061506 double buffer Start */
  419.         #if defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
  420.             //black-video-base-status
  421.             video_ret = mdi_video_ply_play(
  422.                             cat_vdoply_video_layer,
  423.                             GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1 | GDI_LAYER_ENABLE_LAYER_2 | GDI_LAYER_ENABLE_LAYER_3,
  424.                             GDI_LAYER_ENABLE_LAYER_1,
  425.                             1,                              /* repeat count */
  426.                             is_visual_update,               /* update to LCM or not */
  427.                             is_play_audio,                  /* play aud or not */                            
  428.                             MDI_DEVICE_SPEAKER2,            /* speaker & earphone */
  429.                             MDI_VIDEO_LCD_ROTATE_0,         /* rotate */
  430.                             100,                            /* 1x play speed */
  431.                             CatVdoplyPlayFinishCallback);   /* hook callback */
  432.         #else
  433.             //black-video-base
  434.             video_ret = mdi_video_ply_play(
  435.                             cat_vdoply_video_layer,
  436.                             GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1 | GDI_LAYER_ENABLE_LAYER_2,
  437.                             GDI_LAYER_ENABLE_LAYER_1,
  438.                             1,                              /* repeat count */
  439.                             is_visual_update,               /* update to LCM or not */
  440.                             is_play_audio,                  /* play aud or not */
  441.                             MDI_DEVICE_SPEAKER2,            /* speaker & earphone */
  442.                             MDI_VIDEO_LCD_ROTATE_0,         /* rotate */
  443.                             100,                            /* 1x play speed */
  444.                             CatVdoplyPlayFinishCallback);   /* hook callback */
  445.         #endif
  446.         }
  447.         else
  448.         {
  449.             //base-video
  450.             video_ret = mdi_video_ply_play(
  451.                             cat_vdoply_video_layer,
  452.                             GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1,
  453.                             GDI_LAYER_ENABLE_LAYER_1,
  454.                             1,                              /* repeat count */
  455.                             is_visual_update,               /* update to LCM or not */
  456.                             is_play_audio,                  /* play aud or not */                            
  457.                             MDI_DEVICE_SPEAKER2,            /* speaker & earphone */
  458.                             MDI_VIDEO_LCD_ROTATE_0,         /* rotate */
  459.                             100,                            /* 1x play speed */
  460.                             CatVdoplyPlayFinishCallback);   /* hook callback */
  461.         }
  462.         /* 061506 double buffer Start */
  463.         cat_vdoply_is_video_play = (video_ret >= 0) ? TRUE : FALSE;
  464.         cat_vdoply_is_video_force_stop = FALSE;
  465.     }
  466.     if (cat_vdoply_is_video_play == FALSE)
  467.     {
  468.         /* open file failed or play failed - reutrn error cause */
  469.         if (cat_vdoply_play_finish_callback != NULL)
  470.         {
  471.             cat_vdoply_play_finish_callback(video_ret);
  472.         }
  473.     }
  474. }
  475. /*****************************************************************************
  476.  * FUNCTION
  477.  *  ExitCategoryVdoplyScreen
  478.  * DESCRIPTION
  479.  *  Exit Category 224 screen
  480.  * PARAMETERS
  481.  *  void
  482.  * RETURNS
  483.  *  void
  484.  *****************************************************************************/
  485. static void ExitCategoryVdoplyScreen(void)
  486. {
  487.     /*----------------------------------------------------------------*/
  488.     /* Local Variables                                                */
  489.     /*----------------------------------------------------------------*/
  490.     /*----------------------------------------------------------------*/
  491.     /* Code Body                                                      */
  492.     /*----------------------------------------------------------------*/
  493.     if (cat_vdoply_is_video_open)
  494.     {
  495.         /* stop video playing */
  496.         if (cat_vdoply_is_video_play)
  497.         {
  498.             mdi_video_ply_stop();
  499.             cat_vdoply_is_video_play = FALSE;
  500.         }
  501.         /* close video source */
  502.         if (cat_vdoply_is_video_from_id)
  503.         {
  504.             /* source from id */
  505.             mdi_video_ply_close_clip_id();
  506.             cat_vdoply_is_video_open = FALSE;
  507.         }
  508.         else
  509.         {
  510.             /* source from file */
  511.             mdi_video_ply_close_clip_file();
  512.             cat_vdoply_is_video_open = FALSE;
  513.         }
  514.     }
  515.     /* let MMI can sleep */
  516.     if (cat_vdoply_video_is_lcd_no_sleep)
  517.     {
  518.         TurnOffBacklight();
  519.     }
  520.     if (cat_vdoply_video_is_play_audio)
  521.     {
  522.         /* resume background audio */
  523.         mdi_audio_resume_background_play();
  524.     }
  525.     if (wgui_is_touch_title_bar_buttons())
  526.     {
  527.     /* 061506 double buffer Start */
  528.     /*******************************************************************************
  529.     *  Special status icon handle with double buffer
  530.     *******************************************************************************/
  531.     #if defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
  532.         U32 icon_flag;
  533.     
  534.         if (get_status_icon_bar_layer(0)!=GDI_ERROR_HANDLE && status_icon_buf!=NULL)
  535.         {
  536.             mmi_frm_scrmem_free(status_icon_buf);
  537.             status_icon_buf = NULL;
  538.             status_icon_layer = GDI_ERROR_HANDLE;
  539.             set_status_icon_bar_layer(0, GDI_ERROR_HANDLE);
  540.         }
  541.         icon_flag = get_status_icon_bar_type(0);
  542.         icon_flag &= ~ STATUS_ICON_BAR_ENABLE_DOUBLE_BUFFER;
  543.         set_status_icon_bar_type(0, icon_flag);
  544.     #endif
  545.     /* 061506 double buffer End */
  546.     
  547.         title_bg_id = 0;
  548.         if (gBlack_buf != NULL)
  549.         {
  550.             mmi_frm_scrmem_free(gBlack_buf);
  551.         }
  552.         gBlack_buf = NULL;
  553.         gBlack_layer = NULL;
  554.         entry_full_screen();
  555.     }
  556.     wgui_reset_touch_title_bar_buttons();
  557.     ExitCategoryFunction = MMI_dummy_function;
  558.     RedrawCategoryFunction = MMI_dummy_function;
  559.     GetCategoryHistory = dummy_get_history;
  560.     GetCategoryHistorySize = dummy_get_history_size;
  561. #ifdef __MMI_SUBLCD__
  562.     /* exit sublcd */
  563.     if (cat_vdoply_is_sublcd_display)
  564.     {
  565.         GoBackSubLCDHistory();
  566.         cat_vdoply_is_sublcd_display = FALSE;
  567.     }
  568. #endif /* __MMI_SUBLCD__ */ 
  569. }
  570. /*****************************************************************************
  571.  * FUNCTION
  572.  *  EnterCategoryVdoplySubScreen
  573.  * DESCRIPTION
  574.  *  Entery Category vdoply's sublcd screen, will draw an icon on sublcd
  575.  * PARAMETERS
  576.  *  void
  577.  * RETURNS
  578.  *  void
  579.  *****************************************************************************/
  580. #ifdef __MMI_SUBLCD__
  581. static void EnterCategoryVdoplySubScreen(void)
  582. {
  583.     /*----------------------------------------------------------------*/
  584.     /* Local Variables                                                */
  585.     /*----------------------------------------------------------------*/
  586.     /*----------------------------------------------------------------*/
  587.     /* Code Body                                                      */
  588.     /*----------------------------------------------------------------*/
  589.     ExecSubLCDCurrExitHandler();
  590.     cat_vdoply_is_sublcd_display = TRUE;
  591.     ShowCategory332Screen(IMG_ID_VDOPLY_SUBLCD_ICON);
  592.     /* force all animation on sulcd stop, this is prevent IMG_ID_VDOPLY_SUBLCD_ICON is an animation gif */
  593.     gdi_lcd_set_active(GDI_LCD_SUB_LCD_HANDLE);
  594.     gdi_image_stop_animation_all();
  595.     gdi_lcd_set_active(GDI_LCD_MAIN_LCD_HANDLE);
  596.     SetSubLCDExitHandler(ExitCategoryVdoplySubScreen);
  597. }
  598. #endif /* __MMI_SUBLCD__ */ 
  599. /*****************************************************************************
  600.  * FUNCTION
  601.  *  ExitCategoryVdoplySubScreen
  602.  * DESCRIPTION
  603.  *  Exit Category Vdoply's sublcd screen
  604.  * PARAMETERS
  605.  *  void
  606.  * RETURNS
  607.  *  void
  608.  *****************************************************************************/
  609. #ifdef __MMI_SUBLCD__
  610. static void ExitCategoryVdoplySubScreen(void)
  611. {
  612.     /*----------------------------------------------------------------*/
  613.     /* Local Variables                                                */
  614.     /*----------------------------------------------------------------*/
  615.     SubLCDHistoryNode sub_history;
  616.     /*----------------------------------------------------------------*/
  617.     /* Code Body                                                      */
  618.     /*----------------------------------------------------------------*/
  619.     /* someone may exit/draw sublcd first then exit mainlcd, this may cause driver assert */
  620.     if (cat_vdoply_is_video_play)
  621.     {
  622.         mdi_video_ply_stop();
  623.         cat_vdoply_is_video_play = FALSE;
  624.     }
  625.     cat_vdoply_is_sublcd_display = FALSE;
  626.     sub_history.entryFuncPtr = EnterCategoryVdoplySubScreen;
  627.     AddSubLCDHistory(&sub_history);
  628. }
  629. #endif /* __MMI_SUBLCD__ */ 
  630. /*****************************************************************************
  631.  * FUNCTION
  632.  *  StopCategoryVdoplyVideo
  633.  * DESCRIPTION
  634.  *  Stop Category Vdoply screen's video
  635.  * PARAMETERS
  636.  *  void
  637.  * RETURNS
  638.  *  void
  639.  *****************************************************************************/
  640. static void StopCategoryVdoplyVideo(void)
  641. {
  642.     /*----------------------------------------------------------------*/
  643.     /* Local Variables                                                */
  644.     /*----------------------------------------------------------------*/
  645.     /*----------------------------------------------------------------*/
  646.     /* Code Body                                                      */
  647.     /*----------------------------------------------------------------*/
  648.     cat_vdoply_is_video_force_stop = TRUE;
  649.     if (cat_vdoply_is_video_open)
  650.     {
  651.         /* stop video playing */
  652.         if (cat_vdoply_is_video_play)
  653.         {
  654.             mdi_video_ply_stop();
  655.             cat_vdoply_is_video_play = FALSE;
  656.         }
  657.     }
  658. }
  659. /*****************************************************************************
  660.  * FUNCTION
  661.  *  PauseCategoryVdoplyVideo
  662.  * DESCRIPTION
  663.  *  Pause video play
  664.  * PARAMETERS
  665.  *  void
  666.  * RETURNS
  667.  *  void
  668.  *****************************************************************************/
  669. static void PauseCategoryVdoplyVideo(void)
  670. {
  671.     /*----------------------------------------------------------------*/
  672.     /* Local Variables                                                */
  673.     /*----------------------------------------------------------------*/
  674.     /*----------------------------------------------------------------*/
  675.     /* Code Body                                                      */
  676.     /*----------------------------------------------------------------*/
  677.     /* stop video playing */
  678.     if (cat_vdoply_is_video_open)
  679.     {
  680.         if (cat_vdoply_is_video_play)
  681.         {
  682.             mdi_video_ply_stop();
  683.             cat_vdoply_is_video_play = FALSE;
  684.         }
  685.     }
  686. }
  687. /*****************************************************************************
  688.  * FUNCTION
  689.  *  ResumeCategoryVdoplyVideo
  690.  * DESCRIPTION
  691.  *  Resume video play
  692.  * PARAMETERS
  693.  *  void
  694.  * RETURNS
  695.  *  void
  696.  *****************************************************************************/
  697. static void ResumeCategoryVdoplyVideo(void)
  698. {
  699.     /*----------------------------------------------------------------*/
  700.     /* Local Variables                                                */
  701.     /*----------------------------------------------------------------*/
  702.     MDI_RESULT video_ret;
  703.     /*----------------------------------------------------------------*/
  704.     /* Code Body                                                      */
  705.     /*----------------------------------------------------------------*/
  706.     /* the callback function maybe already exit this category and close video file */
  707.     /* check before play this video */
  708.     if (cat_vdoply_is_video_open)
  709.     {
  710.         /* start play again */
  711.         if (wgui_is_touch_title_bar_buttons())
  712.         {
  713.             video_ret = mdi_video_ply_play(
  714.                             cat_vdoply_video_layer,
  715.                             GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1 | GDI_LAYER_ENABLE_LAYER_2,
  716.                             GDI_LAYER_ENABLE_LAYER_1,
  717.                             1,                              /* repeat count */
  718.                             cat_vdoply_video_is_visual_update,   /* update to LCM or not */
  719.                             cat_vdoply_video_is_play_audio,      /* play aud or not */
  720.                             MDI_DEVICE_SPEAKER2,            /* speaker & earphone */
  721.                             MDI_VIDEO_LCD_ROTATE_0,         /* rotate */
  722.                             100,                            /* 1x play speed */
  723.                             CatVdoplyPlayFinishCallback);   /* hook callback */
  724.         }
  725.         else
  726.         {
  727.             video_ret = mdi_video_ply_play(
  728.                             cat_vdoply_video_layer,
  729.                             GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1,
  730.                             GDI_LAYER_ENABLE_LAYER_1,
  731.                             1,                              /* repeat count */
  732.                             cat_vdoply_video_is_visual_update,   /* update to LCM or not */
  733.                             cat_vdoply_video_is_play_audio,      /* play aud or not */                            
  734.                             MDI_DEVICE_SPEAKER2,            /* speaker & earphone */
  735.                             MDI_VIDEO_LCD_ROTATE_0,         /* rotate */
  736.                             100,                            /* 1x play speed */
  737.                             CatVdoplyPlayFinishCallback);   /* hook callback */
  738.         }
  739.         if (video_ret < 0)
  740.         {
  741.             cat_vdoply_play_finish_callback(video_ret);
  742.             if (cat_vdoply_play_finish_callback != NULL)
  743.             {
  744.                 cat_vdoply_play_finish_callback(video_ret);
  745.             }
  746.         }
  747.         else
  748.         {
  749.             cat_vdoply_is_video_play = TRUE;
  750.         }
  751.     }
  752. }
  753. /*****************************************************************************
  754.  * FUNCTION
  755.  *  CatVdoplyPlayFinishCallback
  756.  * DESCRIPTION
  757.  *  Play finish callback function, will handle looping here
  758.  * PARAMETERS
  759.  *  result      [IN]        
  760.  * RETURNS
  761.  *  void
  762.  *****************************************************************************/
  763. static void CatVdoplyPlayFinishCallback(MDI_RESULT result)
  764. {
  765.     /*----------------------------------------------------------------*/
  766.     /* Local Variables                                                */
  767.     /*----------------------------------------------------------------*/
  768.     MDI_RESULT video_ret;
  769.     /*----------------------------------------------------------------*/
  770.     /* Code Body                                                      */
  771.     /*----------------------------------------------------------------*/
  772.     if (result >= 0)
  773.     {
  774.         /* success play finished */
  775.         /* call callback function */
  776.         if (cat_vdoply_play_finish_callback != NULL)
  777.         {
  778.             cat_vdoply_play_finish_callback(result);
  779.         }
  780.         /* teminate condition */
  781.         if (cat_vdoply_video_repeat_count == 0)
  782.         {
  783.             return;
  784.         }
  785.         /* force stopped, will not loop again */
  786.         if (cat_vdoply_is_video_force_stop == TRUE)
  787.         {
  788.             return;
  789.         }
  790.         /* calc remain count */
  791.         if (cat_vdoply_video_repeat_count > 0)  /* play again */
  792.         {
  793.             if (cat_vdoply_video_repeat_count != 0xffff)
  794.             {
  795.                 /* not infite play */
  796.                 cat_vdoply_video_repeat_count--;
  797.             }
  798.         }
  799.         /* the callback function maybe already exit this category and close video file */
  800.         /* check before play this video */
  801.         if (cat_vdoply_is_video_open)
  802.         {
  803.             /* seek to first frame */
  804.             video_ret = mdi_video_ply_seek(0);
  805.             if (video_ret < 0)
  806.             {
  807.                 if (cat_vdoply_play_finish_callback != NULL)
  808.                 {
  809.                     cat_vdoply_play_finish_callback(video_ret);
  810.                 }
  811.                 return;
  812.             }
  813.             /* start play again */
  814.             if (wgui_is_touch_title_bar_buttons())
  815.             {
  816.                 video_ret = mdi_video_ply_play(
  817.                                 cat_vdoply_video_layer,
  818.                                 GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1 | GDI_LAYER_ENABLE_LAYER_2,
  819.                                 GDI_LAYER_ENABLE_LAYER_1,
  820.                                 1,                      /* repeat count */
  821.                                 cat_vdoply_video_is_visual_update,       /* update to LCM or not */
  822.                                 cat_vdoply_video_is_play_audio,         /* play aud or not */    
  823.                                 MDI_DEVICE_SPEAKER2,    /* speaker & earphone */
  824.                                 MDI_VIDEO_LCD_ROTATE_0, /* rotate */
  825.                                 100,                    /* 1x play speed */
  826.                                 CatVdoplyPlayFinishCallback);    /* hook callback */
  827.             }
  828.             else
  829.             {
  830.                 video_ret = mdi_video_ply_play(
  831.                                 cat_vdoply_video_layer,
  832.                                 GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1,
  833.                                 GDI_LAYER_ENABLE_LAYER_1,
  834.                                 1,                      /* repeat count */
  835.                                 cat_vdoply_video_is_visual_update,      /* update to LCM or not */
  836.                                 cat_vdoply_video_is_play_audio,         /* play aud or not */                                
  837.                                 MDI_DEVICE_SPEAKER2,    /* speaker & earphone */
  838.                                 MDI_VIDEO_LCD_ROTATE_0, /* rotate */
  839.                                 100,                    /* 1x play speed */
  840.                                 CatVdoplyPlayFinishCallback);    /* hook callback */
  841.             }
  842.             if (video_ret < 0)
  843.             {
  844.                 cat_vdoply_play_finish_callback(video_ret);
  845.                 if (cat_vdoply_play_finish_callback != NULL)
  846.                 {
  847.                     cat_vdoply_play_finish_callback(video_ret);
  848.                 }
  849.             }
  850.         }
  851.     }
  852.     else
  853.     {
  854.         /* something wrong */
  855.         /* call callback function */
  856.         if (cat_vdoply_play_finish_callback != NULL)
  857.         {
  858.             cat_vdoply_play_finish_callback(result);
  859.         }
  860.     }
  861. }
  862. /*****************************************************************************
  863.  * FUNCTION
  864.  *  CatVdoplyVolUp
  865.  * DESCRIPTION
  866.  *  volume down key press hdlr
  867.  * PARAMETERS
  868.  *  void
  869.  * RETURNS
  870.  *  void
  871.  *****************************************************************************/
  872. static void CatVdoplyVolUp(void)
  873. {
  874.     /*----------------------------------------------------------------*/
  875.     /* Local Variables                                                */
  876.     /*----------------------------------------------------------------*/
  877.     /*----------------------------------------------------------------*/
  878.     /* Code Body                                                      */
  879.     /*----------------------------------------------------------------*/
  880.     if (cat_vdoply_audio_volumn < LEVEL7)
  881.     {
  882.         cat_vdoply_audio_volumn++;
  883.         mdi_audio_set_volume(MDI_VOLUME_MEDIA, cat_vdoply_audio_volumn);
  884.     }
  885. }
  886. /*****************************************************************************
  887.  * FUNCTION
  888.  *  CatVdoplyVolDown
  889.  * DESCRIPTION
  890.  *  volume down key press hdlr
  891.  * PARAMETERS
  892.  *  void
  893.  * RETURNS
  894.  *  void
  895.  *****************************************************************************/
  896. static void CatVdoplyVolDown(void)
  897. {
  898.     /*----------------------------------------------------------------*/
  899.     /* Local Variables                                                */
  900.     /*----------------------------------------------------------------*/
  901.     /*----------------------------------------------------------------*/
  902.     /* Code Body                                                      */
  903.     /*----------------------------------------------------------------*/
  904.     if (cat_vdoply_audio_volumn > LEVEL1)
  905.     {
  906.         cat_vdoply_audio_volumn--;
  907.         mdi_audio_set_volume(MDI_VOLUME_MEDIA, cat_vdoply_audio_volumn);
  908.     }
  909. }
  910. #endif /* __MMI_VIDEO_PLAYER__ */ 
  911. extern void cat33_hide_lsk(void);
  912. extern void cat33_hide_rsk(void);
  913. PU8 cat226_bg_img = NULL;
  914. /*****************************************************************************
  915.  * FUNCTION
  916.  *  cat226_hide_lsk
  917.  * DESCRIPTION
  918.  *  hide category226 left softkey in normal mode
  919.  * PARAMETERS
  920.  *  void
  921.  * RETURNS
  922.  *  void
  923.  *****************************************************************************/
  924. void cat226_hide_lsk(void)
  925. {
  926.     /*----------------------------------------------------------------*/
  927.     /* Local Variables                                                */
  928.     /*----------------------------------------------------------------*/
  929.     S32 x, y, width, height;
  930.     /*----------------------------------------------------------------*/
  931.     /* Code Body                                                      */
  932.     /*----------------------------------------------------------------*/
  933.     gdi_layer_push_clip();
  934.     wgui_softkey_get_dimension(MMI_LEFT_SOFTKEY, &width, &height);
  935.     wgui_softkey_get_position(MMI_LEFT_SOFTKEY, &x, &y);
  936.     gdi_layer_set_clip(x, y, x + width - 1, y + height - 1);
  937.     gdi_image_draw(0, 0, (U8*) cat226_bg_img);
  938.     gdi_layer_pop_clip();
  939. }
  940. /*****************************************************************************
  941.  * FUNCTION
  942.  *  cat226_hide_rsk
  943.  * DESCRIPTION
  944.  *  hide category226 right softkey in normal mode
  945.  * PARAMETERS
  946.  *  void
  947.  * RETURNS
  948.  *  void
  949.  *****************************************************************************/
  950. void cat226_hide_rsk(void)
  951. {
  952.     /*----------------------------------------------------------------*/
  953.     /* Local Variables                                                */
  954.     /*----------------------------------------------------------------*/
  955.     S32 x, y, width, height;
  956.     /*----------------------------------------------------------------*/
  957.     /* Code Body                                                      */
  958.     /*----------------------------------------------------------------*/
  959.     gdi_layer_push_clip();
  960.     wgui_softkey_get_dimension(MMI_RIGHT_SOFTKEY, &width, &height);
  961.     wgui_softkey_get_position(MMI_RIGHT_SOFTKEY, &x, &y);
  962.     gdi_layer_set_clip(x, y, x + width - 1, y + height - 1);
  963.     gdi_image_draw(0, 0, (U8*) cat226_bg_img);
  964.     gdi_layer_pop_clip();
  965. }
  966. /*****************************************************************************
  967.  * FUNCTION
  968.  *  cat226_hide_button
  969.  * DESCRIPTION
  970.  *  
  971.  * PARAMETERS
  972.  *  button_object       [?]     
  973.  * RETURNS
  974.  *  void
  975.  *****************************************************************************/
  976. void cat226_hide_button(void *button_object)
  977. {
  978.     /*----------------------------------------------------------------*/
  979.     /* Local Variables                                                */
  980.     /*----------------------------------------------------------------*/
  981.     button *button_obj = (button*) button_object;
  982.     /*----------------------------------------------------------------*/
  983.     /* Code Body                                                      */
  984.     /*----------------------------------------------------------------*/
  985.     gdi_layer_push_clip();
  986.     gdi_layer_set_clip(
  987.         button_obj->x,
  988.         button_obj->y,
  989.         button_obj->x + button_obj->width + 1,
  990.         button_obj->y + button_obj->height + 1);
  991.     gdi_image_draw(0, 0, (U8*) cat226_bg_img);
  992.     gdi_layer_pop_clip();
  993. }
  994. /*****************************************************************************
  995.  * FUNCTION
  996.  *  cat226_hide_button_full_screen
  997.  * DESCRIPTION
  998.  *  
  999.  * PARAMETERS
  1000.  *  button_object       [?]     
  1001.  * RETURNS
  1002.  *  void
  1003.  *****************************************************************************/
  1004. void cat226_hide_button_full_screen(void *button_object)
  1005. {
  1006.     /*----------------------------------------------------------------*/
  1007.     /* Local Variables                                                */
  1008.     /*----------------------------------------------------------------*/
  1009.     button *button_obj = (button*) button_object;
  1010.     /*----------------------------------------------------------------*/
  1011.     /* Code Body                                                      */
  1012.     /*----------------------------------------------------------------*/
  1013.     gdi_layer_push_clip();
  1014.     gdi_layer_set_clip(
  1015.         button_obj->x,
  1016.         button_obj->y,
  1017.         button_obj->x + button_obj->width + 1,
  1018.         button_obj->y + button_obj->height + 1);
  1019.     gdi_draw_solid_rect(
  1020.         button_obj->x,
  1021.         button_obj->y,
  1022.         button_obj->x + button_obj->width + 1,
  1023.         button_obj->y + button_obj->height + 1,
  1024.         GDI_COLOR_TRANSPARENT);
  1025.     gdi_layer_pop_clip();
  1026. }
  1027. /*****************************************************************************
  1028.  * FUNCTION
  1029.  *  cat226_draw_scroll_text_cb
  1030.  * DESCRIPTION
  1031.  *  
  1032.  * PARAMETERS
  1033.  *  x1      [IN]        
  1034.  *  y1      [IN]        
  1035.  *  x2      [IN]        
  1036.  *  y2      [IN]        
  1037.  * RETURNS
  1038.  *  void
  1039.  *****************************************************************************/
  1040. void cat226_draw_scroll_text_cb(S32 x1, S32 y1, S32 x2, S32 y2)
  1041. {
  1042.     /*----------------------------------------------------------------*/
  1043.     /* Local Variables                                                */
  1044.     /*----------------------------------------------------------------*/
  1045.     /*----------------------------------------------------------------*/
  1046.     /* Code Body                                                      */
  1047.     /*----------------------------------------------------------------*/
  1048.     gdi_layer_push_clip();
  1049.     gdi_layer_set_clip(x1, y1, x2, y2);
  1050.     gdi_image_draw(0, 0, (U8*) cat226_bg_img);
  1051.     gdi_layer_pop_clip();
  1052. }
  1053. /*****************************************************************************
  1054.  * FUNCTION
  1055.  *  cat226_draw_scroll_text_cb_full_screen
  1056.  * DESCRIPTION
  1057.  *  
  1058.  * PARAMETERS
  1059.  *  x1      [IN]        
  1060.  *  y1      [IN]        
  1061.  *  x2      [IN]        
  1062.  *  y2      [IN]        
  1063.  * RETURNS
  1064.  *  void
  1065.  *****************************************************************************/
  1066. void cat226_draw_scroll_text_cb_full_screen(S32 x1, S32 y1, S32 x2, S32 y2)
  1067. {
  1068.     /*----------------------------------------------------------------*/
  1069.     /* Local Variables                                                */
  1070.     /*----------------------------------------------------------------*/
  1071.     /*----------------------------------------------------------------*/
  1072.     /* Code Body                                                      */
  1073.     /*----------------------------------------------------------------*/
  1074.     gdi_layer_push_clip();
  1075.     gdi_layer_set_clip(x1, y1, x2, y2);
  1076.     gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);
  1077.     gdi_layer_pop_clip();
  1078. }
  1079. /*****************************************************************************
  1080.  * FUNCTION
  1081.  *  ExitCategory226Screen
  1082.  * DESCRIPTION
  1083.  *  
  1084.  * PARAMETERS
  1085.  *  void
  1086.  * RETURNS
  1087.  *  void
  1088.  *****************************************************************************/
  1089. void ExitCategory226Screen(void)
  1090. {
  1091.     /*----------------------------------------------------------------*/
  1092.     /* Local Variables                                                */
  1093.     /*----------------------------------------------------------------*/
  1094.     /*----------------------------------------------------------------*/
  1095.     /* Code Body                                                      */
  1096.     /*----------------------------------------------------------------*/
  1097.     enable_softkey_background();
  1098. }
  1099. /*****************************************************************************
  1100.  * FUNCTION
  1101.  *  ShowCategory226Screen
  1102.  * DESCRIPTION
  1103.  *  Category screen for image viewer
  1104.  *  one preview area, one image view area.
  1105.  * PARAMETERS
  1106.  *  left_softkey            [IN]            Left softkey string id
  1107.  *  left_softkey_icon       [IN]            Left softkey icon id
  1108.  *  right_softkey           [IN]            Right softkey string id
  1109.  *  right_softkey_icon      [IN]            Right softkey icon id
  1110.  *  bg_image_id             [IN]            Background image id
  1111.  *  str_1                   [IN]            String 1 for display ( filename )
  1112.  *  str_2                   [IN]            String 2 for display ( file count )
  1113.  *  left_arrow_up           [IN]            Up image id for left arrow
  1114.  *  left_arrow_down         [IN]            Down image id for left arrow
  1115.  *  event_callback1         [IN]            Event handler for left arrow
  1116.  *  right_arrow_up          [IN]            Up image id for right arrow
  1117.  *  right_arrow_down        [IN]            Down image id for right arrow
  1118.  *  event_callback2         [IN]            Event handler for right arrow
  1119.  *  icon1_up                [IN]            Up image id for icon1
  1120.  *  icon1_down              [IN]            
  1121.  *  event_callback3         [IN]            Event handler for icon1
  1122.  *  icon2_up                [IN]            Up image id for icon2
  1123.  *  icon2_down              [IN]            Down image id for icon2
  1124.  *  event_callback4         [IN]            Event handler for icon2
  1125.  *  icon3_up                [IN]            Up image id for icon3
  1126.  *  icon3_down              [IN]            Down image id for icon3
  1127.  *  event_callback5         [IN]            Event handler for icon3
  1128.  *  icon4_up                [IN]            Up image id for icon4
  1129.  *  icon4_down              [IN]            Down image id for icon4
  1130.  *  event_callback6         [IN]            Event handler for icon4
  1131.  *  area1_layer             [IN/OUT]        Layer handle for preview area
  1132.  *  area1_call_back         [IN]            Draw function of preview area
  1133.  *  area2_layer             [IN/OUT]        Layer handle for image content area
  1134.  *  area2_call_back         [IN]            Draw function of image content area
  1135.  *  layout                  [IN]            Normal mode / full screen mode
  1136.  * RETURNS
  1137.  *  void
  1138.  *****************************************************************************/
  1139. void ShowCategory226Screen(
  1140.         U16 left_softkey,
  1141.         U16 left_softkey_icon,
  1142.         U16 right_softkey,
  1143.         U16 right_softkey_icon,
  1144.         U16 bg_image_id,
  1145.         UI_string_type str_1,
  1146.         UI_string_type str_2,
  1147.         U16 left_arrow_up,
  1148.         U16 left_arrow_down,
  1149.         FuncPtr event_callback1,
  1150.         U16 right_arrow_up,
  1151.         U16 right_arrow_down,
  1152.         FuncPtr event_callback2,
  1153.         U16 icon1_up,
  1154.         U16 icon1_down,
  1155.         FuncPtr event_callback3,
  1156.         U16 icon2_up,
  1157.         U16 icon2_down,
  1158.         FuncPtr event_callback4,
  1159.         U16 icon3_up,
  1160.         U16 icon3_down,
  1161.         FuncPtr event_callback5,
  1162.         U16 icon4_up,
  1163.         U16 icon4_down,
  1164.         FuncPtr event_callback6,
  1165.         GDI_HANDLE *area1_layer,
  1166.         void (*area1_call_back) (dm_coordinates *coordinate),
  1167.         GDI_HANDLE *area2_layer,
  1168.         void (*area2_call_back) (dm_coordinates *coordinate),
  1169.         cat226_screen_layout_enum layout)
  1170. {
  1171.     /*----------------------------------------------------------------*/
  1172.     /* Local Variables                                                */
  1173.     /*----------------------------------------------------------------*/
  1174.     dm_data_struct dm_data;
  1175.     U8 index = 0;
  1176.     /*----------------------------------------------------------------*/
  1177.     /* Code Body                                                      */
  1178.     /*----------------------------------------------------------------*/
  1179.     entry_full_screen();
  1180.     change_left_softkey(left_softkey, left_softkey_icon);
  1181.     change_right_softkey(right_softkey, right_softkey_icon);
  1182.     SetupCategoryKeyHandlers();
  1183.     disable_softkey_background();
  1184.     if (layout == VERTICAL_FULLSCREEN || layout == HORIZONTAL_FULLSCREEN)
  1185.     {
  1186.         register_hide_left_softkey(cat33_hide_lsk);
  1187.         register_hide_right_softkey(cat33_hide_rsk);
  1188.     }
  1189.     else
  1190.     {
  1191.         register_hide_left_softkey(cat226_hide_lsk);
  1192.         register_hide_right_softkey(cat226_hide_rsk);
  1193.     }
  1194.     cat226_bg_img = get_image(bg_image_id);
  1195.     dm_add_image(cat226_bg_img, NULL, NULL);
  1196.     /* dm_add_string(str_1, &MMI_default_font, UI_COLOR_WHITE, UI_COLOR_BLACK, NULL); */
  1197.     if (layout == VERTICAL_NORMAL || layout == HORIZONTAL_NORMAL)
  1198.     {
  1199.         dm_add_scroll_text(str_1, NULL, cat226_draw_scroll_text_cb, UI_COLOR_BLACK, UI_COLOR_WHITE);
  1200.         dm_add_button(NULL, get_image(left_arrow_up), get_image(left_arrow_down), cat226_hide_button);
  1201.         dm_add_button(NULL, get_image(right_arrow_up), get_image(right_arrow_down), cat226_hide_button);
  1202.         dm_add_button(NULL, get_image(icon1_up), get_image(icon1_down), cat226_hide_button);
  1203.         dm_add_button(NULL, get_image(icon2_up), get_image(icon2_down), cat226_hide_button);
  1204.         dm_add_button(NULL, get_image(icon3_up), get_image(icon3_down), cat226_hide_button);
  1205.         dm_add_button(NULL, get_image(icon4_up), get_image(icon4_down), cat226_hide_button);
  1206.     }
  1207.     else
  1208.     {
  1209.         dm_add_scroll_text(str_1, NULL, cat226_draw_scroll_text_cb_full_screen, UI_COLOR_BLACK, UI_COLOR_WHITE);
  1210.         dm_add_button(NULL, get_image(left_arrow_up), get_image(left_arrow_down), cat226_hide_button_full_screen);
  1211.         dm_add_button(NULL, get_image(right_arrow_up), get_image(right_arrow_down), cat226_hide_button_full_screen);
  1212.         dm_add_button(NULL, get_image(icon1_up), get_image(icon1_down), cat226_hide_button_full_screen);
  1213.         dm_add_button(NULL, get_image(icon2_up), get_image(icon2_down), cat226_hide_button_full_screen);
  1214.         dm_add_button(NULL, get_image(icon3_up), get_image(icon3_down), cat226_hide_button_full_screen);
  1215.         dm_add_button(NULL, get_image(icon4_up), get_image(icon4_down), cat226_hide_button_full_screen);
  1216.     }
  1217.     dm_add_string(str_2, &MMI_default_font, UI_COLOR_BLACK, UI_COLOR_WHITE, NULL);
  1218.     dm_register_button_functions(index, KEY_EVENT_UP, event_callback1);
  1219.     dm_register_button_functions(index++, KEY_EVENT_REPEAT, event_callback1);
  1220.     dm_register_button_functions(index, KEY_EVENT_UP, event_callback2);
  1221.     dm_register_button_functions(index++, KEY_EVENT_REPEAT, event_callback2);
  1222.     dm_register_button_functions(index++, KEY_EVENT_UP, event_callback3);
  1223.     dm_register_button_functions(index++, KEY_EVENT_UP, event_callback4);
  1224.     dm_register_button_functions(index, KEY_EVENT_UP, event_callback5);
  1225.     dm_register_button_functions(index++, KEY_EVENT_REPEAT, event_callback5);
  1226.     dm_register_button_functions(index, KEY_EVENT_UP, event_callback6);
  1227.     dm_register_button_functions(index++, KEY_EVENT_REPEAT, event_callback6);
  1228.     ExitCategoryFunction = ExitCategory226Screen;
  1229.     GetCategoryHistory = dummy_get_history;
  1230.     GetCategoryHistorySize = dummy_get_history_size;
  1231.     dm_data.s32CatId = MMI_CATEGORY226_ID1 + layout;
  1232.     dm_data.s32ScrId = GetActiveScreenId();
  1233.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND | DM_NO_BLT;
  1234.     dm_setup_data(&dm_data);
  1235.     dm_register_category_controlled_callback(area1_call_back);
  1236.     dm_register_category_controlled2_callback(area2_call_back);
  1237.     dm_redraw_category_screen();
  1238.     if (layout == VERTICAL_NORMAL || layout == HORIZONTAL_NORMAL)
  1239.     {
  1240.         *area1_layer = dm_get_layer_handle(0);
  1241.         *area2_layer = dm_get_layer_handle(1);
  1242.     }
  1243.     else
  1244.     {
  1245.         *area1_layer = GDI_ERROR_HANDLE;
  1246.         *area2_layer = dm_get_layer_handle(0);
  1247.     }
  1248. }
  1249. #ifdef __MMI_TOUCH_SCREEN__
  1250. /*****************************************************************************
  1251.  * FUNCTION
  1252.  *  Cat226RegisterPenHandlers
  1253.  * DESCRIPTION
  1254.  *  Register pen event handlers for category control areas in category226
  1255.  * PARAMETERS
  1256.  *  ctrl_area_idx       [IN]        
  1257.  *  pen_hdlr            [IN]        
  1258.  *  event_type          [IN]        
  1259.  * RETURNS
  1260.  *  void
  1261.  *****************************************************************************/
  1262. void Cat226RegisterPenHandlers(U16 ctrl_area_idx, mmi_pen_handler pen_hdlr, mmi_pen_event_type_enum event_type)
  1263. {
  1264.     /*----------------------------------------------------------------*/
  1265.     /* Local Variables                                                */
  1266.     /*----------------------------------------------------------------*/
  1267.     /*----------------------------------------------------------------*/
  1268.     /* Code Body                                                      */
  1269.     /*----------------------------------------------------------------*/
  1270.     if (ctrl_area_idx == 1)
  1271.     {
  1272.         wgui_register_category_screen_control_area_pen_handlers(pen_hdlr, event_type);
  1273.     }
  1274.     else if (ctrl_area_idx == 0)
  1275.     {
  1276.         wgui_register_category_screen_control_area2_pen_handlers(pen_hdlr, event_type);
  1277.     }
  1278.     else
  1279.     {
  1280.         MMI_ASSERT(ctrl_area_idx);
  1281.     }
  1282. }
  1283. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1284. /*****************************************************************************
  1285.  * FUNCTION
  1286.  *  ShowCategory227Screen
  1287.  * DESCRIPTION
  1288.  *  Category screen for image viewer
  1289.  *  one preview area, one image view area.
  1290.  * PARAMETERS
  1291.  *  title_string            [IN]        Title string
  1292.  *  title_icon              [IN]        Title icon
  1293.  *  left_softkey            [IN]        Left softkey string id
  1294.  *  left_softkey_icon       [IN]        Left softkey icon id
  1295.  *  right_softkey           [IN]        Right softkey string id
  1296.  *  right_softkey_icon      [IN]        Right softkey icon id
  1297.  *  display_call_back       [IN]        Event handler application customized area
  1298.  * RETURNS
  1299.  *  void
  1300.  *****************************************************************************/
  1301. void ShowCategory227Screen(
  1302.         U8 *title_string,
  1303.         U16 title_icon,
  1304.         U16 left_softkey,
  1305.         U16 left_softkey_icon,
  1306.         U16 right_softkey,
  1307.         U16 right_softkey_icon,
  1308.         void (*display_call_back) (dm_coordinates *coordinate))
  1309. {
  1310.     /*----------------------------------------------------------------*/
  1311.     /* Local Variables                                                */
  1312.     /*----------------------------------------------------------------*/
  1313.     dm_data_struct dm_data;
  1314.     /*----------------------------------------------------------------*/
  1315.     /* Code Body                                                      */
  1316.     /*----------------------------------------------------------------*/
  1317.     MMI_title_string = (UI_string_type) title_string;
  1318.     MMI_title_icon = get_image(title_icon);
  1319.     change_left_softkey(left_softkey, left_softkey_icon);
  1320.     change_right_softkey(right_softkey, right_softkey_icon);
  1321.     SetupCategoryKeyHandlers();
  1322.     MMI_menu_shortcut_number = -1;
  1323.     ExitCategoryFunction = UI_dummy_function;
  1324.     GetCategoryHistorySize = dummy_get_history_size;
  1325.     GetCategoryHistory = dummy_get_history;
  1326.     RedrawCategoryFunction = dm_redraw_category_screen;
  1327.     dm_data.s32CatId = MMI_CATEGORY227_ID;
  1328.     dm_data.s32ScrId = GetActiveScreenId();
  1329.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  1330.     dm_setup_data(&dm_data);
  1331.     dm_register_category_controlled_callback(display_call_back);
  1332.     dm_redraw_category_screen();
  1333. }
  1334. #ifdef __MMI_SWFLASH__
  1335. /*****************************************************************************
  1336.  * FUNCTION
  1337.  *  SetSWFlashPlayerLayer
  1338.  * DESCRIPTION
  1339.  *  set swflash player layer
  1340.  * PARAMETERS
  1341.  *  layer_handle      [IN]        layer handle
  1342.  * RETURNS
  1343.  *  void
  1344.  *****************************************************************************/
  1345. void SetSWFlashPlayerLayer(GDI_HANDLE layer_handle)
  1346. {
  1347.     /*----------------------------------------------------------------*/
  1348.     /* Local Variables                                                */
  1349.     /*----------------------------------------------------------------*/
  1350.  
  1351.     /*----------------------------------------------------------------*/
  1352.     /* Code Body                                                      */
  1353.     /*----------------------------------------------------------------*/
  1354.     cat_swflash_layer = layer_handle;
  1355. }
  1356. /*****************************************************************************
  1357.  * FUNCTION
  1358.  *  CatSWFlashPlayEnd
  1359.  * DESCRIPTION
  1360.  *  
  1361.  * PARAMETERS
  1362.  *  void
  1363.  * RETURNS
  1364.  *  void
  1365.  *****************************************************************************/
  1366. void CatSWFlashPlayEnd(void)
  1367. {
  1368.     /*----------------------------------------------------------------*/
  1369.     /* Local Variables                                                */
  1370.     /*----------------------------------------------------------------*/
  1371.     /*----------------------------------------------------------------*/
  1372.     /* Code Body                                                      */
  1373.     /*----------------------------------------------------------------*/
  1374.     if (cat_swflash_is_open == MMI_FALSE || cat_swflash_is_play == MMI_FALSE)
  1375.     {
  1376.         /* open file failed or play failed - reutrn error cause */
  1377.         if (cat_swflash_play_finish_callback != NULL)
  1378.         {
  1379.             cat_swflash_play_finish_callback(-1);
  1380.         }
  1381.     }
  1382. }
  1383. /*****************************************************************************
  1384.  * FUNCTION
  1385.  *  DrawCateSWFlashCategoryControlArea
  1386.  * DESCRIPTION
  1387.  *  draw vdo contro area
  1388.  * PARAMETERS
  1389.  *  coordinate      [IN/OUT]        Coord
  1390.  * RETURNS
  1391.  *  void
  1392.  *****************************************************************************/
  1393. void DrawCateSWFlashCategoryControlArea(dm_coordinates *coordinate)
  1394. {
  1395.     /*----------------------------------------------------------------*/
  1396.     /* Local Variables                                                */
  1397.     /*----------------------------------------------------------------*/
  1398.     S32 content_width, content_height;
  1399.     S32 content_offset_x, content_offset_y;
  1400.     /*----------------------------------------------------------------*/
  1401.     /* Code Body                                                      */
  1402.     /*----------------------------------------------------------------*/
  1403.     if (!cat_swflash_is_full_screen)
  1404.     {
  1405.         content_width = MMI_content_width;
  1406.         content_height = MMI_content_height;
  1407.         content_offset_x = MMI_content_x;
  1408.         content_offset_y = MMI_content_y;
  1409.     }
  1410.     else
  1411.     {
  1412.         content_width = UI_device_width;
  1413.         content_height = UI_device_height;
  1414.         content_offset_x = 0;
  1415.         content_offset_y = 0;
  1416.     }
  1417.    /********************************************************************************
  1418.    *  Create Video Layer 
  1419.    ********************************************************************************/
  1420.     /* video is successfully opened, create video playback layer */
  1421.     if (cat_swflash_is_open)
  1422.     {
  1423.         if (cat_swflash_layer == GDI_ERROR_HANDLE || cat_swflash_layer == GDI_LAYER_EMPTY_HANDLE)
  1424.         {/* the swflash layer maybe already set */
  1425.             if (wgui_is_touch_title_bar_buttons())
  1426.             {
  1427.                 dm_create_layer(
  1428.                     content_offset_x,
  1429.                     content_offset_y,
  1430.                     content_width,
  1431.                     content_height,
  1432.                     &cat_swflash_layer,
  1433.                     DM_LAYER_ACTIVE_TOP);
  1434.             }
  1435.             else
  1436.             {
  1437.                 dm_create_layer(
  1438.                     content_offset_x,
  1439.                     content_offset_y,
  1440.                     content_width,
  1441.                     content_height,
  1442.                     &cat_swflash_layer,
  1443.                     DM_LAYER_ACTIVE_BOTTOM);
  1444.             }
  1445.         }
  1446.         /* clear this layer with black */
  1447.         gdi_layer_push_and_set_active(cat_swflash_layer);
  1448.         gdi_layer_clear(GDI_COLOR_BLACK);
  1449.         gdi_layer_pop_and_restore_active();
  1450.         /* Get first frame and start to play */
  1451.         cat_swflash_play_ret = mdi_swflash_play(
  1452.                                 cat_swflash_layer,
  1453.                                 1,                      /* repeat count */
  1454.                                 MDI_DEVICE_SPEAKER2,    /* audio_path */
  1455.                                 cat_swflash_play_finish_callback);     /* play_result_callback */
  1456.         cat_swflash_is_play = (cat_swflash_play_ret >= 0) ? MMI_TRUE : MMI_FALSE;
  1457.     }
  1458. }
  1459. /*****************************************************************************
  1460.  * FUNCTION
  1461.  *  ShowCategory229Screen
  1462.  * DESCRIPTION
  1463.  *  
  1464.  * PARAMETERS
  1465.  *  title_str                   [?]         
  1466.  *  title_icon                  [IN]        
  1467.  *  lsk_str                     [IN]        
  1468.  *  lsk_icon                    [IN]        
  1469.  *  rsk_str                     [IN]        
  1470.  *  rsk_icon                    [IN]        
  1471.  *  resource_id                 [IN]        
  1472.  *  resource_filename           [IN]        
  1473.  *  repeat_count                [IN]        
  1474.  *  is_play_audio               [IN]        
  1475.  *  is_vibrate_on               [IN]        
  1476.  *  is_interaction_on           [IN]        
  1477.  *  is_lcd_no_sleep             [IN]        
  1478.  *  is_full_screen              [IN]        
  1479.  *  bg_color                    [IN]        
  1480.  *  play_finish_callback        [IN]        
  1481.  *  gui_buffer                  [?]         
  1482.  * RETURNS
  1483.  *  void
  1484.  *****************************************************************************/
  1485. void ShowCategory229Screen(
  1486.         U8 *title_str,
  1487.         U16 title_icon,
  1488.         U16 lsk_str,
  1489.         U16 lsk_icon,
  1490.         U16 rsk_str,
  1491.         U16 rsk_icon,
  1492.         U16 resource_id,
  1493.         PS8 resource_filename,
  1494.         U16 repeat_count,
  1495.         MMI_BOOL is_play_audio,
  1496.         MMI_BOOL is_vibrate_on,
  1497.         MMI_BOOL is_interaction_on,
  1498.         MMI_BOOL is_lcd_no_sleep,
  1499.         MMI_BOOL is_full_screen,
  1500.         GDI_COLOR bg_color,
  1501.         void (*play_finish_callback) (MDI_RESULT),
  1502.         void *gui_buffer)
  1503. {
  1504.     /*----------------------------------------------------------------*/
  1505.     /* Local Variables                                                */
  1506.     /*----------------------------------------------------------------*/
  1507.     dm_data_struct dm_data;
  1508.     U16 btn_prev_item_id, btn_next_item_id;
  1509.     U32 playmode;
  1510.     MDI_RESULT mfh_ret;
  1511.     /*----------------------------------------------------------------*/
  1512.     /* Code Body                                                      */
  1513.     /*----------------------------------------------------------------*/
  1514.     /* init var */
  1515.     cat_swflash_is_from_id = (resource_id != 0) ? MMI_TRUE : MMI_FALSE;
  1516.     cat_swflash_is_audio_on = is_play_audio;
  1517.     cat_swflash_is_vibrate_on = is_vibrate_on;
  1518.     cat_swflash_is_interaction_on = is_interaction_on;
  1519.     cat_swflash_is_lcd_no_sleep = is_lcd_no_sleep;
  1520.     cat_swflash_play_finish_callback = play_finish_callback;
  1521.     cat_swflash_is_full_screen = is_full_screen;
  1522.     /* setup keys */
  1523.     set_left_softkey_label(get_string(lsk_str));
  1524.     set_left_softkey_icon(get_image(lsk_icon));
  1525.     set_right_softkey_label(get_string(rsk_str));
  1526.     set_right_softkey_icon(get_image(rsk_icon));
  1527.     SetupCategoryKeyHandlers();
  1528.     /* setup title */
  1529.     MMI_title_string = (UI_string_type) title_str;
  1530.     MMI_title_icon = NULL;
  1531.     MMI_menu_shortcut_number = -1;
  1532.     /* setup top selection bar */
  1533.     if (wgui_is_touch_title_bar_buttons())
  1534.     {
  1535.         wgui_set_wallpaper_on_bottom(MMI_TRUE);
  1536.         
  1537.         btn_prev_item_id = dm_add_button(
  1538.                             NULL,
  1539.                             get_image(LEFT_RED_ARROW),
  1540.                             get_image(LEFT_RED_ARROW),
  1541.                             cat226_hide_button_full_screen);
  1542.         btn_next_item_id = dm_add_button(
  1543.                             NULL,
  1544.                             get_image(RIGHT_RED_ARROW),
  1545.                             get_image(RIGHT_RED_ARROW),
  1546.                             cat226_hide_button_full_screen);
  1547.         title_bg_id = IMAGE_VIEW_TITLEBAR_BG;   /* for showing different title bar. */
  1548.     #if defined(__MMI_TOUCH_SCREEN__)
  1549.         /* register the handler for pen event down istead of pen event up. */
  1550.         dm_register_button_functions(btn_prev_item_id, KEY_EVENT_UP, gMMI_touch_title_button1_down_handler);
  1551.         dm_register_button_functions(btn_next_item_id, KEY_EVENT_UP, gMMI_touch_title_button2_down_handler);
  1552.     #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1553.     }
  1554.     /* Start SWFlash handling */
  1555.     /* stop MMI sleep */
  1556.     if (cat_swflash_is_lcd_no_sleep)
  1557.     {
  1558.         TurnOnBacklight(0);
  1559.     }
  1560.     /* set audio volumn */
  1561.     if (gui_buffer == NULL)
  1562.     {
  1563.         /* first time enter */
  1564.         cat_swflash_audio_volumn = LEVEL5;
  1565.     }
  1566.     if (cat_swflash_is_audio_on)
  1567.     {
  1568.         /* init audio volumn */
  1569.         mdi_audio_set_volume(MDI_VOLUME_MEDIA, cat_swflash_audio_volumn);
  1570.         /* full screen play do not allows vol adjustment */
  1571.         if (!is_full_screen)
  1572.         {
  1573.             SetKeyHandler(CatVdoplyVolUp, KEY_VOL_UP, KEY_EVENT_DOWN);
  1574.             SetKeyHandler(CatVdoplyVolDown, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  1575.         }
  1576.         /* suspend background audio */
  1577.         mdi_audio_suspend_background_play();
  1578.     }
  1579.     /*
  1580.      * user may request to repeat play many times, and wants a callback bewteen each play,
  1581.      * so we have to handle repeat play within this category by seeking to first frame 
  1582.      * after play finished each time, instead of using driver's repeat play.
  1583.      */
  1584.     cat_swflash_repeat_count = (repeat_count == 0) ? 0xffff : repeat_count;      /* 0xff means infinte play */
  1585.     if (repeat_count != 0)
  1586.     {
  1587.         cat_swflash_repeat_count--;
  1588.     }
  1589.    /********************************************************************************
  1590.    *  Open SWFlash
  1591.    ********************************************************************************/
  1592. #if 0
  1593. /* under construction !*/
  1594. /* under construction !*/
  1595. /* under construction !*/
  1596. /* under construction !*/
  1597. /* under construction !*/
  1598. /* under construction !*/
  1599. /* under construction !*/
  1600. /* under construction !*/
  1601. /* under construction !*/
  1602. /* under construction !*/
  1603. /* under construction !*/
  1604. /* under construction !*/
  1605. /* under construction !*/
  1606. /* under construction !*/
  1607. #endif 
  1608.     if (is_play_audio)
  1609.     {
  1610.         playmode = CIM_PLAYERMODE;
  1611.     }
  1612.     else
  1613.     {
  1614.         playmode = CIM_DESKTOPMODE;
  1615.     }
  1616.     if (resource_id != 0)
  1617.     {
  1618.         /* source from id */
  1619.         /* always open with audio, if do not want audio, mute it by calling mdi function */
  1620.         mfh_ret = mdi_swflash_open_id(resource_id, playmode, &wgui_swflash_info);
  1621.         cat_swflash_is_open = (mfh_ret >= 0) ? MMI_TRUE : MMI_FALSE;
  1622.     }
  1623.     else if (resource_filename != NULL)
  1624.     {
  1625.         /* source from file */
  1626.         /* always open with audio, if do not want audio, dsiable it in play function */
  1627.         mfh_ret = mdi_swflash_open_file(resource_filename, playmode, &wgui_swflash_info);
  1628.         cat_swflash_is_open = (mfh_ret >= 0) ? MMI_TRUE : MMI_FALSE;
  1629.     }
  1630.     else
  1631.     {
  1632.         /* no proper source */
  1633.         MMI_ASSERT(0);
  1634.     }
  1635.     /* setup draw manager functions */
  1636.     ExitCategoryFunction = ExitCategorySWFlashScreen;
  1637.     dm_setup_category_functions(dm_redraw_category_screen, dummy_get_history, dummy_get_history_size);
  1638.     if (wgui_is_touch_title_bar_buttons())
  1639.     {
  1640.         dm_data.s32CatId = MMI_CATEGORY229_ID;
  1641.     }
  1642.     else
  1643.     {
  1644.         dm_data.s32CatId = MMI_CATEGORY_VDOPLY;
  1645.     }
  1646.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  1647.     if (is_full_screen)
  1648.     {
  1649.         if (wgui_is_touch_title_bar_buttons())
  1650.         {
  1651.             dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  1652.         }
  1653.         else
  1654.         {
  1655.             dm_data.s32flags = DM_NO_TITLE | DM_NO_STATUS_BAR | DM_NO_SOFTKEY;
  1656.         }
  1657.     }
  1658.     else
  1659.     {
  1660.         dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  1661.     }
  1662.     dm_setup_data(&dm_data);
  1663.     dm_register_category_controlled_callback(DrawCateSWFlashCategoryControlArea);
  1664.     dm_redraw_category_screen();
  1665.     CatSWFlashPlayEnd();
  1666. }
  1667. /*****************************************************************************
  1668.  * FUNCTION
  1669.  *  ExitCategorySWFlashScreen
  1670.  * DESCRIPTION
  1671.  *  Exit Category 224 screen
  1672.  * PARAMETERS
  1673.  *  void
  1674.  * RETURNS
  1675.  *  void
  1676.  *****************************************************************************/
  1677. void ExitCategorySWFlashScreen(void)
  1678.     {
  1679.     /*----------------------------------------------------------------*/
  1680.     /* Local Variables                                                */
  1681.     /*----------------------------------------------------------------*/
  1682.     /*----------------------------------------------------------------*/
  1683.     /* Code Body                                                      */
  1684.     /*----------------------------------------------------------------*/
  1685.     if (cat_swflash_is_open)
  1686.     {
  1687.         /* stop video playing */
  1688.         if (cat_swflash_is_play)
  1689.         {
  1690.             mdi_swflash_stop();
  1691.             cat_swflash_is_play = MMI_FALSE;
  1692.         }
  1693.         /* close video source */
  1694.         if (cat_swflash_is_from_id)
  1695.         {
  1696.             /* source from id */
  1697.             mdi_swflash_close_id();
  1698.             cat_swflash_is_open = MMI_FALSE;
  1699.         }
  1700.         else
  1701.         {
  1702.             /* source from file */
  1703.             mdi_swflash_close_file();
  1704.             cat_swflash_is_open = MMI_FALSE;
  1705.         }
  1706.     }
  1707.     cat_swflash_is_open = MMI_FALSE;
  1708.     cat_swflash_is_play = MMI_FALSE;
  1709.     cat_swflash_is_from_id = MMI_FALSE;
  1710.     cat_swflash_layer = GDI_ERROR_HANDLE;
  1711.     cat_swflash_play_finish_callback = NULL;
  1712.     cat_swflash_play_ret = 0;
  1713.     /* let MMI can sleep */
  1714.     if (cat_swflash_is_lcd_no_sleep)
  1715.     {
  1716.         TurnOffBacklight();
  1717.     }
  1718.     if (cat_swflash_is_audio_on)
  1719.     {
  1720.         /* resume background audio */
  1721.         mdi_audio_resume_background_play();
  1722.     }
  1723.     if (wgui_is_touch_title_bar_buttons())
  1724.     {
  1725.         title_bg_id = 0;
  1726.         if (gBlack_buf != NULL)
  1727.         {
  1728.             mmi_frm_scrmem_free(gBlack_buf);
  1729.         }
  1730.         gBlack_buf = NULL;
  1731.         gBlack_layer = NULL;
  1732.         entry_full_screen();
  1733.     }
  1734.     wgui_reset_touch_title_bar_buttons();
  1735. }
  1736. /*****************************************************************************
  1737.  * FUNCTION
  1738.  *  GetCat34MediaType
  1739.  * DESCRIPTION
  1740.  *  Get category34 background media type
  1741.  * PARAMETERS
  1742.  *  void
  1743.  * RETURNS
  1744.  *  S32
  1745.  *****************************************************************************/
  1746. S32 GetCat34MediaType(void)
  1747. {
  1748.     /*----------------------------------------------------------------*/
  1749.     /* Local Variables                                                */
  1750.     /*----------------------------------------------------------------*/
  1751.  
  1752.     /*----------------------------------------------------------------*/
  1753.     /* Code Body                                                      */
  1754.     /*----------------------------------------------------------------*/
  1755.     return g_mmi_idle_bg_media_type;
  1756. }
  1757. /*****************************************************************************
  1758.  * FUNCTION
  1759.  *  SetCat34MediaType
  1760.  * DESCRIPTION
  1761.  *  Get category34 background media type
  1762.  * PARAMETERS
  1763.  *  void
  1764.  * RETURNS
  1765.  *  S32
  1766.  *****************************************************************************/
  1767. void SetCat34MediaType(S32 media_type)
  1768. {
  1769.     /*----------------------------------------------------------------*/
  1770.     /* Local Variables                                                */
  1771.     /*----------------------------------------------------------------*/
  1772.  
  1773.     /*----------------------------------------------------------------*/
  1774.     /* Code Body                                                      */
  1775.     /*----------------------------------------------------------------*/
  1776.     g_mmi_idle_bg_media_type = media_type;
  1777. }
  1778. /*****************************************************************************
  1779.  * FUNCTION
  1780.  *  SetupCat34Media
  1781.  * DESCRIPTION
  1782.  *  Setup category34 background media type
  1783.  * PARAMETERS
  1784.  *  void
  1785.  * RETURNS
  1786.  *  void
  1787.  *****************************************************************************/
  1788. mdi_result SetupCat34Media(U16 bg_media_id, S8 *bg_media_filename)
  1789. {
  1790.     /*----------------------------------------------------------------*/
  1791.     /* Local Variables                                                */
  1792.     /*----------------------------------------------------------------*/
  1793.     mdi_result mfh_ret = 0;
  1794.     /*----------------------------------------------------------------*/
  1795.     /* Code Body                                                      */
  1796.     /*----------------------------------------------------------------*/
  1797.     if (dispchar_iswp_swflash() == MMI_TRUE)
  1798.     {
  1799.         g_mmi_idle_bg_media_type = MMI_IDLE_BG_MEDIA_SWFLASH;
  1800.     }
  1801.     else
  1802.     {
  1803.         g_mmi_idle_bg_media_type = MMI_IDLE_BG_MEDIA_IMG;
  1804.     }
  1805.     if (g_mmi_idle_bg_media_type == MMI_IDLE_BG_MEDIA_SWFLASH)
  1806.     {
  1807.         if(bg_media_id == 0xFFFF && bg_media_filename == NULL)
  1808.         {
  1809.             bg_media_id = PhnsetGetCurWallPaperIdx();
  1810.             bg_media_filename = idle_screen_wallpaper_name;
  1811.         }
  1812.     
  1813.         /********************************************************************************
  1814.         *  SWFlash Setting
  1815.         ********************************************************************************/
  1816.         cat_swflash_is_full_screen = MMI_TRUE;
  1817.         cat_swflash_repeat_count = 1;
  1818.         cat_swflash_audio_volumn = LEVEL5;
  1819.         cat_swflash_is_audio_on = MMI_FALSE;
  1820.         cat_swflash_is_vibrate_on = MMI_FALSE;
  1821.         cat_swflash_is_interaction_on = MMI_FALSE;
  1822.         cat_swflash_is_lcd_no_sleep = MMI_FALSE;
  1823.         /********************************************************************************
  1824.         *  Open SWFlash
  1825.         ********************************************************************************/
  1826.         
  1827.         if (bg_media_id != 0)
  1828.         {
  1829.             cat_swflash_is_from_id = MMI_TRUE;
  1830.             /* source from id */
  1831.             /* always open with audio, if do not want audio, mute it by calling mdi function */
  1832.             mfh_ret = mdi_swflash_open_id(bg_media_id, CIM_DESKTOPMODE, &wgui_swflash_info);
  1833.             cat_swflash_is_open = (mfh_ret >= 0) ? MMI_TRUE : MMI_FALSE;
  1834.         }
  1835.         else if (bg_media_filename!= NULL)
  1836.         {
  1837.             cat_swflash_is_from_id = MMI_FALSE;
  1838.             /* source from file */
  1839.             /* always open with audio, if do not want audio, dsiable it in play function */
  1840.             mfh_ret = mdi_swflash_open_file(bg_media_filename, CIM_DESKTOPMODE, &wgui_swflash_info);
  1841.             cat_swflash_is_open = (mfh_ret >= 0) ? MMI_TRUE : MMI_FALSE;
  1842.         }
  1843.         else
  1844.         {
  1845.          /* no proper source */
  1846.          MMI_ASSERT(0);
  1847.         }
  1848.     }
  1849.     else /* g_mmi_idle_bg_media_type == MMI_IDLE_BG_MEDIA_SWFLASH */
  1850.     {
  1851.         return 0;
  1852.     }
  1853.     return mfh_ret;
  1854. }
  1855. /*****************************************************************************
  1856.  * FUNCTION
  1857.  *  HandleCat34MediaPlay
  1858.  * DESCRIPTION
  1859.  *  Handle media play error
  1860.  * PARAMETERS
  1861.  *  void
  1862.  * RETURNS
  1863.  *  void
  1864.  *****************************************************************************/
  1865. void HandleCat34MediaPlayFailed(void)
  1866. {
  1867.     /*----------------------------------------------------------------*/
  1868.     /* Local Variables                                                */
  1869.     /*----------------------------------------------------------------*/
  1870.     /*----------------------------------------------------------------*/
  1871.     /* Code Body                                                      */
  1872.     /*----------------------------------------------------------------*/
  1873.     if ( g_mmi_idle_bg_media_type == MMI_IDLE_BG_MEDIA_SWFLASH)
  1874.     {
  1875.         if (cat_swflash_is_open == MMI_FALSE || cat_swflash_play_ret < 0)
  1876.         {
  1877.                 PhnsetWallpaperBadFileCallBack(0);
  1878.                 g_mmi_idle_bg_media_type = MMI_IDLE_BG_MEDIA_IMG;
  1879.         }
  1880.     }
  1881. }
  1882. /*****************************************************************************
  1883.  * FUNCTION
  1884.  *  ShowCategory34Screen
  1885.  * DESCRIPTION
  1886.  *  
  1887.  * PARAMETERS
  1888.  *  left_softkey            [IN]
  1889.  *  left_softkey_icon       [IN]
  1890.  *  right_softkey           [IN]
  1891.  *  right_softkey_icon      [IN]
  1892.  *  bg_media_id             [IN]
  1893.  *  bg_media_filename       [IN]
  1894.  *  history_buffer          [?]         
  1895.  * RETURNS
  1896.  *  void
  1897.  *****************************************************************************/
  1898. void ShowCategory34Screen(
  1899.         U16 left_softkey,
  1900.         U16 left_softkey_icon,
  1901.         U16 right_softkey,
  1902.         U16 right_softkey_icon,
  1903.         U16 bg_media_id,
  1904.         S8 *bg_media_filename,
  1905.         U8 *history_buffer)
  1906. {
  1907.     /*----------------------------------------------------------------*/
  1908.     /* Local Variables                                                */
  1909.     /*----------------------------------------------------------------*/
  1910.     dm_data_struct dm_data;
  1911.     /*----------------------------------------------------------------*/
  1912.     /* Code Body                                                      */
  1913.     /*----------------------------------------------------------------*/
  1914.     if (dispchar_iswp_swflash() == MMI_TRUE)
  1915.     {
  1916.         g_mmi_idle_bg_media_type = MMI_IDLE_BG_MEDIA_SWFLASH;
  1917.     }
  1918.     else
  1919.     {
  1920.         g_mmi_idle_bg_media_type = MMI_IDLE_BG_MEDIA_IMG;
  1921.     }
  1922.     /********************************************************************************
  1923.     *  IdleScreen
  1924.     ********************************************************************************/
  1925.     ShowCategory33Screen_ext(
  1926.         left_softkey,
  1927.         left_softkey_icon,
  1928.         right_softkey,
  1929.         right_softkey_icon,
  1930.         history_buffer);
  1931.     /********************************************************************************
  1932.     *  SWFlash Setting
  1933.     ********************************************************************************/
  1934.     SetupCat34Media(bg_media_id, bg_media_filename);
  1935.     ExitCategoryFunction = ExitCategory34Screen;
  1936.     GetCategoryHistory = dummy_get_history;
  1937.     GetCategoryHistorySize = dummy_get_history_size;
  1938.     RedrawCategoryFunction = dm_redraw_category_screen;
  1939.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  1940.     if ( g_mmi_idle_bg_media_type == MMI_IDLE_BG_MEDIA_IMG )
  1941.     {
  1942.         dm_data.s32CatId = MMI_CATEGORY33_ID;
  1943.         dm_register_category_controlled_callback(NULL);
  1944.     }
  1945.     else if ( g_mmi_idle_bg_media_type == MMI_IDLE_BG_MEDIA_SWFLASH )
  1946.     {
  1947.         dm_data.s32CatId = MMI_CATEGORY34_ID;
  1948.         dm_register_category_controlled_callback(DrawCateSWFlashCategoryControlArea);
  1949.     }
  1950.     dm_data.s32flags = 0;
  1951. #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__
  1952.     if (mmi_bootup_get_active_flight_mode() == 0)
  1953.     {
  1954.         dm_data.s32flags |= DM_NO_SOFTKEY;
  1955.     }
  1956. #endif /* __MMI_TOUCH_IDLESCREEN_SHORTCUTS__ */ 
  1957.     dm_data.s32flags |= DM_CLEAR_SCREEN_BACKGROUND;
  1958.     dm_setup_data(&dm_data);
  1959.     dm_register_category_controlled2_callback(dm_category_33_controlled_area);
  1960.     dm_redraw_category_screen();
  1961.     HandleCat34MediaPlayFailed();
  1962. }
  1963. void ExitCategory34Screen(void)
  1964. {
  1965.     /*----------------------------------------------------------------*/
  1966.     /* Local Variables                                                */
  1967.     /*----------------------------------------------------------------*/
  1968.     /*----------------------------------------------------------------*/
  1969.     /* Code Body                                                      */
  1970.     /*----------------------------------------------------------------*/
  1971.     if ( g_mmi_idle_bg_media_type == MMI_IDLE_BG_MEDIA_SWFLASH )
  1972.     {
  1973.         ExitCategorySWFlashScreen();
  1974.     }
  1975.     ExitCategory33Screen();
  1976. }
  1977. #endif /* __MMI_SWFLASH__ */ 
  1978. /****************************************************************************
  1979. *
  1980. * MultiMedia Related [SubLCD] Categories
  1981. *
  1982. *****************************************************************************/
  1983. /*****************************************************************************
  1984. * [Category331] [SUB]
  1985. *
  1986. * This category is a empty SubLCD category.
  1987. *
  1988. *  ****************
  1989. *  *              *
  1990. *  *              *
  1991. *  *              *
  1992. *  *              *
  1993. *  *              *
  1994. *  ****************
  1995. *
  1996. *****************************************************************************/
  1997. /*****************************************************************************
  1998.  * FUNCTION
  1999.  *  ShowCategory331Screen
  2000.  * DESCRIPTION
  2001.  *  Enter Category 331 Screen
  2002.  * PARAMETERS
  2003.  *  void
  2004.  * RETURNS
  2005.  *  void
  2006.  *****************************************************************************/
  2007. void ShowCategory331Screen(void)
  2008. {
  2009. #ifdef __MMI_SUBLCD__
  2010.     /*----------------------------------------------------------------*/
  2011.     /* Local Variables                                                */
  2012.     /*----------------------------------------------------------------*/
  2013.     /*----------------------------------------------------------------*/
  2014.     /* Code Body                                                      */
  2015.     /*----------------------------------------------------------------*/
  2016.     GDI_LOCK;
  2017.     SUBLCD_ExitCategoryFunction();
  2018.     hide_status_icon_bar(2);
  2019.     SUBLCD_ExitCategoryFunction = ExitCategory331Screen;
  2020.     SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
  2021.     SUBLCD_GetCategoryHistory = dummy_get_history;
  2022.     SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
  2023.     GDI_UNLOCK;
  2024. #endif /* __MMI_SUBLCD__ */ 
  2025. }
  2026. /*****************************************************************************
  2027.  * FUNCTION
  2028.  *  ExitCategory331Screen
  2029.  * DESCRIPTION
  2030.  *  Exit Category 331 Screen
  2031.  * PARAMETERS
  2032.  *  void
  2033.  * RETURNS
  2034.  *  void
  2035.  *****************************************************************************/
  2036. #ifdef __MMI_SUBLCD__
  2037. static void ExitCategory331Screen(void)
  2038. {
  2039.     /*----------------------------------------------------------------*/
  2040.     /* Local Variables                                                */
  2041.     /*----------------------------------------------------------------*/
  2042.     /*----------------------------------------------------------------*/
  2043.     /* Code Body                                                      */
  2044.     /*----------------------------------------------------------------*/
  2045.     SUBLCD_ExitCategoryFunction = MMI_dummy_function;
  2046.     SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
  2047.     SUBLCD_GetCategoryHistory = dummy_get_history;
  2048.     SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
  2049. }
  2050. #endif /* __MMI_SUBLCD__ */ 
  2051. /*****************************************************************************
  2052. * [Category332] [SUB]
  2053. *
  2054. * This category is to draw a image on sublcd
  2055. *
  2056. *  ****************
  2057. *  *              *
  2058. *  *              *
  2059. *  *  [ Image ]   *
  2060. *  *              *
  2061. *  *              *
  2062. *  ****************
  2063. *
  2064. *****************************************************************************/
  2065. /*****************************************************************************
  2066.  * FUNCTION
  2067.  *  ShowCategory332Screen
  2068.  * DESCRIPTION
  2069.  *  Enter Category 332 Screen
  2070.  * PARAMETERS
  2071.  *  image_id        [IN]        Image id
  2072.  * RETURNS
  2073.  *  void
  2074.  *****************************************************************************/
  2075. void ShowCategory332Screen(MMI_ID_TYPE image_id)
  2076. {
  2077. #ifdef __MMI_SUBLCD__
  2078.     /*----------------------------------------------------------------*/
  2079.     /* Local Variables                                                */
  2080.     /*----------------------------------------------------------------*/
  2081.     S32 image_width;
  2082.     S32 image_height;
  2083.     /*----------------------------------------------------------------*/
  2084.     /* Code Body                                                      */
  2085.     /*----------------------------------------------------------------*/
  2086.     GDI_LOCK;
  2087.     SUBLCD_ExitCategoryFunction();
  2088.     UI_set_sub_LCD_graphics_context();
  2089.     hide_status_icon_bar(2);
  2090.     gdi_layer_reset_clip();
  2091.     gdi_layer_clear(GDI_COLOR_WHITE);
  2092.     if (image_id != 0)
  2093.     {
  2094.         gdi_image_get_dimension_id(image_id, &image_width, &image_height);
  2095.         gdi_image_draw_id((UI_device_width - image_width) >> 1, (UI_device_height - image_height) >> 1, image_id);
  2096.     }
  2097.     gdi_layer_blt_base_layer(0, 0, UI_device_width - 1, UI_device_height - 1);
  2098.     SUBLCD_ExitCategoryFunction = ExitCategory332Screen;
  2099.     SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
  2100.     SUBLCD_GetCategoryHistory = dummy_get_history;
  2101.     SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
  2102.     UI_set_main_LCD_graphics_context();
  2103.     GDI_UNLOCK;
  2104. #endif /* __MMI_SUBLCD__ */ 
  2105. }
  2106. /*****************************************************************************
  2107.  * FUNCTION
  2108.  *  ExitCategory332Screen
  2109.  * DESCRIPTION
  2110.  *  Exit Category 332 Screen
  2111.  * PARAMETERS
  2112.  *  void
  2113.  * RETURNS
  2114.  *  void
  2115.  *****************************************************************************/
  2116. #ifdef __MMI_SUBLCD__
  2117. static void ExitCategory332Screen(void)
  2118. {
  2119.     /*----------------------------------------------------------------*/
  2120.     /* Local Variables                                                */
  2121.     /*----------------------------------------------------------------*/
  2122.     /*----------------------------------------------------------------*/
  2123.     /* Code Body                                                      */
  2124.     /*----------------------------------------------------------------*/
  2125.     SUBLCD_ExitCategoryFunction = MMI_dummy_function;
  2126.     SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
  2127.     SUBLCD_GetCategoryHistory = dummy_get_history;
  2128.     SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
  2129. }
  2130. #endif /* __MMI_SUBLCD__ */ 
  2131. /*****************************************************************************
  2132. * [Category333] [SUB]
  2133. *
  2134. * This category is for audio player sub display.
  2135. *
  2136. *  ****************
  2137. *  *              *
  2138. *  *              *
  2139. *  *  XXXXXXXXX   *
  2140. *  *              *
  2141. *  *              *
  2142. *  ****************
  2143. *
  2144. *****************************************************************************/
  2145. /*****************************************************************************
  2146.  * FUNCTION
  2147.  *  ShowCategory333Screen
  2148.  * DESCRIPTION
  2149.  *  Enter Category 333 Screen
  2150.  * PARAMETERS
  2151.  *  void
  2152.  * RETURNS
  2153.  *  void
  2154.  *****************************************************************************/
  2155. void ShowCategory333Screen(void)
  2156. {
  2157. #ifdef __MMI_SUBLCD__
  2158.     /*----------------------------------------------------------------*/
  2159.     /* Local Variables                                                */
  2160.     /*----------------------------------------------------------------*/
  2161.     /*----------------------------------------------------------------*/
  2162.     /* Code Body                                                      */
  2163.     /*----------------------------------------------------------------*/
  2164.     GDI_LOCK;
  2165.     SUBLCD_ExitCategoryFunction();
  2166.     UI_set_sub_LCD_graphics_context();
  2167.     gui_lock_double_buffer();
  2168.     register_hide_status_icon_bar(2, SUBLCD_screens_hide_status_icons);
  2169.     show_status_icon_bar(2);
  2170.     gui_unlock_double_buffer();
  2171.     SUBLCD_ExitCategoryFunction = ExitCategory333Screen;
  2172.     SUBLCD_RedrawCategoryFunction = RedrawCategory333Screen;
  2173.     SUBLCD_GetCategoryHistory = GetCategory333History;
  2174.     SUBLCD_GetCategoryHistorySize = GetCategory333HistorySize;
  2175.     RedrawCategory333Screen();
  2176.     UI_set_main_LCD_graphics_context();
  2177.     GDI_UNLOCK;
  2178. #endif /* __MMI_SUBLCD__ */ 
  2179. }
  2180. /*****************************************************************************
  2181.  * FUNCTION
  2182.  *  ExitCategory333Screen
  2183.  * DESCRIPTION
  2184.  *  Exit Category 333 Screen
  2185.  * PARAMETERS
  2186.  *  void
  2187.  * RETURNS
  2188.  *  void
  2189.  *****************************************************************************/
  2190. #ifdef __MMI_SUBLCD__
  2191. static void ExitCategory333Screen(void)
  2192. {
  2193.     /*----------------------------------------------------------------*/
  2194.     /* Local Variables                                                */
  2195.     /*----------------------------------------------------------------*/
  2196.     /*----------------------------------------------------------------*/
  2197.     /* Code Body                                                      */
  2198.     /*----------------------------------------------------------------*/
  2199.     UI_set_sub_LCD_graphics_context();
  2200.     close_status_icons();
  2201. #ifdef __MMI_AUDIO_PLAYER__
  2202.     mmi_audply_exit_subLCD();
  2203. #endif 
  2204. #ifdef __MMI_FM_RADIO__
  2205.     mmi_fmrdo_exit_subLCD();
  2206. #endif 
  2207.     gui_hide_animations();
  2208.     SUBLCD_ExitCategoryFunction = MMI_dummy_function;
  2209.     SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
  2210.     SUBLCD_GetCategoryHistory = dummy_get_history;
  2211.     SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
  2212.     UI_set_main_LCD_graphics_context();
  2213. }
  2214. #endif /* __MMI_SUBLCD__ */ 
  2215. /*****************************************************************************
  2216.  * FUNCTION
  2217.  *  RedrawCategory333Screen
  2218.  * DESCRIPTION
  2219.  *  Redraw Category 333 Screen
  2220.  * PARAMETERS
  2221.  *  void
  2222.  * RETURNS
  2223.  *  void
  2224.  *****************************************************************************/
  2225. #ifdef __MMI_SUBLCD__
  2226. static void RedrawCategory333Screen(void)
  2227. {
  2228.     /*----------------------------------------------------------------*/
  2229.     /* Local Variables                                                */
  2230.     /*----------------------------------------------------------------*/
  2231.     color c = gui_color(0, 0, 0);
  2232.     /*----------------------------------------------------------------*/
  2233.     /* Code Body                                                      */
  2234.     /*----------------------------------------------------------------*/
  2235.     UI_set_sub_LCD_graphics_context();
  2236.     gui_lock_double_buffer();
  2237. #ifndef __MMI_SUB_WALLPAPER__
  2238.     show_sublcd_status_background(0, 0, (UI_device_width - 1), (UI_device_height - 1), MMI_FALSE);
  2239. #endif 
  2240.     SUBLCD_screens_show_status_icons();
  2241.     gui_draw_horizontal_line(0, UI_device_width - 1, 54, c);
  2242. #ifdef __MMI_AUDIO_PLAYER__
  2243.     if (mmi_audply_is_playing())
  2244.     {
  2245.         mmi_audply_redraw_subLCD(TRUE);
  2246.     }
  2247. #endif /* __MMI_AUDIO_PLAYER__ */ 
  2248. #ifdef __MMI_FM_RADIO__
  2249.     if (mmi_fmrdo_is_power_on())
  2250.     {
  2251.         mmi_fmrdo_redraw_subLCD(TRUE);
  2252.     }
  2253. #endif /* __MMI_FM_RADIO__ */ 
  2254.     gui_unlock_double_buffer();
  2255.     gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
  2256.     UI_set_main_LCD_graphics_context();
  2257. }
  2258. #endif /* __MMI_SUBLCD__ */ 
  2259. /*****************************************************************************
  2260.  * FUNCTION
  2261.  *  GetCategory333HistorySize
  2262.  * DESCRIPTION
  2263.  *  Get Category 333 History Size
  2264.  * PARAMETERS
  2265.  *  void
  2266.  * RETURNS
  2267.  *  void
  2268.  *****************************************************************************/
  2269. #ifdef __MMI_SUBLCD__
  2270. static S32 GetCategory333HistorySize(void)
  2271. {
  2272.     /*----------------------------------------------------------------*/
  2273.     /* Local Variables                                                */
  2274.     /*----------------------------------------------------------------*/
  2275.     /*----------------------------------------------------------------*/
  2276.     /* Code Body                                                      */
  2277.     /*----------------------------------------------------------------*/
  2278.     return (0);
  2279. }
  2280. #endif /* __MMI_SUBLCD__ */ 
  2281. /*****************************************************************************
  2282.  * FUNCTION
  2283.  *  GetCategory333History
  2284.  * DESCRIPTION
  2285.  *  *   Get Category 333 History
  2286.  * PARAMETERS
  2287.  *  history_buffer      [?]     
  2288.  * RETURNS
  2289.  *  void
  2290.  *****************************************************************************/
  2291. #ifdef __MMI_SUBLCD__
  2292. static U8 *GetCategory333History(U8 *history_buffer)
  2293. {
  2294.     /*----------------------------------------------------------------*/
  2295.     /* Local Variables                                                */
  2296.     /*----------------------------------------------------------------*/
  2297.     /*----------------------------------------------------------------*/
  2298.     /* Code Body                                                      */
  2299.     /*----------------------------------------------------------------*/
  2300.     return (history_buffer);
  2301. }
  2302. #endif /* __MMI_SUBLCD__ */