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

📄 themeconverterxml.c

📁 MTK手机平台的MMI部分的源代码
💻 C
📖 第 1 页 / 共 2 页
字号:
    {"st_VIBRATE_THEN_RING", IMG_SI_VIBRATE_THEN_RING},
    {"st_GPRS_SERVICE", IMG_SI_GPRS_INDICATOR},
    {"st_EARPHONE_INDICATOR", IMG_SI_EARPHONE_INDICATOR},
    {"st_GPRS_ATT_NO_PDP_INDICATOR", IMG_SI_GPRS_ATT_NO_PDP_INDICATOR},
    {"st_ALARM", IMG_SI_ALARM_ACTIVATED},
    {"st_VOICE_RECORD", IMG_SI_VOICE_RECORD},
    {"st_KEYPAD_LOCK", IMG_SI_KEYPAD_LOCK},
    {"st_KEYPAD_UNLOCK", IMG_SI_KEYPAD_UNLOCK},
    {"st_MISSED_CALL", IMG_SI_MISSED_CALL_INDICATOR},
    {"st_UNREAD_VOICE_L1L2", IMG_SI_UNREAD_VOICE_L1L2},
    {"st_UNREAD_VOICE_L1", IMG_SI_UNREAD_VOICE_L1},
    {"st_UNREAD_VOICE_L2", IMG_SI_UNREAD_VOICE_L2},
    {"st_UNREAD_FAX_L1L2", IMG_SI_UNREAD_FAX_L1L2},
    {"st_UNREAD_FAX_L1", IMG_SI_UNREAD_FAX_L1},
    {"st_UNREAD_FAX_L2", IMG_SI_UNREAD_FAX_L2},
    {"st_UNREAD_EMAIL_L1L2", IMG_SI_UNREAD_EMAIL_L1L2},
    {"st_UNREAD_EMAIL_L1", IMG_SI_UNREAD_EMAIL_L1},
    {"st_UNREAD_EMAIL_L2", IMG_SI_UNREAD_EMAIL_L2},
    {"st_IMPS_MSG", IMG_SI_IMPS_MSG},
    {"st_IMPS_LOGIN", IMG_SI_IMPS_LOGIN},
    {"st_WAP", IMG_SI_WAP},
    {"st_POC", IMG_SI_POC},
    {"st_BT", IMG_SI_BT},
    {"st_IR", IMG_SI_IR_INDICATOR},
    {"st_STOP_WATCH", IMG_SI_STOPWATCH},
    {"st_CHAT_INDICATION_ROOM1", IMG_BLINKINGICON_CHAT_ROOM1},
    {"st_CHAT_INDICATION_ROOM2", IMG_BLINKINGICON_CHAT_ROOM2},
    {"st_NETWORK_CIPHER_GSM", IMG_SI_NETWORK_CIPHER_GSM},
    {"st_NETWORK_CIPHER_GPRS", IMG_SI_NETWORK_CIPHER_GPRS},
    {"st_sig1", IMG_SI_SIGNAL_STRENGTH_L1},
    {"st_sig2", IMG_SI_SIGNAL_STRENGTH_L2},
    {"st_JAVA_PAUSE", IMG_SI_JAVA_PAUSE},
    {"title_mm_mm_icon", MAIN_MENU_TITLE_MULTIMEDIA_ICON},
    {"title_mm_ch_icon", MAIN_MENU_TITLE_CALL_HISTORY_ICON},
    {"title_mm_extras_icon", MAIN_MENU_TITLE_EXTRA_APP_ICON},
    {"title_mm_fng_icon", MAIN_MENU_TITLE_FUNANDGAMES_ICON},
    {"title_mm_org_icon", MAIN_MENU_TITLE_ORGANIZER_ICON},
    {"title_mm_phb_icon", MAIN_MENU_TITLE_PHONEBOOK_ICON},
    {"title_mm_profile_icon", MAIN_MENU_TITLE_PROFILES_ICON},
    {"title_mm_scut_icon", MAIN_MENU_TITLE_SHORTCUTS_ICON},
    {"title_mm_service_icon", MAIN_MENU_TITLE_SERVICES_ICON},
    {"title_mm_settings_icon", MAIN_MENU_TITLE_SETTINGS_ICON},
    {"title_mm_sms_icon", MAIN_MENU_TITLE_MESSAGES_ICON},
    {"title_mm_fm_icon", MAIN_MENU_TITLE_FILE_MNGR_ICON},
    {"wallpaper", IMG_ID_DISPCHAR_THEME_WALLPAPER}
};

