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

📄 wgui_categories_util.c

📁 MTK6226修改平台UI的文件介绍
💻 C
📖 第 1 页 / 共 5 页
字号:
    if (lang_index == 0xFFFF)
    {
        return NULL;
    }
    else
    {
        s = (UI_string_type) GetStringLang((U16) i, (U16) (lang_index));
    }
    if (s == NULL)
    {
        return NULL;
    }
    if (s[0] == '\0')
    {
        return NULL;
    }
    return ((UI_string_type) s);
}   /* end of get_string_lang */


/*****************************************************************************
 * FUNCTION
 *  get_string
 * DESCRIPTION
 *  Wrapper for GetString() function, to get string for given id
 * PARAMETERS
 *  i       [IN]        String id
 * RETURNS
 *  pointer to the string corresponding to the given string ID
 *****************************************************************************/
UI_string_type get_string(MMI_ID_TYPE i)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    UI_string_type s = (UI_string_type) GetString((U16) i);

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (s == NULL)
    {
        return (NULL);
    }
    if (s[0] == '\0')
    {
        return (NULL);
    }
    return ((UI_string_type) s);
}


/*****************************************************************************
 * FUNCTION
 *  get_image
 * DESCRIPTION
 *  Wrapper for GetImage() function
 * PARAMETERS
 *  i       [IN]        Image id
 * RETURNS
 *  pointer to the image corresponding to the given image ID
 *****************************************************************************/
PU8 get_image(MMI_ID_TYPE i)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    PU8 s;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (i == 0)
    {
        return (NULL);
    }
    s = (PU8) GetImage((U16) i);
    if (s == NULL)
    {
        return (NULL);
    }
    if (s[0] == '\0')
    {
        return (NULL);
    }
    return ((PU8) s);
}

/* 101205 audio resource Calvin Start */


/*****************************************************************************
 * FUNCTION
 *  get_audio
 * DESCRIPTION
 *  Wrapper for GetAudio() function
 * PARAMETERS
 *  i           [IN]        Audio id
 *  type        [OUT]       Audio type
 *  filelen     [OUT]       File length
 * RETURNS
 *  pointer to the audio raw data corresponding to the given audio ID
 *****************************************************************************/
U8 *get_audio(MMI_ID_TYPE i, U8 *type, U32 *filelen)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 *s = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ASSERT(type != NULL && filelen != NULL);

    *type = 0;;
    *filelen = 0;

    if (i == 0)
    {
        return (NULL);
    }

    s = (U8*) GetAudio((U16) i);
    if (s == NULL)
    {
        return (NULL);
    }
    if (s[0] == '\0')
    {
        return (NULL);
    }

    *type = s[0];

    *filelen |= (U32) (s[1]);
    *filelen |= (U32) ((U32) s[2] << 8);
    *filelen |= (U32) ((U32) s[3] << 16);
    *filelen |= (U32) ((U32) s[4] << 24);

    return (s + 8);
}

/* 101205 audio resource Calvin End */

/***************************************************************************** 
* Category screen wrappers
*****************************************************************************/
/*****************************************************************************
* FUNCTION
*  MMI_list_highlight_handler
*
* DESCRIPTION
*   Function pointer store the address of function which get executed
*  when any item in list get high lighted
*
* PARAMETERS
*  item _index IN store the current index of item highlighted
* 
* RETURNS
*  void
*
* GLOBALS AFFECTED
*   none
*****************************************************************************/
void (*MMI_list_highlight_handler) (S32 item_index);

/*****************************************************************************
* FUNCTION
*  MMI_matrix_highlight_handler
*
* DESCRIPTION
*   Function pointer store the address of function which get executed
*  when any item in matrix list get high lighted
*
* PARAMETERS
*  item _index IN store the current index of item highlighted
* 
* RETURNS
*  void
*
* GLOBALS AFFECTED
*   none
*****************************************************************************/
void (*MMI_matrix_highlight_handler) (S32 item_index);

/*****************************************************************************
* FUNCTION
*  MMI_circular_3D_highlight_handler
*
* DESCRIPTION
*   Function pointer store the address of function which get executed
*  when any item in 3D circular list get high lighted
*
* PARAMETERS
*  item _index IN store the current index of item highlighted
* 
* RETURNS
*  void
*
* GLOBALS AFFECTED
*   none
*****************************************************************************/
void (*MMI_circular_3D_highlight_handler) (S32 item_index);

