⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fmradiomainscreen.c

📁 mtk平台的调频收音机的mmi部分! 可以了解mtk调频收音机的用户界面!
💻 C
📖 第 1 页 / 共 5 页
字号:
    fmrdo_main_draw.volume_inc_button.down = FALSE;
    fmrdo_main_draw.setting_button.down = FALSE;

    fmrdo_pen_event_on_object = FMRDO_PEN_NONE;
#endif /* __MMI_TOUCH_SCREEN__ */ 

#ifdef __MMI_FM_RADIO_ANIMATION__
    /* stop animation */
    mmi_fmrdo_animation_stop();
#endif /* __MMI_FM_RADIO_ANIMATION__ */ 
    /* associate functions */
    ExitCategoryFunction = MMI_dummy_function;
    RedrawCategoryFunction = MMI_dummy_function;
    GetCategoryHistory = dummy_get_history;
    GetCategoryHistorySize = dummy_get_history_size;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_fmrdo_redraw_main_LSK_down
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_fmrdo_redraw_main_LSK_down(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 str_w, str_h;
    S32 x1, y1, x2, y2;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#if(UI_DOUBLE_BUFFER_SUPPORT)
    gui_lock_double_buffer();
#endif 
    gui_set_font(&MMI_medium_font);
    gui_set_text_color(fmrdo_main_draw.LSK_text_color);
    gui_set_text_border_color(fmrdo_main_draw.LSK_text_border_color);

    /* show LSK */
    gui_measure_string(fmrdo_main_draw.LSK_text, &str_w, &str_h);
    x1 = FMRDO_LSK_X_OFFSET;
    y1 = UI_device_height - str_h - FMRDO_LSK_Y_OFFSET;
    x2 = str_w + FMRDO_LSK_X_OFFSET;
    y2 = UI_device_height - FMRDO_LSK_Y_OFFSET;
    gui_push_clip();
    gui_set_clip(x1 - 2, y1 - 2, x2, y2);
#ifdef __GDI_MEMORY_PROFILE_2__
    gdi_draw_solid_rect(x1 - 2, y1 - 2, x2, y2, GDI_COLOR_TRANSPARENT);
#else 
    gui_show_image(0, 0, fmrdo_main_draw.bg_img);
#endif 
    gui_pop_clip();
    gui_push_text_clip();
    gui_set_text_clip(x1, y1 - 1, x2, y2);
    if (r2lMMIFlag)
    {
        gui_move_text_cursor(x2, y1);
    }
    else
    {
        gui_move_text_cursor(x1, y1);
    }
    gui_print_bordered_text(fmrdo_main_draw.LSK_text);
    gui_pop_text_clip();

#if(UI_DOUBLE_BUFFER_SUPPORT)
    gui_unlock_double_buffer();
    gui_BLT_double_buffer(x1 - 2, y1 - 2, x2, y2);
#endif /* (UI_DOUBLE_BUFFER_SUPPORT) */ 
}


/*****************************************************************************
 * FUNCTION
 *  mmi_fmrdo_redraw_main_RSK_down
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_fmrdo_redraw_main_RSK_down(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 str_w, str_h;
    S32 x1, y1, x2, y2;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#if(UI_DOUBLE_BUFFER_SUPPORT)
    gui_lock_double_buffer();
#endif 
    gui_set_font(&MMI_medium_font);
    gui_set_text_color(fmrdo_main_draw.RSK_text_color);
    gui_set_text_border_color(fmrdo_main_draw.RSK_text_border_color);

    /* show RSK */
    gui_measure_string(fmrdo_main_draw.RSK_text, &str_w, &str_h);
    x1 = UI_device_width - str_w - FMRDO_RSK_X_OFFSET;
    y1 = UI_device_height - str_h - FMRDO_RSK_Y_OFFSET;
    x2 = UI_device_width - FMRDO_RSK_X_OFFSET;
    y2 = UI_device_height - FMRDO_RSK_Y_OFFSET;
    gui_push_clip();
    gui_set_clip(x1 - 2, y1 - 2, x2, y2);
#ifdef __GDI_MEMORY_PROFILE_2__
    gdi_draw_solid_rect(x1 - 2, y1 - 2, x2, y2, GDI_COLOR_TRANSPARENT);
#else 
    gui_show_image(0, 0, fmrdo_main_draw.bg_img);
#endif 
    gui_pop_clip();
    gui_push_text_clip();
    gui_set_text_clip(x1, y1 - 1, x2, y2);
    if (r2lMMIFlag)
    {
        gui_move_text_cursor(x2, y1);
    }
    else
    {
        gui_move_text_cursor(x1, y1);
    }
    gui_print_bordered_text(fmrdo_main_draw.RSK_text);
    gui_pop_text_clip();

#if(UI_DOUBLE_BUFFER_SUPPORT)
    gui_unlock_double_buffer();
    gui_BLT_double_buffer(x1 - 2, y1 - 2, x2, y2);
#endif /* (UI_DOUBLE_BUFFER_SUPPORT) */ 
}


/*****************************************************************************
 * FUNCTION
 *  mmi_fmrdo_redraw_main_LSK_up
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_fmrdo_redraw_main_LSK_up(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 str_w, str_h;
    S32 x1, y1, x2, y2;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#if(UI_DOUBLE_BUFFER_SUPPORT)
    gui_lock_double_buffer();
#endif 
    gui_set_font(&MMI_medium_font);
    gui_set_text_color(fmrdo_main_draw.LSK_text_color);
    gui_set_text_border_color(fmrdo_main_draw.LSK_text_border_color);

    /* show LSK */
    gui_measure_string(fmrdo_main_draw.LSK_text, &str_w, &str_h);
    x1 = FMRDO_LSK_X_OFFSET - 1;
    y1 = UI_device_height - str_h - FMRDO_LSK_Y_OFFSET - 1;
    x2 = str_w + FMRDO_LSK_X_OFFSET - 1;
    y2 = UI_device_height - FMRDO_LSK_Y_OFFSET - 1;
    gui_push_clip();
    gui_set_clip(x1, y1 - 1, UI_device_width / 2 - 10, y2 + 1);