const tc_search_all_tags_struct g_tc_search_all_tags_map[] = 
{
    {0, 1},     /* a */
    {1, 1},     /* b */
    {2, 1},     /* c */
    {3, 5},     /* d */
    {0, 0},     /* e */
    {8, 2},     /* f */
    {10, 1},    /* g */
    {0, 0},     /* h */
    {11, 6},    /* i */
    {0, 0},     /* j */
    {0, 0},     /* k */
    {17, 3},    /* l */
    {20, 6},    /* m */
    {26, 1},    /* n */
    {27, 1},    /* o */
    {28, 4},    /* p */
    {0, 0},     /* q */
    {32, 2},    /* r */
    {34, 4},    /* s */
    {38, 2},    /* t */
    {0, 0},     /* u */
    {40, 1},    /* v */
    {0, 0},     /* w */
    {0, 0},     /* x */
    {0, 0},     /* y */
    {0, 0}      /* z */
};

#ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__

const tc_search_image_all_tags_struct g_tc_search_all_tags_image_map[] = 
{
    {0, 0},     /* a */
    {0, 0},     /* b */
    {0, 17},    /* c */
    {0, 0},     /* d */
    {0, 0},     /* e */
    {0, 0},     /* f */
    {0, 0},     /* g */
    {0, 0},     /* h */
    {17, 11},   /* i */
    {0, 0},     /* j */
    {0, 0},     /* k */
    {0, 0},     /* l */
    {28, 74},   /* m */
    {0, 0},     /* n */
    {0, 0},     /* o */
    {102, 9},   /* p */
    {0, 0},     /* q */
    {0, 0},     /* r */
    {111, 48},  /* s */
    {159, 12},  /* t */
    {0, 0},     /* u */
    {0, 0},     /* v */
    {171, 1},   /* w */
    {0, 0},     /* x */
    {0, 0},     /* y */
    {0, 0}      /* z */
};
#elif defined(__MMI_BI_DEGREE_MAIN_MENU_STYLE__)

const tc_search_image_all_tags_struct g_tc_search_all_tags_image_map[] = 
{
    {0, 0},     /* a */
    {0, 0},     /* b */
    {0, 17},    /* c */
    {0, 0},     /* d */
    {0, 0},     /* e */
    {0, 0},     /* f */
    {0, 0},     /* g */
    {0, 0},     /* h */
    {17, 11},   /* i */
    {0, 0},     /* j */
    {0, 0},     /* k */
    {0, 0},     /* l */
    {28, 21},   /* m */
    {0, 0},     /* n */
    {0, 0},     /* o */
    {49, 9},    /* p */
    {0, 0},     /* q */
    {0, 0},     /* r */
    {58, 48},   /* s */
    {106, 12},  /* t */
    {0, 0},     /* u */
    {0, 0},     /* v */
    {118, 1},   /* w */
    {0, 0},     /* x */
    {0, 0},     /* y */
    {0, 0}      /* z */
};
#else /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */

const tc_search_image_all_tags_struct g_tc_search_all_tags_image_map[] = 
{
    {0, 0},     /* a */
    {0, 0},     /* b */
    {0, 17},    /* c */
    {0, 0},     /* d */
    {0, 0},     /* e */
    {0, 0},     /* f */
    {0, 0},     /* g */
    {0, 0},     /* h */
    {17, 11},   /* i */
    {0, 0},     /* j */
    {0, 0},     /* k */
    {0, 0},     /* l */
    {0, 0},     /* m */
    {0, 0},     /* n */
    {0, 0},     /* o */
    {28, 9},    /* p */
    {0, 0},     /* q */
    {0, 0},     /* r */
    {37, 48},   /* s */
    {85, 12},   /* t */
    {0, 0},     /* u */
    {0, 0},     /* v */
    {97, 1},    /* w */
    {0, 0},     /* x */
    {0, 0},     /* y */
    {0, 0}      /* z */
};
#endif /* __MMI_MAINMENU_STYLE_CHANGE_EN__ */ 

static U8 g_tc_thm_process_call_count;  /* theme Process Queue Counter */


/*****************************************************************************
 * FUNCTION
 *  mmi_tc_my_xml_elem_start_hdlr
 * DESCRIPTION
 *  (void *data, const char *el, const char **attr)
 *  function for handling of the start element tag
 * PARAMETERS
 *  data_p      [?]         
 *  el_p        [IN]        
 *  attr_p      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_tc_my_xml_elem_start_hdlr(void *data_p, const char *el_p, const char **attr_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_tm_checkThemeVersion)
    {
        if (!(strncmp((PS8) "devicetheme", el_p, strlen(el_p))) || !(strncmp((PS8) "deviceinfo", el_p, strlen(el_p))) ||
            !(strncmp((PS8) "media", el_p, strlen(el_p))))
        {   /* continue */
        }
        else
        {
            xml_free_parse(&g_tc_parser);
            return;
        }
    }

    if (!strncmp(el_p, "image_id", strlen("image_id")))
    {
        (*g_tc_xml_tags_map[IMAGE_LIST_POS_XML_TAG_MAP].tag_handler) ((U8 **) attr_p);
    }
    else
    {
        U8 first_alpha_tag = *(el_p);
        U8 count1;  /* count for total number of the image attributes */
        U8 loc;     /* position of the tag in the table */

        loc = g_tc_search_all_tags_map[first_alpha_tag - 97].index;
        for (count1 = 0; count1 < g_tc_search_all_tags_map[first_alpha_tag - 97].no_of_elements; count1++, loc++)
        {
            S16 check;

            check = strncmp((PS8) g_tc_xml_tags_map[loc].xml_tag, el_p, strlen(el_p));

            if (check == 0)
            {
                (*g_tc_xml_tags_map[loc].tag_handler) ((U8 **) attr_p);
                break;  /* shariq */
            }
        }
    }
    g_tc_thm_process_call_count++;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_tc_my_xml_elem_end_hdlr
 * DESCRIPTION
 *  (void *data, const char *el)
 *  function for handling of the end element tag
 * PARAMETERS
 *  data_p      [?]         
 *  el_p        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_tc_my_xml_elem_end_hdlr(void *data_p, const char *el_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 end_element[] = "media";

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (!strcmp(el_p, (PS8) end_element))
    {
        xml_free_parse(&g_tc_parser);
    }
    else
    {
        if (g_tc_thm_process_call_count == 15)
    #ifdef __DLT_ENABLE_PROCESS_QUEUE__
            theme_process_queue();
    #else /* __DLT_ENABLE_PROCESS_QUEUE__ */ 
        {
        }
    #endif /* __DLT_ENABLE_PROCESS_QUEUE__ */ 
    }
}


/*****************************************************************************
 * FUNCTION
 *  mmi_tc_processqueue
 * DESCRIPTION
 *  (void)
 *  function for polling of the queues
 * PARAMETERS
 *  void
 * RETURNS
 *  
 *****************************************************************************/
int mmi_tc_processqueue(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    return 0;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_tc_image_list_tag_handler
 * DESCRIPTION
 *  (U8 **attr)
 *  handles the image_list tag obained by parsing the XML file
 * PARAMETERS
 *  attr_p      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_tc_image_list_tag_handler(U8 **attr_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 first_alpha_attr;
    U8 count1;   /* count for total number of the image attributes */
    U8 loc;             /* position of the attribute in the table */
    U8 type;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#ifdef __MMI_STATUS_ICON_SIGNAL_WITH_LINE_SWITCH__
    if (!strcmp((PS8) attr_p[0], "status_sig"))
    {
        strcpy((PS8) attr_p[0], "st_sig1");
    }
#endif /* __MMI_STATUS_ICON_SIGNAL_WITH_LINE_SWITCH__ */ 
    first_alpha_attr = attr_p[0][0];
    loc = g_tc_search_all_tags_image_map[first_alpha_attr - 97].index;
    type = (U8) atoi((PS8) attr_p[3]);
    for (count1 = loc; count1 <= (g_tc_search_all_tags_image_map[first_alpha_attr - 97].no_of_elements + loc); count1++)
    {
        S16 check;

        check = strncmp((PS8) g_tc_image_tags_map[count1].image_tag, (PS8) attr_p[0], strlen((PS8) attr_p[0]));
        if (check == 0)
        {
            mmi_tm_set_imageid(g_tc_image_tags_map[count1].imageId, (U32) atoi((PS8) attr_p[1]), type);
            break;
        }
    }
}

#endif /* __MMI_DOWNLOADABLE_THEMES_SUPPORT__ */ /* mmi downloadble themes support */

⌨️ 快捷键说明

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