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

📄 gui_fixed_menuitems.c

📁 MTK6226修改平台UI的文件介绍
💻 C
📖 第 1 页 / 共 5 页
字号:
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    UI_UNUSED_PARAMETER(item);
    UI_UNUSED_PARAMETER(common_item_data);
}


/*****************************************************************************
 * FUNCTION
 *  UI_fixed_menuitem_dummy_resize_function
 * DESCRIPTION
 *  dummy resize function
 * PARAMETERS
 *  x       [IN]        
 *  y       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void UI_fixed_menuitem_dummy_resize_function(S32 x, S32 y)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    UI_UNUSED_PARAMETER(x);
    UI_UNUSED_PARAMETER(y);
}

#ifdef __MMI_TOUCH_SCREEN__


/*****************************************************************************
 * FUNCTION
 *  UI_fixed_menuitem_dummy_pen_function
 * DESCRIPTION
 *  
 * PARAMETERS
 *  item                    [?]         
 *  common_item_data        [?]         
 *  item_x                  [IN]        
 *  item_y                  [IN]        
 *  pen_event               [IN]        
 *  x                       [IN]        
 *  y                       [IN]        
 *  menuitem_event          [?]         
 *  menuitem_param          [?]         
 * RETURNS
 *  
 *****************************************************************************/
BOOL UI_fixed_menuitem_dummy_pen_function(
        void *item,
        void *common_item_data,
        S32 item_x,
        S32 item_y,
        mmi_pen_event_type_enum pen_event,
        S16 x,
        S16 y,
        gui_list_pen_enum *menuitem_event,
        gui_pen_event_param_struct *menuitem_param)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    UI_UNUSED_PARAMETER(item);
    UI_UNUSED_PARAMETER(common_item_data);
    UI_UNUSED_PARAMETER(pen_event);
    UI_UNUSED_PARAMETER(x);
    UI_UNUSED_PARAMETER(y);
    UI_UNUSED_PARAMETER(menuitem_event);
    UI_UNUSED_PARAMETER(menuitem_param);
    return MMI_FALSE;
}
#endif /* __MMI_TOUCH_SCREEN__ */ 

/* GUI: fixed text menuitem functions              */

UI_fixed_text_menuitem_theme *current_fixed_text_menuitem_theme = NULL;


/*****************************************************************************
 * FUNCTION
 *  gui_set_fixed_text_menuitem_theme
 * DESCRIPTION
 *  Applies the given theme to a fixed text menuitem
 * PARAMETERS
 *  m       [IN]        Is the fixed text menuitem object   (common data)
 *  t       [IN]        Is the theme
 * RETURNS
 *  void
 *****************************************************************************/
#ifdef __MMI_UI_TRANSPARENT_EFFECT__
UI_filled_area fixed_text_menuitem_transparent_filled_area;
#endif 

void gui_set_fixed_text_menuitem_theme(fixed_text_menuitem *m, UI_fixed_text_menuitem_theme *t)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    m->normal_filler = t->normal_filler;
    m->disabled_filler = t->disabled_filler;
    m->selected_filler = t->selected_filler;
    m->focussed_filler = t->focussed_filler;
#ifdef __MMI_UI_TRANSPARENT_EFFECT__
    /* This is to replace the UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR flag and alpha value from the themecomponent.h */
    if (!m->focussed_filler->flags & UI_FILLED_AREA_TYPE_BITMAP)
    {
        fixed_text_menuitem_transparent_filled_area = *(m->focussed_filler);
        m->focussed_filler = &fixed_text_menuitem_transparent_filled_area;
        fixed_text_menuitem_transparent_filled_area.flags |= UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
        fixed_text_menuitem_transparent_filled_area.c.alpha = HIGHLIGHTER_COLOR_OPACITY_VALUE;
    }
#endif /* __MMI_UI_TRANSPARENT_EFFECT__ */ 
    m->normal_text_color = t->normal_text_color;
    m->disabled_text_color = t->disabled_text_color;
    m->selected_text_color = t->selected_text_color;
    m->focussed_text_color = t->focussed_text_color;
    m->text_font = t->text_font;
    m->flags |= t->flags;
}


/*****************************************************************************
 * FUNCTION
 *  gui_set_fixed_text_menuitem_current_theme
 * DESCRIPTION
 *  Applies the current theme to a fixed text menuitem
 * PARAMETERS
 *  m       [IN]        Is the fixed text menuitem object   (common data)
 * RETURNS
 *  void
 *****************************************************************************/
void gui_set_fixed_text_menuitem_current_theme(fixed_text_menuitem *m)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* set th normal filler color of menu item equal to current theme */
    m->normal_filler = current_fixed_text_menuitem_theme->normal_filler;

    m->disabled_filler = current_fixed_text_menuitem_theme->disabled_filler;
    m->selected_filler = current_fixed_text_menuitem_theme->selected_filler;
    m->focussed_filler = current_fixed_text_menuitem_theme->focussed_filler;
#ifdef __MMI_UI_TRANSPARENT_EFFECT__
    /* This is to replace the UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR flag and alpha value from the themecomponent.h */
    if (!m->focussed_filler->flags & UI_FILLED_AREA_TYPE_BITMAP)
    {
        fixed_text_menuitem_transparent_filled_area = *(m->focussed_filler);
        m->focussed_filler = &fixed_text_menuitem_transparent_filled_area;
        fixed_text_menuitem_transparent_filled_area.flags |= UI_FILLED_AREA_TYPE_TRANSPARENT_COLOR;
    }
#endif /* __MMI_UI_TRANSPARENT_EFFECT__ */ 
    m->normal_text_color = current_fixed_text_menuitem_theme->normal_text_color;
    m->disabled_text_color = current_fixed_text_menuitem_theme->disabled_text_color;
    m->selected_text_color = current_fixed_text_menuitem_theme->selected_text_color;
    m->focussed_text_color = current_fixed_text_menuitem_theme->focussed_text_color;
    m->text_font = current_fixed_text_menuitem_theme->text_font;
    m->flags |= current_fixed_text_menuitem_theme->flags;
}


/*****************************************************************************
 * FUNCTION
 *  gui_create_fixed_text_menuitem
 * DESCRIPTION
 *  Creates a fixed text menuitem
 * PARAMETERS
 *  m           [IN]        Is the fixed text menuitem object (common data)
 *  width       [IN]        Width is the width of the fixed text menuitem
 *  height      [IN]        Height is the height of the fixed text menuitem
 * RETURNS
 *  void
 *****************************************************************************/
void gui_create_fixed_text_menuitem(fixed_text_menuitem *m, S32 width, S32 height)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    m->width = width;
    m->height = height;
    m->flags = 0;
    m->ext_flags = 0;
    gui_set_fixed_text_menuitem_current_theme(m);
    m->text_x = 0;
    m->text_y = 0;
    m->scroll_x = 0;
    m->scroll_width = width;
    m->parent_list = NULL;
    m->parent_matrix = NULL;
}


/*****************************************************************************
 * FUNCTION
 *  gui_fixed_text_menuitem_set_text_position
 * DESCRIPTION
 *  Sets the text position within a fixed text menuitem
 * PARAMETERS
 *  m       [IN]        Is the fixed text menuitem object   (common data)
 *  x       [IN]        Is the position of the text (offset from the left-top corner of the menuitem)
 *  y       [IN]        Is the position of the text (offset from the left-top corner of the menuitem)
 * RETURNS
 *  void
 *****************************************************************************/
void gui_fixed_text_menuitem_set_text_position(fixed_text_menuitem *m, S32 x, S32 y)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    m->text_x = x;
    m->text_y = y;
}


/*****************************************************************************
 * FUNCTION
 *  gui_resize_fixed_text_menuitem
 * DESCRIPTION
 *  Changes the size of a fixed text menuitem
 * PARAMETERS
 *  m           [IN]        Is the fixed text menuitem object   (common data)
 *  width       [IN]        Is the new width
 *  height      [IN]        Is the new height
 * RETURNS
 *  void
 *****************************************************************************/
void gui_resize_fixed_text_menuitem(fixed_text_menuitem *m, S32 width, S32 height)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    m->width = width;
    m->height = height;
    m->scroll_width = width;
}

/* Text scrolling related functions within the menu item */

fixed_text_menuitem *GUI_current_fixed_text_menuitem_common_data = NULL;
fixed_text_menuitem_type *GUI_current_fixed_text_menuitem_data = NULL;
U8 GUI_current_fixed_text_menuitem_scroll = 0;
U8 GUI_current_fixed_text_menuitem_scroll_direction;
S32 GUI_current_fixed_text_menuitem_x;
S32 GUI_current_fixed_text_menuitem_y;
S32 GUI_current_fixed_text_menuitem_scroll_counter = 0;
UI_string_type GUI_current_fixed_text_menuitem_scroll_text = NULL;
UI_string_type GUI_current_fixed_text_menuitem_scroll_text_end = NULL;


/*****************************************************************************
 * FUNCTION
 *  gui_fixed_text_menuitem_scroll_handler
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void gui_fixed_text_menuitem_scroll_handler(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U32 flags = GUI_current_fixed_text_menuitem_common_data->flags;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    flags |= GUI_current_fixed_text_menuitem_data->flags;
#ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
    gui_reset_current_list_effect();
#endif 
    if (GUI_current_fixed_text_menuitem_scroll_counter)
    {
        GUI_current_fixed_text_menuitem_scroll_counter--;
    }
    else
    {
    #if(UI_USE_WORD_SCROLLING_TEXT)
        GUI_current_fixed_text_menuitem_scroll_text = GUI_current_fixed_text_menuitem_scroll_text_end;
    #else /* (UI_USE_WORD_SCROLLING_TEXT) */ 
        if (flags & UI_MENUITEM_MARQUEE_SCROLL)
        {
            if (r2lMMIFlag)
            {
                GUI_current_fixed_text_menuitem_common_data->scroll_x += UI_text_menuitem_scroll_size;
                if (GUI_current_fixed_text_menuitem_common_data->scroll_x >=
                    (GUI_current_fixed_text_menuitem_common_data->text_width + UI_text_menuitem_scroll_gap))
                {
                    GUI_current_fixed_text_menuitem_common_data->scroll_x = 0;
                }
            }
            else
            {
                GUI_current_fixed_text_menuitem_common_data->scroll_x -= UI_text_menuitem_scroll_size;
                if (GUI_current_fixed_text_menuitem_common_data->scroll_x <=
                    (-(GUI_current_fixed_text_menuitem_common_data->text_width + UI_text_menuitem_scroll_gap)))
                {
                    GUI_current_fixed_text_menuitem_common_data->scroll_x = 0;
                }
            }
        }
        else
        {
            if (GUI_current_fixed_text_menuitem_scroll_direction == 0)
            {
                GUI_current_fixed_text_menuitem_common_data->scroll_x -= UI_text_menuitem_scroll_size;
                if ((GUI_current_fixed_text_menuitem_common_data->scroll_x +
                     GUI_current_fixed_text_menuitem_common_data->text_width) <=
                    (GUI_current_fixed_text_menuitem_common_data->scroll_width))
                {
                    GUI_current_fixed_text_menuitem_scroll_direction = 1;
                    GUI_current_fixed_text_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
                }
            }
            else if (GUI_current_fixed_text_menuitem_scroll_direction == 1)
            {
                GUI_current_fixed_text_menuitem_common_data->scroll_x += UI_text_menuitem_scroll_size;
                if (GUI_current_fixed_text_menuitem_common_data->scroll_x >= 0)
                {
                    GUI_current_fixed_text_menuitem_scroll_direction = 0;
                    GUI_current_fixed_text_menuitem_scroll_counter = UI_text_menuitem_scroll_pause;
                }
            }
        }
    #endif /* (UI_USE_WORD_SCROLLING_TEXT) */ 
        GUI_current_fixed_text_menuitem_common_data->ext_flags |= UI_MENUITEM_EXT_SHOW_IN_MARQUEE;

    #ifdef __MMI_UI_TRANSPARENT_EFFECT__
        if (!gui_is_current_transparency_with_multi_layer())
        {
            gui_fixed_text_menuitem_disable_transparent_effect(GUI_current_fixed_text_menuitem_common_data);    /* To disable transparency for scrolling text */
        }
    #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */ 

        gui_show_fixed_text_menuitem(
            (void*)GUI_current_fixed_text_menuitem_data,
            (void*)GUI_current_fixed_text_menuitem_common_data,
            GUI_current_fixed_text_menuitem_x,
            GUI_current_fixed_text_menuitem_y);

    #ifdef __MMI_UI_TRANSPARENT_EFFECT__
        gui_fixed_text_menuitem_enable_transparent_effect(GUI_current_fixed_text_menuitem_common_data); /* To enable transparency */
    #endif 

        GUI_current_fixed_text_menuitem_common_data->ext_flags &= ~UI_MENUITEM_EXT_SHOW_IN_MARQUEE;

⌨️ 快捷键说明

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