/* For the main LCD  */
/*****************************************************************************
* FUNCTION
*  ExitCategoryFunction
*
* DESCRIPTION
*   Function pointer store the address of redraw category function of current
*  main lcd category scrren
*
* PARAMETERS
* 
* RETURNS
*  void
*
* GLOBALS AFFECTED
*   none
*****************************************************************************/
void (*ExitCategoryFunction) (void) = UI_dummy_function;

/*****************************************************************************
* FUNCTION
*  RedrawCategoryFunction
*
* DESCRIPTION
*   Function pointer store the address of redraw category function of current
*  main lcd category scrren
*
* PARAMETERS
* 
* RETURNS
*  void
*
* GLOBALS AFFECTED
*   none
*****************************************************************************/
void (*RedrawCategoryFunction) (void) = UI_dummy_function;

/*****************************************************************************
* FUNCTION
*  RedrawCategoryFunction
*
* DESCRIPTION
*   Function pointer store the address of getcategory history function of current
*  main lcd category scrren
*
* PARAMETERS
*  buffer   IN buffer store the valeu of history 
*
* RETURNS
*  U8*                        
*
* GLOBALS AFFECTED
*   buffer 
*****************************************************************************/
U8 *(*GetCategoryHistory) (U8 *buffer) = dummy_get_history;

/*****************************************************************************
* FUNCTION
*  RedrawInputMethodBoxesFunction
*
* DESCRIPTION
*   Function pointer store the address of RedrawInputMethodBoxesFunction
*
* PARAMETERS
* 
* RETURNS
*  void
*
* GLOBALS AFFECTED
*   none
*****************************************************************************/
void (*RedrawSpellingOrCandidateBoxesFunction) (void) = UI_dummy_function;

/*****************************************************************************
* FUNCTION
*  GetCategoryHistorySize
*
* DESCRIPTION
*   Function pointer store the address of getcategory history size  function of current
*  main lcd category scrren
*
* PARAMETERS
* 
* RETURNS
*  S32   return size of history buffer
*
* GLOBALS AFFECTED
*   none
*****************************************************************************/
S32(*GetCategoryHistorySize) (void) = dummy_get_history_size;

#if (0)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif /* (0) */ 


/*****************************************************************************
 * FUNCTION
 *  initialize_category_screens
 * DESCRIPTION
 *  Called once during bootup to initialize category screens
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void initialize_category_screens(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    RegisterHighlightHandler(MMI_dummy_highlight_handler);

    ExitCategoryFunction = MMI_dummy_function;
    RedrawCategoryFunction = MMI_dummy_function;
    GetCategoryHistory = dummy_get_history;
    GetCategoryHistorySize = dummy_get_history_size;

    SUBLCD_ExitCategoryFunction = MMI_dummy_function;
    SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
    SUBLCD_GetCategoryHistory = dummy_get_history;
    SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
}   /* end of initialize_category_screens */

extern void UpdateUITheme(void);

/* PMT VIKAS START 20050707 */


/*****************************************************************************
 * FUNCTION
 *  gui_set_softkey_coordinate
 * DESCRIPTION
 *  Reset the coordinates of the softkeys on screen exit function(Specially to handle Asyn events. As key up is not called at that time.)
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
#ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
extern U8 is_button_bar_shuffled;

void gui_set_softkey_coordinate(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (is_button_bar_shuffled == 0)
    {
        MMI_right_softkey.y = UI_device_height - MMI_softkey_height;
        MMI_left_softkey.y = UI_device_height - MMI_softkey_height - (MMI_BUTTON_BAR_HEIGHT - MMI_softkey_height);

    }
    else
    {
        MMI_left_softkey.y = UI_device_height - MMI_softkey_height;
        MMI_right_softkey.y = UI_device_height - MMI_softkey_height - (MMI_BUTTON_BAR_HEIGHT - MMI_softkey_height);

    }

}

#endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
/* PMT VIKAS END 20050707 */


/*****************************************************************************
 * FUNCTION
 *  UI_common_screen_pre_exit
 * DESCRIPTION
 *  Failsafe screen exit function *before* screen exit function
 * PARAMETERS

⌨️ 快捷键说明

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