wgui_ems.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:317k
源码类别:
MTK
开发平台:
C/C++
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- return (EMS_get_object_size(EMS_TYPE_PIC, &object));
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_get_predefined_picture_data_size
- * DESCRIPTION
- *
- * PARAMETERS
- * data [?]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_get_predefined_picture_data_size(U8 *data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS r = EMS_load_object(EMS_PREDEFINED_PICTURE, data, -1, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- return (EMS_get_object_size(EMS_TYPE_PIC, &object));
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_check_predefined_picture_data_size
- * DESCRIPTION
- *
- * PARAMETERS
- * data [?]
- * allowed [?]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_check_predefined_picture_data_size(U8 *data, U8 *allowed)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS r = EMS_load_object(EMS_PREDEFINED_PICTURE, data, -1, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- return (EMS_check_object_size(EMS_TYPE_PIC, &object, allowed));
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_get_userdefined_picture_size
- * DESCRIPTION
- *
- * PARAMETERS
- * data [?]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_get_userdefined_picture_size(U8 *data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS r = EMS_load_object(EMS_USERDEFINED_PICTURE, data, 0, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- return (EMS_get_object_size(EMS_TYPE_PIC, &object));
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_check_userdefined_picture_size
- * DESCRIPTION
- *
- * PARAMETERS
- * data [?]
- * allowed [?]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_check_userdefined_picture_size(U8 *data, U8 *allowed)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS r = EMS_load_object(EMS_USERDEFINED_PICTURE, data, 0, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- return (EMS_check_object_size(EMS_TYPE_PIC, &object, allowed));
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_insert_userdefined_picture
- * DESCRIPTION
- *
- * PARAMETERS
- * data [?]
- * RETURNS
- *
- *****************************************************************************/
- EMSTATUS EMS_inputbox_insert_userdefined_picture(U8 *data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS r = EMS_load_object(EMS_USERDEFINED_PICTURE, data, 0, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- r = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_PIC, &object, 0);
- }
- return (r);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_get_predefined_animation_size
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_get_predefined_animation_size(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((index < 0) || (index >= MAX_EMS_PREDEFINED_ANIMATIONS))
- {
- return (0);
- }
- return (EMS_get_object_size(EMS_TYPE_PREDEF_ANM, &object));
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_insert_predefined_animation
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- *
- *****************************************************************************/
- EMSTATUS EMS_inputbox_insert_predefined_animation(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((index < 0) || (index >= MAX_EMS_PREDEFINED_ANIMATIONS))
- {
- return (EMS_INVALID_OBJECT);
- }
- return (gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_PREDEF_ANM, NULL, (U8) index));
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_get_userdefined_animation_size
- * DESCRIPTION
- *
- * PARAMETERS
- * data [?]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_get_userdefined_animation_size(U8 *data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS r = EMS_load_object(EMS_USERDEFINED_ANIMATION, data, 0, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- return (EMS_get_object_size(EMS_TYPE_USERDEF_ANM, &object));
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_check_userdefined_animation_size
- * DESCRIPTION
- *
- * PARAMETERS
- * data [?]
- * allowed [?]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_check_userdefined_animation_size(U8 *data, U8 *allowed)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS r = EMS_load_object(EMS_USERDEFINED_ANIMATION, data, 0, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- return (EMS_check_object_size(EMS_TYPE_USERDEF_ANM, &object, allowed));
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_insert_userdefined_animation
- * DESCRIPTION
- *
- * PARAMETERS
- * data [?]
- * RETURNS
- *
- *****************************************************************************/
- EMSTATUS EMS_inputbox_insert_userdefined_animation(U8 *data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS r = EMS_load_object(EMS_USERDEFINED_ANIMATION, data, 0, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- r = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_USERDEF_ANM, &object, 0);
- }
- return (r);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_get_predefined_sound_size
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_get_predefined_sound_size(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((index < 0) || (index >= MAX_EMS_PREDEFINED_SOUNDS))
- {
- return (0);
- }
- return (EMS_get_object_size(EMS_TYPE_PREDEF_SND, &object));
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_insert_predefined_sound
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- *
- *****************************************************************************/
- EMSTATUS EMS_inputbox_insert_predefined_sound(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((index < 0) || (index >= MAX_EMS_PREDEFINED_SOUNDS))
- {
- return (EMS_INVALID_OBJECT);
- }
- return (gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_PREDEF_SND, NULL, (U8) index));
- }
- /* MTK Joy added for customization, 1014 */
- #if defined(__MMI_IMELODY_SUPPORT__)
- /*****************************************************************************
- * FUNCTION
- * EMS_load_predefined_melody
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * data [?]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_load_predefined_melody(S32 index, U8 *data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((index >= 0) && (index < MAX_EMS_PREDEFINED_MELODIES))
- {
- EMS_predefined_melodies[index] = data;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_get_predefined_melody_size
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_get_predefined_melody_size(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- U8 *data = NULL;
- EMSTATUS r = EMS_load_object(EMS_PREDEFINED_MELODY, data, index, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- return (EMS_get_object_size(EMS_TYPE_USERDEF_SND, &object));
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_get_predefined_melody_data_size
- * DESCRIPTION
- *
- * PARAMETERS
- * data [?]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_get_predefined_melody_data_size(U8 *data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS r = EMS_load_object(EMS_PREDEFINED_MELODY, data, -1, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- return (EMS_get_object_size(EMS_TYPE_USERDEF_SND, &object));
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_check_predefined_melody_data_size
- * DESCRIPTION
- *
- * PARAMETERS
- * data [?]
- * allowed [?]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_check_predefined_melody_data_size(U8 *data, U8 *allowed)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS r = EMS_load_object(EMS_PREDEFINED_MELODY, data, -1, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- return (EMS_check_object_size(EMS_TYPE_USERDEF_SND, &object, allowed));
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_insert_predefined_melody
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- *
- *****************************************************************************/
- EMSTATUS EMS_inputbox_insert_predefined_melody(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- U8 *data = NULL;
- EMSTATUS r = EMS_load_object(EMS_PREDEFINED_MELODY, data, index, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- r = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_USERDEF_SND, &object, 0);
- }
- return (r);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_get_userdefined_melody_size
- * DESCRIPTION
- *
- * PARAMETERS
- * data [?]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_get_userdefined_melody_size(U8 *data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS r = EMS_load_object(EMS_USERDEFINED_MELODY, data, 0, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- return (EMS_get_object_size(EMS_TYPE_USERDEF_SND, &object));
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_check_userdefined_melody_size
- * DESCRIPTION
- *
- * PARAMETERS
- * data [?]
- * allowed [?]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_check_userdefined_melody_size(U8 *data, U8 *allowed)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS r = EMS_load_object(EMS_USERDEFINED_MELODY, data, 0, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- return (EMS_check_object_size(EMS_TYPE_USERDEF_SND, &object, allowed));
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_insert_userdefined_melody
- * DESCRIPTION
- *
- * PARAMETERS
- * data [?]
- * RETURNS
- *
- *****************************************************************************/
- EMSTATUS EMS_inputbox_insert_userdefined_melody(U8 *data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS r = EMS_load_object(EMS_USERDEFINED_MELODY, data, 0, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- r = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_USERDEF_SND, &object, 0);
- }
- return (r);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_userdefined_melody_attach_header
- * DESCRIPTION
- *
- * PARAMETERS
- * src [?]
- * dst [?]
- * size [?]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_userdefined_melody_attach_header(U8 *src, U8 *dst, S32 *size)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_memcpy(dst + 4, src, *size);
- dst[0] = EMS_USERDEFINED_MELODY;
- dst[1] = 0;
- dst[2] = (U8) ((*size) & 0xff);
- dst[3] = (U8) ((*size) >> 8);
- *size = *size + 4;
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_userdefined_melody_detach_header
- * DESCRIPTION
- *
- * PARAMETERS
- * src [?]
- * dst [?]
- * size [?]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_userdefined_melody_detach_header(U8 *src, U8 *dst, S32 *size)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- *size = *size - 4;
- gui_memcpy(dst, src + 4, *size);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_predefined_melody_attach_header
- * DESCRIPTION
- *
- * PARAMETERS
- * src [?]
- * dst [?]
- * size [?]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_predefined_melody_attach_header(U8 *src, U8 *dst, S32 *size)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_memcpy(dst + 4, src, *size);
- dst[0] = EMS_PREDEFINED_MELODY;
- dst[1] = 0;
- dst[2] = (U8) ((*size) & 0xff);
- dst[3] = (U8) ((*size) >> 8);
- *size = *size + 4;
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_predefined_melody_detach_header
- * DESCRIPTION
- *
- * PARAMETERS
- * src [?]
- * dst [?]
- * size [?]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_predefined_melody_detach_header(U8 *src, U8 *dst, S32 *size)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- *size = *size - 4;
- gui_memcpy(dst, src + 4, *size);
- }
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- /* MTK end */
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_set_text_size
- * DESCRIPTION
- *
- * PARAMETERS
- * s [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_set_text_size(EMSFONTSIZE s)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_EMS_text_format.FontSize = s;
- /* AddString(MMI_EMS_inputbox.data,NULL,0,&wgui_EMS_text_format); */
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_get_text_size
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- EMSFONTSIZE EMS_inputbox_get_text_size(void)
- {
- #ifdef __MMI_DIALLING_FONT__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_EMS_text_format.FontSize == EMS_FONTSIZE_LARGE)
- {
- return (EMS_FONTSIZE_NORMAL);
- }
- else
- {
- return (wgui_EMS_text_format.FontSize);
- }
- #else /* __MMI_DIALLING_FONT__ */
- return (wgui_EMS_text_format.FontSize);
- #endif /* __MMI_DIALLING_FONT__ */
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_set_text_style
- * DESCRIPTION
- *
- * PARAMETERS
- * isBold [IN]
- * isItalic [IN]
- * isUnderline [IN]
- * isStrikethrough [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_set_text_style(U8 isBold, U8 isItalic, U8 isUnderline, U8 isStrikethrough)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (isBold)
- {
- wgui_EMS_text_format.isBold = KAL_TRUE;
- }
- else
- {
- wgui_EMS_text_format.isBold = KAL_FALSE;
- }
- if (isItalic)
- {
- wgui_EMS_text_format.isItalic = KAL_TRUE;
- }
- else
- {
- wgui_EMS_text_format.isItalic = KAL_FALSE;
- }
- if (isUnderline)
- {
- wgui_EMS_text_format.isUnderline = KAL_TRUE;
- }
- else
- {
- wgui_EMS_text_format.isUnderline = KAL_FALSE;
- }
- if (isStrikethrough)
- {
- wgui_EMS_text_format.isStrikethrough = KAL_TRUE;
- }
- else
- {
- wgui_EMS_text_format.isStrikethrough = KAL_FALSE;
- }
- /* AddString(MMI_EMS_inputbox.data,NULL,0,&wgui_EMS_text_format); */
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_get_text_style
- * DESCRIPTION
- *
- * PARAMETERS
- * isBold [?]
- * isItalic [?]
- * isUnderline [?]
- * isStrikethrough [?]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_get_text_style(U8 *isBold, U8 *isItalic, U8 *isUnderline, U8 *isStrikethrough)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_EMS_text_format.isBold == KAL_TRUE)
- {
- *isBold = 1;
- }
- else
- {
- *isBold = 0;
- }
- if (wgui_EMS_text_format.isItalic == KAL_TRUE)
- {
- *isItalic = 1;
- }
- else
- {
- *isItalic = 0;
- }
- if (wgui_EMS_text_format.isUnderline == KAL_TRUE)
- {
- *isUnderline = 1;
- }
- else
- {
- *isUnderline = 0;
- }
- if (wgui_EMS_text_format.isStrikethrough == KAL_TRUE)
- {
- *isStrikethrough = 1;
- }
- else
- {
- *isStrikethrough = 0;
- }
- }
- #endif /* __MMI_MESSAGES_EMS__ */ /* endif __MMI_MESSAGES_EMS__ */
- U8 EMS_inputbox_alignment_added_flag = 0;
- EMSALIGNMENT EMS_inputbox_alignment = EMS_ALIGN_LANG_DEP;
- #ifdef __MMI_MESSAGES_EMS__
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_set_text_alignment
- * DESCRIPTION
- *
- * PARAMETERS
- * a [IN]
- * RETURNS
- *
- *****************************************************************************/
- EMSTATUS EMS_inputbox_set_text_alignment(EMSALIGNMENT a)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSTATUS emsObjectStatus;
- EMSTextFormat saved_wgui_EMS_text_format = wgui_EMS_text_format;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Old code: Used for testing purpose. Leave commented */
- // ResetTextFormat(&wgui_EMS_text_format);
- // wgui_EMS_text_format.Alignment=a;
- /* Old code: ends */
- saved_wgui_EMS_text_format.Alignment = a;
- emsObjectStatus = gui_EMS_input_box_insert_text_alignment(&MMI_EMS_inputbox, &saved_wgui_EMS_text_format);
- /* Old code: Used for testing purpose. Leave commented */
- // AddString(MMI_EMS_inputbox.data,NULL,0,&wgui_EMS_text_format);
- // wgui_EMS_text_format=saved_wgui_EMS_text_format;
- /* Old code: ends */
- if (emsObjectStatus != EMS_OK)
- {
- return emsObjectStatus;
- }
- if (MMI_EMS_inputbox.data->CurrentTextFormatObj != NULL)
- {
- wgui_EMS_text_format.Alignment = MMI_EMS_inputbox.data->CurrentTextFormatObj->data->text_format.Alignment;
- }
- /* HACK: Set a flag to indicate that text alignment has been added */
- EMS_inputbox_alignment_added_flag = 1;
- EMS_inputbox_alignment = a;
- return emsObjectStatus;
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_get_text_alignment
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- EMSALIGNMENT EMS_inputbox_get_text_alignment(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (wgui_EMS_text_format.Alignment);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_create_new_paragraph
- * DESCRIPTION
- *
- * PARAMETERS
- * a [IN]
- * RETURNS
- *
- *****************************************************************************/
- EMSTATUS EMS_inputbox_create_new_paragraph(EMSALIGNMENT a)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSTATUS emsObjectStatus;
- #if(0)
- wgui_EMS_text_format.Alignment=a;
- MMI_EMS_inputbox.text_format.Alignment=a;
- EMS_inputbox_insert_new_line();
- #else /* (0) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_EMS_text_format.Alignment = a;
- emsObjectStatus = gui_EMS_input_box_insert_new_paragraph(&MMI_EMS_inputbox, &wgui_EMS_text_format);
- /* AddString(MMI_EMS_inputbox.data,NULL,0,&wgui_EMS_text_format); */
- if (emsObjectStatus != EMS_OK)
- {
- wgui_EMS_text_format = MMI_EMS_inputbox.text_format;
- }
- EMS_inputbox_input_callback();
- return emsObjectStatus;
- #endif /* (0) */
- }
- #if(0)
- byte EMS_bold=1;
- void EMS_inputbox_insert_text_format(void)
- { EMSObjData object;
- ResetTextFormat(&object.text_format);
- object.text_format.bgColor=EMS_BLACK;
- object.text_format.fgColor=EMS_BLACK;
- object.text_format.Alignment=EMS_ALIGN_LEFT;
- if(EMS_bold) object.text_format.FontSize=EMS_FONTSIZE_SMALL;
- else object.text_format.FontSize=EMS_FONTSIZE_NORMAL;
- object.text_format.isBold=0;
- object.text_format.isItalic=0;
- object.text_format.isUnderline=0;
- object.text_format.isStrikethrough=0;
- object.text_format.textLength=1;
- pixtel_toggle(EMS_bold);
- AddString(MMI_EMS_inputbox.data,NULL,0,&object.text_format);
- }
- #endif /* (0) */
- extern PU8 EMS_editor_sound_icon;
- extern PU8 EMS_editor_melody_icon;
- /*****************************************************************************
- * FUNCTION
- * initialize_EMS_objects
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void initialize_EMS_objects(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EMS_editor_sound_icon = get_image(EMS_EDITOR_SOUND_OBJECT_ID);
- EMS_editor_melody_icon = get_image(EMS_EDITOR_MELODY_OBJECT_ID);
- }
- /*****************************************************************************
- * FUNCTION
- * close_EMS_objects
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void close_EMS_objects(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- }
- /* EMS category screens: Application menus */
- #define EMS_APPLICATION_MENUS_BASE (DEMO_APP_BASE+400)
- #define EMS_APPLICATION_MENUS_SCREEN_ID_BASE (EMS_APPLICATION_MENUS_BASE+0)
- #define EMS_MAIN_MENU_SCREEN_ID (EMS_APPLICATION_MENUS_SCREEN_ID_BASE+1)
- #define EMS_OBJECTS_MENU_SCREEN_ID (EMS_APPLICATION_MENUS_SCREEN_ID_BASE+2)
- #define EMS_TEXT_FORMATTING_MENU_SCREEN_ID (EMS_APPLICATION_MENUS_SCREEN_ID_BASE+3)
- #define EMS_TEXT_ALIGNMENT_SELECTION_MENU_SCREEN_ID (EMS_APPLICATION_MENUS_SCREEN_ID_BASE+4)
- #define EMS_TEXT_SIZE_SELECTION_MENU_SCREEN_ID (EMS_APPLICATION_MENUS_SCREEN_ID_BASE+5)
- #define EMS_TEXT_STYLE_SELECTION_MENU_SCREEN_ID (EMS_APPLICATION_MENUS_SCREEN_ID_BASE+6)
- #define EMS_TEXT_NEW_PARAGRAPH_ALIGNMENT_MENU_SCREEN_ID (EMS_APPLICATION_MENUS_SCREEN_ID_BASE+7)
- #define MAX_EMS_MAIN_MENU_ITEMS 5
- #if(EMS_USE_INTERNAL_MENU)
- #ifdef __UCS2_ENCODING
- U8 *EMS_main_menu_items[] = { (U8 *) "A d d