#ifdef __GDI_MEMORY_PROFILE_2__
    gdi_draw_solid_rect(x1, y1 - 1, UI_device_width / 2 - 10, y2 + 1, GDI_COLOR_TRANSPARENT);
#else 
    gui_show_image(0, 0, fmrdo_main_draw.bg_img);
#endif 
    gui_pop_clip();
    gui_push_text_clip();
    gui_set_text_clip(x1, y1 - 1, x2, y2);
    if (r2lMMIFlag)
    {
        gui_move_text_cursor(x2, y1);
    }
    else
    {
        gui_move_text_cursor(x1, y1);
    }
    gui_print_bordered_text(fmrdo_main_draw.LSK_text);
    gui_pop_text_clip();

#if(UI_DOUBLE_BUFFER_SUPPORT)
    gui_unlock_double_buffer();
    gui_BLT_double_buffer(x1, y1 - 1, UI_device_width / 2 - 10, y2 + 1);
#endif /* (UI_DOUBLE_BUFFER_SUPPORT) */ 
}


/*****************************************************************************
 * FUNCTION
 *  mmi_fmrdo_redraw_main_RSK_up
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_fmrdo_redraw_main_RSK_up(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 str_w, str_h;
    S32 x1, y1, x2, y2;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#if(UI_DOUBLE_BUFFER_SUPPORT)
    gui_lock_double_buffer();
#endif 
    gui_set_font(&MMI_medium_font);
    gui_set_text_color(fmrdo_main_draw.RSK_text_color);
    gui_set_text_border_color(fmrdo_main_draw.RSK_text_border_color);

    /* show RSK */
    gui_measure_string(fmrdo_main_draw.RSK_text, &str_w, &str_h);
    x1 = UI_device_width - str_w - FMRDO_RSK_X_OFFSET - 1;
    y1 = UI_device_height - str_h - FMRDO_RSK_Y_OFFSET - 1;
    x2 = UI_device_width - FMRDO_RSK_X_OFFSET - 1;
    y2 = UI_device_height - FMRDO_RSK_Y_OFFSET - 1;
    gui_push_clip();
    gui_set_clip(UI_device_width / 2 + 10, y1 - 1, x2 + 1, y2 + 1);
#ifdef __GDI_MEMORY_PROFILE_2__
    gdi_draw_solid_rect(UI_device_width / 2 + 10, y1 - 1, x2 + 1, y2 + 1, GDI_COLOR_TRANSPARENT);
#else 
    gui_show_image(0, 0, fmrdo_main_draw.bg_img);
#endif 
    gui_pop_clip();
    gui_push_text_clip();
    gui_set_text_clip(x1, y1 - 1, x2, y2);
    if (r2lMMIFlag)
    {
        gui_move_text_cursor(x2, y1);
    }
    else
    {
        gui_move_text_cursor(x1, y1);
    }
    gui_print_bordered_text(fmrdo_main_draw.RSK_text);
    gui_pop_text_clip();

#if(UI_DOUBLE_BUFFER_SUPPORT)
    gui_unlock_double_buffer();
    gui_BLT_double_buffer(UI_device_width / 2 + 10, y1 - 1, x2 + 1, y2 + 1);
#endif /* (UI_DOUBLE_BUFFER_SUPPORT) */ 
}


/*****************************************************************************
 * FUNCTION
 *  mmi_fmrdo_scroll_channel_name_hdlr
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_fmrdo_scroll_channel_name_hdlr(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    gui_handle_scrolling_text(&fmrdo_main_draw.channel_name_scroll);
}


/*****************************************************************************
 * FUNCTION
 *  mmi_fmrdo_redraw_main_background
 * DESCRIPTION
 *  
 * PARAMETERS
 *  x1      [IN]        
 *  y1      [IN]        
 *  x2      [IN]        
 *  y2      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_fmrdo_redraw_main_background(S32 x1, S32 y1, S32 x2, S32 y2)
{
#ifdef __GDI_MEMORY_PROFILE_2__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);
#else /* __GDI_MEMORY_PROFILE_2__ */ 
    /* we don't set clip here because its caller will do that */
    gui_show_image(0, 0, fmrdo_main_draw.bg_img);
#endif /* __GDI_MEMORY_PROFILE_2__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  mmi_fmrdo_redraw_main_all
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_fmrdo_redraw_main_all(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 str_w, str_h;
    S32 x1, y1, x2, y2;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#if(UI_DOUBLE_BUFFER_SUPPORT)
    gui_lock_double_buffer();
#endif 

    gui_push_clip();
    gui_push_text_clip();

    gui_set_clip(0, 0, UI_device_width - 1, UI_device_height - 1);

#ifdef __GDI_MEMORY_PROFILE_2__
    if (!is_fmrdo_skin_layer_drawn)
    {
        gdi_layer_push_and_set_active(fmrdo_skin_layer);
#endif /* __GDI_MEMORY_PROFILE_2__ */ 
        /* main background */
        gui_show_image(0, 0, fmrdo_main_draw.bg_img);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -