wgui_ems.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:317k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * wgui_ems_categories.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file is intends for UI wrapper routines for EMS .
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- /**
- * Copyright Notice
- * (c) 2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
- * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
- * (It is illegal to remove this copyright notice from this software or any
- * portion of it)
- */
- /**********************************************************************************
- Filename: wgui_ems_categories.c
- Author: manju
- Date Created: March-22-2003
- Contains: UI wrapper routines for EMS and category screens
- **********************************************************************************/
- #include "PixtelDataTypes.h"
- #include "MMI_features.h"
- #include "TimerEvents.h"
- #include "FileSystemDef.h"
- #include "FileSystemGProt.h"
- #include "conversions.h"
- #include "CustDataProts.h"
- #include "HistoryGprot.h"
- #include "CustMenuRes.h"
- #include "DebugInitDef.h"
- #include "GlobalDefs.h"
- #include "SettingProfile.h"
- #include "wgui.h"
- #include "wgui_categories.h"
- #include "wgui_categories_inputs.h"
- #include "wgui_categories_defs.h"
- #include "wgui_softkeys.h"
- #include "gdi_include.h"
- #include "wgui_ems.h"
- #include "MessagesResourceData.h"
- #include "CommonScreens.h"
- #if (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__))
- #include "FileMgr.h"
- #include "FileManagerDef.h"
- #include "FileManagerGProt.h"
- #endif /* (defined(MMI_ON_HARDWARE_P) && defined(__MMI_FILE_MANAGER__)) */
- #include "wgui_draw_manager.h"
- #include "t9def.h"
- #ifdef __MMI_HINDI_ALG__
- #include "hf_rules.h"
- #endif
- #include "wgui_virtual_keyboard.h"
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- #include "EditorPen.h"
- #endif
- /* MTK Elvis for R2L characters */
- extern BOOL r2lMMIFlag;
- /* MTK end */
- /* PMT dara added for Multitap thai */
- #ifdef __MMI_MULTITAP_THAI__
- void handle_category28_change_input_mode_bymultitapthai(void);
- #endif
- U8 EMS_inputbox_check_multitap_thai_input(UI_character_type inputchar, U8 *updatef);
- extern void handle_category28_change_input_mode(void);
- extern void wgui_set_EMS_inputbox_RSK(void);
- extern void wgui_EMS_redraw_input_information_bar(void);
- extern void gui_EMS_change_DCS(UI_EMS_input_box *b);
- #ifdef __MMI_MESSAGES_EMS__
- extern void EMS_cancel_object_focus(void);
- #endif
- /* MTK end */
- /* MTK Elvis */
- extern U16 StopMyTimer(U16 nTimerId);
- extern U16 StartMyTimerInt(U16 nTimerId, U32 nTimeDuration, oslTimerFuncPtr TimerExpiry, U8 alignment);
- /* MTK end */
- /* W05.36 Fix Vietnamese Tone Input Issue */
- extern void set_current_input_box_type(mmi_editor_inoutbox_enum input_box_type);
- /* MTK Elvis for prefered input method */
- extern S16 MMI_prefered_input_type;
- /* MTK end */
- extern void dm_set_scr_bg_image_no_draw(U16 image_id, S8 *file_name, S32 x, S32 y, U8 opacity); /* 092005 grayscale Calvin */
- /* 070505 Calvin Start */
- #if defined (__MMI_WALLPAPER_ON_BOTTOM__)
- static MMI_ID_TYPE editor_scr_bg_ID;
- static S8 *editor_scr_bg_filename;
- static S32 editor_scr_bg_x, editor_scr_bg_y;
- static U8 editor_scr_bg_opacity; /* 070505 Calvin added */
- #endif /* defined (__MMI_WALLPAPER_ON_BOTTOM__) */
- /* 070505 Calvin End */
- extern U8 PhnsetGetDefEncodingType(void);
- /* MTK Terry for RSK Display */
- void handle_category28_input(void);
- #if(!UI_DISABLE_EMS_CATEGORY_SCREENS)
- /* Temporary: Will be removed later */
- UI_string_type temp_EMS_buffer;
- EMSData *temp_EMS_data;
- /* EMS input box: Low level wrappers */
- void (*EMS_inputbox_input_callback) (void);
- /*****************************************************************************
- * FUNCTION
- * register_EMS_inputbox_input_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void register_EMS_inputbox_input_callback(void (*f) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EMS_inputbox_input_callback = f;
- }
- #if(!UI_DISABLE_EMS_INPUT_BOX)
- /* 072904 Calvin moved for centralized control */
- // #define ENABLE_EMS_INPUTBOX_FRAME_SKIPPING 1
- /* Calvin end */
- U8 EMS_inputbox_has_changed = 0;
- UI_EMS_input_box MMI_EMS_inputbox;
- EMSTextFormat wgui_EMS_text_format;
- extern void wgui_EMS_redraw_remaining_characters_display(void);
- #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_EMS_INPUTBOX_FRAME_SKIPPING))
- S32 wgui_EMS_inputbox_frame_counter = 0;
- #endif
- /*****************************************************************************
- * FUNCTION
- * show_EMS_inputbox
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void show_EMS_inputbox(void)
- {
- #if(0)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("nn"));
- if(MMI_EMS_inputbox.data->CurrentPosition.Object!=NULL)
- {
- if(MMI_EMS_inputbox.data->CurrentPosition.Object->Type==EMS_TYPE_TEXT_FORMAT)
- { PRINT_INFORMATION(("O: *"));
- }
- else
- { PRINT_INFORMATION(("O: %d",MMI_EMS_inputbox.data->CurrentPosition.Object->data.picture.pdu[0]));
- }
- }
- PRINT_INFORMATION((" TL: %d, TO: %d, T: %c",MMI_EMS_inputbox.data->textLength,MMI_EMS_inputbox.data->CurrentPosition.OffsetToText,MMI_EMS_inputbox.data->textBuffer[MMI_EMS_inputbox.data->CurrentPosition.OffsetToText+1]));
- #endif /* (0) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_set_EMS_input_box_current_theme(&MMI_EMS_inputbox);
- gui_show_EMS_input_box(&MMI_EMS_inputbox);
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_BLT_double_buffer(
- MMI_EMS_inputbox.x,
- MMI_EMS_inputbox.y,
- MMI_EMS_inputbox.x + MMI_EMS_inputbox.width - 1,
- MMI_EMS_inputbox.y + MMI_EMS_inputbox.height - 1);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- }
- #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_EMS_INPUTBOX_FRAME_SKIPPING))
- /*****************************************************************************
- * FUNCTION
- * wgui_EMS_inputbox_end_frame
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_EMS_inputbox_end_frame(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_EMS_inputbox_frame_counter >= 1)
- {
- S32 BLT_y2, y2;
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- gui_show_EMS_input_box(&MMI_EMS_inputbox);
- if (EMS_inputbox_has_changed)
- {
- wgui_EMS_redraw_remaining_characters_display();
- EMS_inputbox_has_changed = 0;
- }
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- BLT_y2 = MMI_EMS_inputbox.y + MMI_EMS_inputbox.height;
- y2 = MMI_multitap_y + MMI_multitap_height + 1;
- if (BLT_y2 < y2)
- {
- BLT_y2 = y2;
- }
- gui_BLT_double_buffer(
- MMI_EMS_inputbox.x,
- MMI_EMS_inputbox.y,
- MMI_EMS_inputbox.x + MMI_EMS_inputbox.width - 1,
- BLT_y2);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- wgui_EMS_inputbox_frame_counter = 0;
- gui_start_timer(UI_FRAME_SKIP_TIMEOUT, wgui_EMS_inputbox_end_frame);
- }
- }
- #endif /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_EMS_INPUTBOX_FRAME_SKIPPING)) */
- #if(EMS_INPUTBOX_DEBUG)
- #define _DEBUG_PRINT(x) _debug_print x
- extern void DisplayToDebugwindow(S8 *nPrintableStr);
- /*****************************************************************************
- * FUNCTION
- * _debug_print
- * DESCRIPTION
- *
- * PARAMETERS
- * fmt [?]
- * RETURNS
- * void
- *****************************************************************************/
- void _debug_print(S8 *fmt, ...)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 display_string[2048];
- va_list args;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- va_start(args, fmt);
- vsprintf(display_string, fmt, args);
- va_end(args);
- DisplayToDebugwindow(display_string);
- }
- /*****************************************************************************
- * FUNCTION
- * _DUMP_EMS_TEXT_FORMAT_OBJECT
- * DESCRIPTION
- *
- * PARAMETERS
- * x [?]
- * RETURNS
- * void
- *****************************************************************************/
- void _DUMP_EMS_TEXT_FORMAT_OBJECT(EMSTextFormat *x)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (x != NULL)
- {
- _DEBUG_PRINT(("L=%03d ", x->textLength));
- _DEBUG_PRINT(("AL="));
- switch (x->Alignment)
- {
- case EMS_ALIGN_LEFT:
- _DEBUG_PRINT(("L"));
- break;
- case EMS_ALIGN_RIGHT:
- _DEBUG_PRINT(("R"));
- break;
- case EMS_ALIGN_CENTER:
- _DEBUG_PRINT(("C"));
- break;
- case EMS_ALIGN_LANG_DEP:
- _DEBUG_PRINT(("D"));
- break;
- }
- _DEBUG_PRINT((" SZ="));
- switch (x->FontSize)
- {
- case EMS_FONTSIZE_NORMAL:
- _DEBUG_PRINT(("N"));
- break;
- case EMS_FONTSIZE_LARGE:
- _DEBUG_PRINT(("L"));
- break;
- case EMS_FONTSIZE_SMALL:
- _DEBUG_PRINT(("S"));
- break;
- }
- _DEBUG_PRINT((" ST="));
- if (x->isBold)
- {
- _DEBUG_PRINT(("B"));
- }
- if (x->isItalic)
- {
- _DEBUG_PRINT(("I"));
- }
- if (x->isUnderline)
- {
- _DEBUG_PRINT(("U"));
- }
- if (x->isStrikethrough)
- {
- _DEBUG_PRINT(("S"));
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * _DUMP_EMS_OBJECT
- * DESCRIPTION
- *
- * PARAMETERS
- * x [?]
- * RETURNS
- * void
- *****************************************************************************/
- void _DUMP_EMS_OBJECT(EMSObject *x)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (x == NULL)
- {
- _DEBUG_PRINT(("NULL"));
- }
- else
- {
- _DEBUG_PRINT(("%8X OFF=%03d ", x, x->OffsetToText));
- switch (x->Type)
- {
- case EMS_TYPE_TEXT_FORMAT:
- _DEBUG_PRINT(("TXT FMT "));
- _DUMP_EMS_TEXT_FORMAT_OBJECT(&x->data->text_format);
- break;
- case EMS_TYPE_PREDEF_SND:
- _DEBUG_PRINT(("PRE SND %d", x->PredefNo));
- break;
- case EMS_TYPE_USERDEF_SND:
- _DEBUG_PRINT(("USR SND"));
- break;
- case EMS_TYPE_PREDEF_ANM:
- _DEBUG_PRINT(("PRE ANM %d", x->PredefNo));
- break;
- case EMS_TYPE_USERDEF_ANM:
- _DEBUG_PRINT(("USR ANM"));
- break;
- case EMS_TYPE_PIC:
- _DEBUG_PRINT(("EMS PIC"));
- break;
- }
- }
- }
- #else /* (EMS_INPUTBOX_DEBUG) */
- #define _DEBUG_PRINT(x)
- /*****************************************************************************
- * FUNCTION
- * _DUMP_EMS_OBJECT
- * DESCRIPTION
- *
- * PARAMETERS
- * x [?]
- * RETURNS
- * void
- *****************************************************************************/
- void _DUMP_EMS_OBJECT(EMSObject *x)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(x);
- }
- #endif /* (EMS_INPUTBOX_DEBUG) */
- extern U16 GetExitScrnID(void);
- #include "IdleAppDef.h"
- /*****************************************************************************
- * FUNCTION
- * redraw_EMS_inputbox
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void redraw_EMS_inputbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((SCR_POPUP_SCREEN != GetExitScrnID()) && (POPUP_SCREENID != GetExitScrnID()))
- {
- #if(EMS_INPUTBOX_DEBUG)
- S32 i = 0;
- UI_character_type c = '-';
- EMSObject *object = MMI_EMS_inputbox.data->listHead;
- EMSPosition mapped_position;
- EMS_map_position(MMI_EMS_inputbox.data, &MMI_EMS_inputbox.data->CurrentPosition, &mapped_position);
- if ((MMI_EMS_inputbox.data->textBuffer != NULL) && (MMI_EMS_inputbox.data->textLength > 0) &&
- (MMI_EMS_inputbox.data->CurrentPosition.OffsetToText < MMI_EMS_inputbox.data->textLength))
- {
- c = MMI_EMS_inputbox.data->textBuffer[MMI_EMS_inputbox.data->CurrentPosition.OffsetToText];
- }
- if ((c == 0x0A) || (c == 0x0D))
- {
- c = '.';
- }
- _DEBUG_PRINT(("nnCurrent position: %c OFF=%03d, Object=", c,
- MMI_EMS_inputbox.data->CurrentPosition.OffsetToText));
- _DUMP_EMS_OBJECT(MMI_EMS_inputbox.data->CurrentPosition.Object);
- _DEBUG_PRINT(("nMapped position: %c OFF=%03d, Object=", c, mapped_position.OffsetToText,
- mapped_position.Object));
- _DUMP_EMS_OBJECT(mapped_position.Object);
- _DEBUG_PRINT(("nInputbox text format: "));
- _DUMP_EMS_TEXT_FORMAT_OBJECT(&MMI_EMS_inputbox.text_format);
- _DEBUG_PRINT(("nWGUI text format: "));
- _DUMP_EMS_TEXT_FORMAT_OBJECT(&wgui_EMS_text_format);
- _DEBUG_PRINT(("nCurrent text format: "));
- _DUMP_EMS_OBJECT(MMI_EMS_inputbox.data->CurrentTextFormatObj);
- while (object != NULL)
- {
- _DEBUG_PRINT(("nO%d=", i));
- _DUMP_EMS_OBJECT(object);
- object = object->next;
- i++;
- }
- for (i = 0; i < MMI_EMS_inputbox.n_lines; i++)
- {
- _DEBUG_PRINT(("nL%d OFF=%03d, Count=%02d, x=%02d, Object=", i,
- MMI_EMS_inputbox.line_positions[i].OffsetToText, MMI_EMS_inputbox.line_object_counts[i],
- MMI_EMS_inputbox.line_x_positions[i]));
- _DUMP_EMS_OBJECT(MMI_EMS_inputbox.line_positions[i].Object);
- }
- _DEBUG_PRINT(("n"));
- #endif /* (EMS_INPUTBOX_DEBUG) */
- #if(0)
- PRINT_INFORMATION(("nn"));
- if(MMI_EMS_inputbox.data->CurrentPosition.Object!=NULL)
- {
- if(MMI_EMS_inputbox.data->CurrentPosition.Object->Type==EMS_TYPE_TEXT_FORMAT)
- { PRINT_INFORMATION(("O: *"));
- }
- else
- { PRINT_INFORMATION(("O: %d",MMI_EMS_inputbox.data->CurrentPosition.Object->data.picture.pdu[0]));
- }
- }
- PRINT_INFORMATION((" TL: %d, TO: %d, T: %c",MMI_EMS_inputbox.data->textLength,MMI_EMS_inputbox.data->CurrentPosition.OffsetToText,MMI_EMS_inputbox.data->textBuffer[MMI_EMS_inputbox.data->CurrentPosition.OffsetToText+1]));
- #endif /* (0) */
- #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_EMS_INPUTBOX_FRAME_SKIPPING))
- if (wgui_EMS_inputbox_frame_counter > 0)
- {
- wgui_EMS_inputbox_frame_counter++;
- }
- else
- {
- wgui_EMS_inputbox_frame_counter = 1;
- gui_start_timer(UI_FRAME_START_TIMEOUT, wgui_EMS_inputbox_end_frame);
- }
- #else /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_EMS_INPUTBOX_FRAME_SKIPPING)) */
- gui_show_EMS_input_box(&MMI_EMS_inputbox);
- /* MTK Terry fix EMS remaining characters display unsync bug firefly#278 */
- if (!(MMI_EMS_inputbox.flags & UI_EMS_INPUT_BOX_VIEW_MODE))
- {
- wgui_EMS_redraw_remaining_characters_display();
- /* EMS_inputbox_has_changed=0; */
- }
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_BLT_double_buffer(
- MMI_EMS_inputbox.x,
- MMI_EMS_inputbox.y,
- MMI_EMS_inputbox.x + MMI_EMS_inputbox.width - 1,
- MMI_EMS_inputbox.y + MMI_EMS_inputbox.height - 1);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- #endif /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_EMS_INPUTBOX_FRAME_SKIPPING)) */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * show_EMS_inputbox_no_draw
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void show_EMS_inputbox_no_draw(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_EMS_inputbox.flags |= (UI_EMS_INPUT_BOX_DISABLE_DRAW);
- gui_show_EMS_input_box(&MMI_EMS_inputbox);
- MMI_EMS_inputbox.flags &= ~(UI_EMS_INPUT_BOX_DISABLE_DRAW);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_previous
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_previous(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.34 Fix Multitap in arrow keys */
- if (!(MMI_EMS_inputbox.flags & UI_EMS_INPUT_BOX_VIEW_MODE))
- {
- disable_active_multitap();
- }
- gui_EMS_input_box_previous(&MMI_EMS_inputbox);
- wgui_EMS_text_format = MMI_EMS_inputbox.text_format;
- redraw_EMS_inputbox();
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_next
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_next(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.34 Fix Multitap in arrow keys */
- if (!(MMI_EMS_inputbox.flags & UI_EMS_INPUT_BOX_VIEW_MODE))
- {
- disable_active_multitap();
- }
- gui_EMS_input_box_next(&MMI_EMS_inputbox);
- wgui_EMS_text_format = MMI_EMS_inputbox.text_format;
- redraw_EMS_inputbox();
- }
- #ifdef __MMI_MESSAGES_EMS__
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_previous_object
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_previous_object(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_EMS_input_box_view_previous_object(&MMI_EMS_inputbox);
- wgui_EMS_text_format = MMI_EMS_inputbox.text_format;
- redraw_EMS_inputbox();
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_next_object
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_next_object(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_EMS_input_box_view_next_object(&MMI_EMS_inputbox);
- wgui_EMS_text_format = MMI_EMS_inputbox.text_format;
- redraw_EMS_inputbox();
- }
- #endif /* __MMI_MESSAGES_EMS__ */
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_previous_line
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_previous_line(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.34 Fix Multitap in arrow keys */
- if (!(MMI_EMS_inputbox.flags & UI_EMS_INPUT_BOX_VIEW_MODE))
- {
- disable_active_multitap();
- }
- gui_EMS_input_box_previous_line(&MMI_EMS_inputbox);
- wgui_EMS_text_format = MMI_EMS_inputbox.text_format;
- redraw_EMS_inputbox();
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_next_line
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_next_line(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.34 Fix Multitap in arrow keys */
- if (!(MMI_EMS_inputbox.flags & UI_EMS_INPUT_BOX_VIEW_MODE))
- {
- disable_active_multitap();
- }
- gui_EMS_input_box_next_line(&MMI_EMS_inputbox);
- wgui_EMS_text_format = MMI_EMS_inputbox.text_format;
- redraw_EMS_inputbox();
- }
- UI_character_type EMS_GSM_extended_lookup[] = { '[', ']', '{', '}', '~', '\', '^', '|', 0xA2, /* Euro character is mapped to 0xA2 */
- };
- /*****************************************************************************
- * FUNCTION
- * EMS_GSM_extended_map
- * DESCRIPTION
- *
- * PARAMETERS
- * c [IN]
- * RETURNS
- *
- *****************************************************************************/
- U8 EMS_GSM_extended_map(UI_character_type c)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, n;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (c & 0xff00)
- {
- return (0);
- }
- n = sizeof(EMS_GSM_extended_lookup) / sizeof(UI_character_type);
- for (i = 0; i < n; i++)
- {
- if (c == EMS_GSM_extended_lookup[i])
- {
- return (1);
- }
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_direct_input
- * DESCRIPTION
- *
- * PARAMETERS
- * c [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_direct_input(UI_character_type c)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (UI_TEST_LF_CHARACTER(c))
- {
- gui_EMS_input_box_insert_new_line(&MMI_EMS_inputbox);
- }
- else
- {
- #if(!EMS_USE_GSM_EXTENDED)
- if (MMI_EMS_inputbox.UCS2_count == 0)
- {
- if (EMS_GSM_extended_map(c))
- {
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, 0x1b);
- }
- }
- #endif /* (!EMS_USE_GSM_EXTENDED) */
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, c);
- }
- redraw_EMS_inputbox();
- EMS_inputbox_input_callback();
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_direct_input_no_LF_check
- * DESCRIPTION
- *
- * PARAMETERS
- * c [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_direct_input_no_LF_check(UI_character_type c)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, c);
- redraw_EMS_inputbox();
- EMS_inputbox_input_callback();
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_backspace
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_backspace(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_EMS_input_box_backspace(&MMI_EMS_inputbox);
- wgui_EMS_text_format = MMI_EMS_inputbox.text_format;
- redraw_EMS_inputbox();
- EMS_inputbox_input_callback();
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_delete_all
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_delete_all(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_EMS_input_box_delete_all(&MMI_EMS_inputbox);
- wgui_EMS_text_format = MMI_EMS_inputbox.text_format;
- redraw_EMS_inputbox();
- EMS_inputbox_input_callback();
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_toggle_insert_mode
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_toggle_insert_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_EMS_input_box_toggle_insert_mode(&MMI_EMS_inputbox);
- redraw_EMS_inputbox();
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_delete
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_delete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_EMS_input_box_delete(&MMI_EMS_inputbox);
- wgui_EMS_text_format = MMI_EMS_inputbox.text_format;
- redraw_EMS_inputbox();
- EMS_inputbox_input_callback();
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_insert_new_line
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_insert_new_line(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_EMS_input_box_insert_new_line(&MMI_EMS_inputbox);
- EMS_inputbox_input_callback();
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_alphanumeric_keyboard_input_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * keyc [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_alphanumeric_keyboard_input_handler(S32 keyc)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (keyc == 0xc0)
- {
- EMS_inputbox_direct_input_no_LF_check((UI_character_type) 'n');
- }
- else if (keyc == 0xbb)
- {
- EMS_inputbox_direct_input((UI_character_type) 0x0d);
- }
- else if (keyc == 0x08)
- {
- EMS_inputbox_backspace();
- }
- else if (keyc == 0x1b)
- {
- EMS_inputbox_delete_all();
- }
- else if (keyc == 0x0d)
- {
- EMS_inputbox_direct_input((UI_character_type) 'n');
- }
- else if (keyc == 0xbd)
- {
- EMS_inputbox_direct_input((UI_character_type) 0x1b);
- }
- else if (keyc > 0x1f)
- {
- EMS_inputbox_direct_input((UI_character_type) keyc);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_key_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * vkey_code [IN]
- * key_state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_key_handler(S32 vkey_code, S32 key_state)
- {
- #if(MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (key_state)
- {
- switch (vkey_code)
- {
- case 37:
- #if(ENABLE_EMS_TEST_WORD_HIGHLIGHT)
- MMI_EMS_inputbox.flags &= ~UI_EMS_INPUT_BOX_WORD_HIGHLIGHT;
- #endif
- EMS_inputbox_previous();
- break;
- case 38:
- #if(ENABLE_EMS_TEST_WORD_HIGHLIGHT)
- gui_EMS_input_box_highlight_cursor_start(&MMI_EMS_inputbox);
- show_EMS_inputbox();
- #else /* (ENABLE_EMS_TEST_WORD_HIGHLIGHT) */
- EMS_inputbox_previous_line();
- #endif /* (ENABLE_EMS_TEST_WORD_HIGHLIGHT) */
- break;
- case 39:
- #if(ENABLE_EMS_TEST_WORD_HIGHLIGHT)
- MMI_EMS_inputbox.flags &= ~UI_EMS_INPUT_BOX_WORD_HIGHLIGHT;
- #endif
- EMS_inputbox_next();
- break;
- case 40:
- #if(ENABLE_EMS_TEST_WORD_HIGHLIGHT)
- gui_EMS_input_box_highlight_cursor_end(&MMI_EMS_inputbox);
- show_EMS_inputbox();
- #else /* (ENABLE_EMS_TEST_WORD_HIGHLIGHT) */
- EMS_inputbox_next_line();
- #endif /* (ENABLE_EMS_TEST_WORD_HIGHLIGHT) */
- break;
- case 36: /* home */
- break;
- case 35: /* end */
- break;
- case 33: /* page up */
- break;
- case 34: /* page down */
- break;
- case 45:
- EMS_inputbox_toggle_insert_mode();
- break;
- case 46:
- EMS_inputbox_delete();
- break;
- }
- }
- #else /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- UI_UNUSED_PARAMETER(vkey_code);
- UI_UNUSED_PARAMETER(key_state);
- #endif /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_viewer_key_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * vkey_code [IN]
- * key_state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_viewer_key_handler(S32 vkey_code, S32 key_state)
- {
- #if(MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (key_state)
- {
- switch (vkey_code)
- {
- case 37:
- #ifdef __MMI_MESSAGES_EMS__
- EMS_inputbox_previous_object();
- #else
- EMS_inputbox_previous();
- #endif
- break;
- case 38:
- EMS_inputbox_previous_line();
- break;
- case 39:
- #ifdef __MMI_MESSAGES_EMS__
- EMS_inputbox_next_object();
- #else
- EMS_inputbox_next();
- #endif
- break;
- case 40:
- EMS_inputbox_next_line();
- break;
- case 36: /* home */
- break;
- case 35: /* end */
- break;
- case 33: /* page up */
- break;
- case 34: /* page down */
- break;
- case 45: /* insert */
- break;
- case 46: /* delete */
- break;
- }
- }
- #else /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- UI_UNUSED_PARAMETER(vkey_code);
- UI_UNUSED_PARAMETER(key_state);
- #endif /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_multitap_input
- * DESCRIPTION
- *
- * PARAMETERS
- * c [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_multitap_input(UI_character_type c)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_EMS_input_box_insert_multitap_character(&MMI_EMS_inputbox, c);
- redraw_EMS_inputbox();
- EMS_inputbox_input_callback();
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_multitap_input_complete
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_multitap_input_complete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_EMS_input_box_confirm_multitap_character(&MMI_EMS_inputbox);
- redraw_EMS_inputbox();
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_numeric_keyboard_input_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * keyc [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_numeric_keyboard_input_handler(S32 keyc)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (keyc >= '0' && keyc <= '9')
- {
- EMS_inputbox_direct_input((U8) keyc);
- }
- else if (keyc == 0x08)
- {
- EMS_inputbox_backspace();
- }
- else if (keyc == 0x1b)
- {
- EMS_inputbox_delete_all();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_handle_key_down
- * DESCRIPTION
- *
- * PARAMETERS
- * k [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_handle_key_down(MMI_key_code_type k)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EMS_inputbox_direct_input((UI_character_type) ('0' + k));
- }
- /*****************************************************************************
- * FUNCTION
- * register_EMS_inputbox_keys
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void register_EMS_inputbox_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(EMS_inputbox_previous, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EMS_inputbox_next, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EMS_inputbox_previous_line, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EMS_inputbox_next_line, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- /* SetKeyHandler(EMS_inputbox_backspace,KEY_CLEAR,KEY_EVENT_DOWN); */
- register_keyboard_key_handler(EMS_inputbox_key_handler);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_EMS_inputbox_handle_symbol_picker_star_key
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_EMS_inputbox_handle_symbol_picker_star_key(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- disable_active_multitap();
- EntrySymbolPickerScreen();
- }
- /* MTK Elvis modify for Thai */
- #if !defined(__MMI_MULTITAP_FOR_STAR_AND_POUND__)
- #else /* !defined(__MMI_MULTITAP_FOR_STAR_AND_POUND__) */
- extern FuncPtr currKeyFuncPtrs[MAX_KEYS][MAX_KEY_TYPE];
- #endif /* !defined(__MMI_MULTITAP_FOR_STAR_AND_POUND__) */
- /* PMT dara added for Multitap thai */
- #ifdef __MMI_MULTITAP_THAI__
- //return 0 not accept input
- //return 1 accept input
- //return 2 normal
- //return 3 means reset the MMI_active_multitap. not use
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_check_multitap_thai_input
- * DESCRIPTION
- *
- * PARAMETERS
- * inputchar [IN]
- * updatef [?]
- * RETURNS
- *
- *****************************************************************************/
- U8 EMS_inputbox_check_multitap_thai_input(UI_character_type inputchar, U8 *updatef)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSPosition p = MMI_EMS_inputbox.data->CurrentPosition;
- EMSObject *current_object;
- UI_character_type c;
- U8 r;
- UI_character_type cc;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- r = gui_EMS_input_box_get_previous_object(MMI_EMS_inputbox.data, &p, &c, ¤t_object);
- if (r == 1) /* means that the previous is character */
- {
- if ((inputchar >= 0x0e34 && inputchar <= 0x0e39) || inputchar == 0x0e31) /* Above Vowels and Below Vowels */
- {
- if (c == 0x0e30 || c == 0x0e32 || c == 0x0e33 || c == 0x0e46 || c == 0x0e2f || c == 0x0e3f ||
- (c >= 0x0e40 && c <= 0x0e44) || c == 0x0030)
- {
- if (c == 0x0030 && *updatef == 1)
- {
- MMI_EMS_inputbox.flags &= ~UI_EMS_INPUT_BOX_STATE_MULTITAP;
- gui_EMS_input_box_backspace(&MMI_EMS_inputbox);
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, inputchar);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- return 1;
- }
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, 0x0030);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- return 0; /* not accept input */
- }
- else if ((c == 0x0e31 || (c >= 0x0e34 && c <= 0x0e39)))
- { /* Above Vowels and Below Vowels */
- if (*updatef == 0)
- {
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, 0x0030);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- return 0;
- }
- gui_EMS_input_box_backspace(&MMI_EMS_inputbox);
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, inputchar);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- return 1;
- }
- else if (c >= 0x0e47 && c <= 0x0e4c)
- { /* tone */
- if (*updatef == 0)
- {
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, 0x0030);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- return 0;
- }
- gui_EMS_input_box_backspace(&MMI_EMS_inputbox);
- if (c == 0x0e47)
- {
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, inputchar);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- return 1;
- }
- r = gui_EMS_input_box_get_previous_object(MMI_EMS_inputbox.data, &p, &cc, ¤t_object);
- if (r == 1 && ((cc >= 0x0e34 && cc <= 0x0e39) || cc == 0x0e31))
- {
- gui_EMS_input_box_backspace(&MMI_EMS_inputbox);
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, inputchar);
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, c);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- }
- else
- {
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, inputchar);
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, c);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- }
- return 1;
- }
- else if (c >= 0x0e01 && c <= 0x0e2e)
- {
- /* msz00065_20051010 peng hua add for multitap thai begin */
- if (gui_EMS_check_input_test_overflow(&MMI_EMS_inputbox, inputchar))
- /* msz00065_20051010 peng hua add for multitap thai end */
- {
- *updatef = 1;
- }
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, inputchar);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- return 1;
- }
- else
- {
- if (*updatef == 0)
- {
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, 0x0030);
- *updatef = 0;
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- }
- return 0;
- }
- }
- else if (inputchar == 0x0030)
- {
- if (*updatef == 1)
- {
- gui_EMS_input_box_backspace(&MMI_EMS_inputbox);
- /* redraw_EMS_inputbox(); */
- return 2;
- }
- }
- else if (inputchar >= 0x0e47 && inputchar <= 0x0e4c)
- {
- if (c == 0x0e30 || c == 0x0e32 || c == 0x0e33 || c == 0x0e46 || c == 0x0e2f || c == 0x0e3f ||
- (c >= 0x0e40 && c <= 0x0e44) || c == 0x0030)
- {
- if ((c == 0x0e46 || c == 0x0e2f || c == 0x0e3f) && *updatef == 1)
- {
- MMI_EMS_inputbox.flags &= ~UI_EMS_INPUT_BOX_STATE_MULTITAP;
- redraw_EMS_inputbox();
- gui_EMS_input_box_backspace(&MMI_EMS_inputbox);
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, inputchar);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- }
- return 1; /* not accept input */
- }
- else if ((c >= 0x0e47 && c <= 0x0e4c))
- { /* tone */
- if (*updatef == 0)
- {
- return 1;
- }
- gui_EMS_input_box_backspace(&MMI_EMS_inputbox);
- if (inputchar == 0x0e47) /* */
- {
- r = gui_EMS_input_box_get_previous_object(MMI_EMS_inputbox.data, &p, &cc, ¤t_object);
- if (r == 1 && ((cc >= 0x0e34 && cc <= 0x0e39) || cc == 0x0e31))
- {
- gui_EMS_input_box_backspace(&MMI_EMS_inputbox);
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, inputchar);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- return 1;
- }
- }
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, inputchar);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- return 1;
- }
- else if (c >= 0x0e01 && c <= 0x0e2e)
- {
- /* msz00065_20051010 peng hua add for multitap thai begin */
- if (gui_EMS_check_input_test_overflow(&MMI_EMS_inputbox, inputchar))
- /* msz00065_20051010 peng hua add for multitap thai end */
- {
- *updatef = 1;
- }
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, inputchar);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- return 1;
- }
- else if ((c >= 0x0e34 && c <= 0x0e39) || c == 0x0e31)
- {
- /* msz00065_20051010 peng hua add for multitap thai begin */
- if (gui_EMS_check_input_test_overflow(&MMI_EMS_inputbox, inputchar))
- /* msz00065_20051010 peng hua add for multitap thai end */
- {
- *updatef = 1;
- }
- if (inputchar == 0x0e47) /* */
- {
- gui_EMS_input_box_backspace(&MMI_EMS_inputbox);
- }
- gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, inputchar);
- redraw_EMS_inputbox();
- wgui_EMS_redraw_remaining_characters_display();
- return 1;
- }
- else
- {
- if (*updatef == 1)
- {
- gui_EMS_input_box_backspace(&MMI_EMS_inputbox);
- }
- return 1;
- }
- }
- if ((inputchar == 0x0e46 || inputchar == 0x0e2f || inputchar == 0x0e3f) && *updatef == 1)
- {
- gui_EMS_input_box_backspace(&MMI_EMS_inputbox);
- MMI_EMS_inputbox.flags &= ~UI_EMS_INPUT_BOX_STATE_MULTITAP;
- // gui_EMS_input_box_insert_character(&MMI_EMS_inputbox,inputchar);
- // redraw_EMS_inputbox();
- return 2;
- }
- }
- else /* object */
- {
- if ((inputchar >= 0x0e34 && inputchar <= 0x0e39) || inputchar == 0x0e31)
- {
- return 0;
- }
- if (inputchar >= 0x0e47 && inputchar <= 0x0e4c)
- {
- return 0;
- }
- }
- return 2;
- }
- #endif /* __MMI_MULTITAP_THAI__ */
- /*****************************************************************************
- * FUNCTION
- * register_EMS_multitap_function
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void register_EMS_multitap_function(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W06.09 Touch Screen With Keypad V1 */
- #if defined(__MMI_FULL_SCREEN_EDITOR__) || defined(__MMI_TOUCH_SCREEN__)
- register_multitap_no_draw_key_handlers();
- #else
- register_multitap_key_handlers();
- #endif
- register_keyboard_input_handler(EMS_inputbox_alphanumeric_keyboard_input_handler);
- set_multitap_functions(EMS_inputbox_multitap_input, EMS_inputbox_multitap_input_complete);
- wgui_set_EMS_inputbox_RSK();
- register_EMS_inputbox_keys();
- SetKeyHandler(wgui_EMS_inputbox_handle_symbol_picker_star_key, KEY_STAR, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * register_EMS_inputbox_viewer_keys
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void register_EMS_inputbox_viewer_keys(void)
- {
- #ifdef __MMI_MESSAGES_EMS__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(EMS_inputbox_previous_object, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EMS_inputbox_next_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- #else /* __MMI_MESSAGES_EMS__ */
- SetKeyHandler(EMS_inputbox_previous, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EMS_inputbox_next, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- #endif /* __MMI_MESSAGES_EMS__ */
- SetKeyHandler(EMS_inputbox_previous_line, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EMS_inputbox_next_line, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EMS_inputbox_previous_line, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(EMS_inputbox_next_line, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- register_keyboard_key_handler(EMS_inputbox_viewer_key_handler);
- }
- /*****************************************************************************
- * FUNCTION
- * reset_EMS_inputbox
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void reset_EMS_inputbox(void)
- {
- #if(UI_BLINKING_CURSOR_SUPPORT)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //gui_cancel_timer(UI_inputbox_blink_cursor);
- //MTK Elvis
- StopMyTimer(BLINKING_CURSOR);
- /* MTK end */
- #endif /* (UI_BLINKING_CURSOR_SUPPORT) */
- #ifdef __MMI_MESSAGES_EMS__
- EMS_cancel_object_focus();
- #endif
- reset_multitaps();
- clear_keyboard_key_handler();
- clear_keyboard_input_handler();
- clear_multitap_key_handlers();
- ClearKeyHandler(KEY_CLEAR, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_CLEAR, KEY_EVENT_UP);
- ClearKeyHandler(KEY_CLEAR, KEY_EVENT_LONG_PRESS);
- #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_EMS_INPUTBOX_FRAME_SKIPPING))
- gui_cancel_timer(wgui_EMS_inputbox_end_frame);
- wgui_EMS_inputbox_frame_counter = 0;
- #endif /* ((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_EMS_INPUTBOX_FRAME_SKIPPING)) */
- EMS_inputbox_input_callback = UI_dummy_function;
- }
- /*****************************************************************************
- * FUNCTION
- * test_EMS_inputbox_change_mode
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- U8 test_EMS_inputbox_change_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* MTK Elvis */
- if (MMI_EMS_inputbox.UCS2_count == 0)
- {
- if (EMSSetDCS(MMI_EMS_inputbox.data, SMSAL_UCS2_DCS) == EMS_OK &&
- EMS_get_remaining_length(MMI_EMS_inputbox.data) >= 2)
- {
- EMSSetDCS(MMI_EMS_inputbox.data, SMSAL_DEFAULT_DCS);
- return 1;
- }
- else
- {
- EMSSetDCS(MMI_EMS_inputbox.data, SMSAL_DEFAULT_DCS);
- return 0;
- }
- }
- else
- {
- return 1;
- }
- /* MTK end */
- }
- /* Temporary data: for testing */
- #ifdef __MMI_MESSAGES_EMS__
- const U8 EMS_sample_melody_object_PDU_1[] =
- {
- #if(0)
- EMS_PREDEFINED_MELODY, 0x69, 0x00,
- 'B','E','G','I','N',':','I','M','E','L','O','D','Y','n',
- 'V','E','R','S','I','O','N',':','1','.','2','n',
- 'F','O','R','M','A','T',':','C','L','A','S','S','1','.','0','n',
- 'M','E','L','O','D','Y',':','*','4','#','f','2','*','4','a','3','.','*','4','#','f','3','*','4','#','f','4','*','4','#','a','3','*','4','#','f','3','*','4','e','3','*','4','#','f','2','*','5','c','3','n',
- 'E','N','D',':','I','M','E','L','O','D','Y','n',
- #else /* (0) */
- EMS_PREDEFINED_MELODY, 0x74, 0x00,
- 'B', 'E', 'G', 'I', 'N', ':', 'I', 'M', 'E', 'L', 'O', 'D', 'Y', 'n',
- 'V', 'E', 'R', 'S', 'I', 'O', 'N', ':', '1', '.', '2', 'n',
- 'F', 'O', 'R', 'M', 'A', 'T', ':', 'C', 'L', 'A', 'S', 'S', '1', '.', '0', 'n',
- 'B', 'E', 'A', 'T', ':', '1', '2', '0', 'n',
- 'C', 'O', 'M', 'P', 'O', 'S', 'E', 'R', ':', 'M', 'T', 'K', '(', '2', ')', 'n',
- 'M', 'E', 'L', 'O', 'D', 'Y', ':', 'c', '2', 'd', '2', 'e', '2', 'f', '2', 'g', '2', 'a', '2', 'b', '2', 'n',
- 'E', 'N', 'D', ':', 'I', 'M', 'E', 'L', 'O', 'D', 'Y', 'n',
- #endif /* (0) */
- };
- const U8 EMS_sample_melody_object_PDU_2[] = {EMS_PREDEFINED_MELODY, 0x6c, 0x00,
- 'B', 'E', 'G', 'I', 'N', ':', 'I', 'M', 'E', 'L', 'O', 'D', 'Y', 'n',
- 'V', 'E', 'R', 'S', 'I', 'O', 'N', ':', '1', '.', '2', 'n',
- 'F', 'O', 'R', 'M', 'A', 'T', ':', 'C', 'L', 'A', 'S', 'S', '1', '.', '0', 'n',
- 'M', 'E', 'L', 'O', 'D', 'Y', ':', '*', '5', 'f', '0', '*', '5', '#', 'g', '2', '*', '5', 'g', '3', '*', '5', '#',
- 'd', '0', '*', '5', '#', 'g', '2', '*', '5', 'g', '3', '*', '5', 'c', '0', '*', '5', '#', 'g', '2', '*', '5',
- 'g', '3', '*', '4', '#', 'g', '0', 'n',
- 'E', 'N', 'D', ':', 'I', 'M', 'E', 'L', 'O', 'D', 'Y', 'n',
- };
- const U8 EMS_sample_picture_object_PDU_1[] = {EMS_USERDEFINED_PICTURE, 0x01, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00,
- 0x07, 0xE0, 0x08, 0x10, 0x30, 0x0C, 0x20, 0x04, 0x4E, 0x72, 0x9A, 0x59, 0x86, 0x61, 0x80, 0x01,
- 0x80, 0x01, 0x90, 0x09, 0x88, 0x11, 0x47, 0xE2, 0x23, 0xC4, 0x30, 0x0C, 0x08, 0x10, 0x07, 0xE0,
- };
- #if(!ENABLE_EMS_TEST_OBJECTS)
- const U8 EMS_sample_picture_object_PDU_2[] = {EMS_PREDEFINED_PICTURE, 0x01, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0x03, 0xA0, 0x05, 0x90, 0x09, 0x88, 0x11, 0x8C, 0x31,
- 0x93, 0xC9, 0xA0, 0x05, 0xC0, 0x03, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- };
- #else /* (!ENABLE_EMS_TEST_OBJECTS) */
- const U8 EMS_sample_picture_object_PDU_2[] = {EMS_PREDEFINED_MELODY, 0x6a, 0x00,
- 'B', 'E', 'G', 'I', 'N', ':', 'I', 'M', 'E', 'L', 'O', 'D', 'Y', 'n',
- 'V', 'E', 'R', 'S', 'I', 'O', 'N', ':', '1', '.', '2', 'n',
- 'F', 'O', 'R', 'M', 'A', 'T', ':', 'C', 'L', 'A', 'S', 'S', '1', '.', '0', 'n',
- 'M', 'E', 'L', 'O', 'D', 'Y', ':', '*', '4', '#', 'f', '2', '*', '4', 'a', '3', '.', '*', '4', '#', 'f', '3', '*',
- '4', '#', 'f', '4', '*', '4', '#', 'a', '3', '*', '4', '#', 'f', '3', '*', '4', 'e', '3', '*', '4', '#', 'f',
- '2', '*', '5', 'c', '3', 'n',
- 'E', 'N', 'D', ':', 'I', 'M', 'E', 'L', 'O', 'D', 'Y', 'n',
- };
- #endif /* (!ENABLE_EMS_TEST_OBJECTS) */
- #if(!ENABLE_EMS_TEST_OBJECTS)
- const U8 EMS_sample_picture_object_PDU_3[] = {EMS_PREDEFINED_PICTURE, 0x01, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00,
- 0x01, 0x80, 0x03, 0xC0, 0x03, 0xC0, 0x07, 0xE0, 0x0F, 0xF0, 0x1F, 0xF8, 0x3F, 0xFC, 0x3F, 0xFC,
- 0x7F, 0xFE, 0x7F, 0xFE, 0x7F, 0xFE, 0x3D, 0xBC, 0x19, 0x98, 0x01, 0x80, 0x01, 0x80, 0x07, 0xE0,
- };
- #else /* (!ENABLE_EMS_TEST_OBJECTS) */
- const U8 EMS_sample_picture_object_PDU_3[] = {EMS_PREDEFINED_ANIMATION, 0x01,
- };
- #endif /* (!ENABLE_EMS_TEST_OBJECTS) */
- #if(!ENABLE_EMS_TEST_OBJECTS)
- const U8 EMS_sample_picture_object_PDU_4[] = {EMS_PREDEFINED_PICTURE, 0x01, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00,
- 0x07, 0xE0, 0x08, 0x10, 0x30, 0x0C, 0x20, 0x04, 0x5C, 0x3A, 0x86, 0x61, 0x86, 0x61, 0x80, 0x01,
- 0x80, 0x01, 0x81, 0xC1, 0x82, 0x21, 0x44, 0x12, 0x20, 0x04, 0x30, 0x0C, 0x08, 0x10, 0x07, 0xE0,
- };
- #else /* (!ENABLE_EMS_TEST_OBJECTS) */
- const U8 EMS_sample_picture_object_PDU_4[] = {EMS_PREDEFINED_MELODY, 0x6c, 0x00,
- 'B', 'E', 'G', 'I', 'N', ':', 'I', 'M', 'E', 'L', 'O', 'D', 'Y', 'n',
- 'V', 'E', 'R', 'S', 'I', 'O', 'N', ':', '1', '.', '2', 'n',
- 'F', 'O', 'R', 'M', 'A', 'T', ':', 'C', 'L', 'A', 'S', 'S', '1', '.', '0', 'n',
- 'M', 'E', 'L', 'O', 'D', 'Y', ':', '*', '5', 'f', '0', '*', '5', '#', 'g', '2', '*', '5', 'g', '3', '*', '5', '#',
- 'd', '0', '*', '5', '#', 'g', '2', '*', '5', 'g', '3', '*', '5', 'c', '0', '*', '5', '#', 'g', '2', '*', '5',
- 'g', '3', '*', '4', '#', 'g', '0', 'n',
- 'E', 'N', 'D', ':', 'I', 'M', 'E', 'L', 'O', 'D', 'Y', 'n',
- };
- #endif /* (!ENABLE_EMS_TEST_OBJECTS) */
- const U8 EMS_sample_picture_object_PDU_5[] = {EMS_PREDEFINED_PICTURE, 0x01, 0x18, 0x00, 0x18, 0x00, 0x48, 0x00,
- 0x05, 0x80, 0x00, 0x10, 0x60, 0x00, 0x42, 0x1D, 0xC0, 0x80, 0x06, 0x30, 0x00, 0x29, 0x8C, 0x98,
- 0x02, 0xA2, 0x9E, 0x00, 0xB5, 0x9F, 0x82, 0x77, 0x1F, 0xE1, 0x5B, 0x9F, 0xF9, 0x75, 0x9F, 0xF9,
- 0x5B, 0x1F, 0xF9, 0x75, 0x9F, 0xF9, 0x5B, 0x9F, 0xF9, 0x77, 0x1F, 0xF9, 0x5B, 0xC7, 0xF9, 0x75,
- 0xA1, 0xF9, 0xBA, 0x38, 0x78, 0xDC, 0x0E, 0x1A, 0xB8, 0x03, 0x81, 0x70, 0x00, 0xF1, 0x50, 0x00,
- 0x3D, 0x70, 0x00, 0x0E, 0xE0, 0x00, 0x03, 0x80,
- };
- #if(!ENABLE_EMS_TEST_OBJECTS)
- const U8 EMS_sample_picture_object_PDU_6[] = {EMS_PREDEFINED_PICTURE, 0x01, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00,
- 0x07, 0xE0, 0x08, 0x10, 0x30, 0x0C, 0x26, 0x64, 0x48, 0x12, 0x90, 0x09, 0x86, 0x61, 0x86, 0x61,
- 0x80, 0x01, 0x83, 0xC1, 0x87, 0xE1, 0x47, 0xE2, 0x23, 0xC4, 0x30, 0x0C, 0x08, 0x10, 0x07, 0xE0,
- };
- #else /* (!ENABLE_EMS_TEST_OBJECTS) */
- const U8 EMS_sample_picture_object_PDU_6[] = {EMS_PREDEFINED_SOUND, 0x01,
- };
- #endif /* (!ENABLE_EMS_TEST_OBJECTS) */
- #if(!ENABLE_EMS_TEST_OBJECTS)
- const U8 EMS_sample_picture_object_PDU_7[] = {EMS_PREDEFINED_PICTURE, 0x01, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00,
- 0x07, 0xE0, 0x08, 0x10, 0x30, 0x0C, 0x2C, 0x64, 0x52, 0x92, 0x96, 0xB1, 0x8C, 0x61, 0x80, 0x01,
- 0xBF, 0xFD, 0xA9, 0x25, 0x99, 0x29, 0x59, 0x2A, 0x29, 0x34, 0x37, 0xEC, 0x08, 0x10, 0x07, 0xE0,
- };
- #else /* (!ENABLE_EMS_TEST_OBJECTS) */
- const U8 EMS_sample_picture_object_PDU_7[] = {EMS_PREDEFINED_ANIMATION, 0x02,
- };
- #endif /* (!ENABLE_EMS_TEST_OBJECTS) */
- #if(!ENABLE_EMS_TEST_OBJECTS)
- const U8 EMS_sample_picture_object_PDU_8[] = {0x01, 0x01, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00,
- 0x03, 0xC0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x03, 0xC0, 0x01, 0x80, 0x19, 0x98, 0x3D, 0xBC,
- 0x7F, 0xFE, 0x7F, 0xFE, 0x7F, 0xFE, 0x3D, 0xBC, 0x19, 0x98, 0x01, 0x80, 0x01, 0x80, 0x07, 0xE0,
- };
- #else /* (!ENABLE_EMS_TEST_OBJECTS) */
- const U8 EMS_sample_picture_object_PDU_8[] = {EMS_USERDEFINED_ANIMATION, 0x01, 0x08, 0x00, 0x08, 0x00, 0x20, 0x00,
- 0xFF, 0x81, 0x81, 0x81, 0xF1, 0xD1, 0xF1, 0xFF,
- 0xFF, 0x81, 0x81, 0x81, 0x8F, 0x8B, 0x8F, 0xFF,
- 0xFF, 0x8F, 0x8B, 0x8F, 0x81, 0x81, 0x81, 0xFF,
- 0xFF, 0xF1, 0xD1, 0xF1, 0x81, 0x81, 0x81, 0xFF,
- };
- #endif /* (!ENABLE_EMS_TEST_OBJECTS) */
- #if(!ENABLE_EMS_TEST_OBJECTS)
- const U8 EMS_sample_picture_object_PDU_9[] = {0x01, 0x01, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00,
- 0x07, 0xE0, 0x08, 0x10, 0x30, 0x0C, 0x20, 0x04, 0x79, 0xCE, 0xBF, 0xF9, 0xB9, 0xC1, 0x80, 0x01,
- 0x80, 0x01, 0x9F, 0x01, 0x9F, 0x81, 0x4F, 0xC2, 0x27, 0xC4, 0x30, 0x0C, 0x08, 0x10, 0x07, 0xE0,
- };
- #else /* (!ENABLE_EMS_TEST_OBJECTS) */
- const U8 EMS_sample_picture_object_PDU_9[] = {EMS_USERDEFINED_ANIMATION, 0x01, 0x10, 0x00, 0x10, 0x00, 0x80, 0x00,
- 0x0F, 0xF8, 0x0F, 0xF8, 0x04, 0x10, 0x04, 0x10, 0x04, 0x10, 0x04, 0x10, 0x02, 0x20, 0x01, 0x40,
- 0x01, 0x40, 0x02, 0x20, 0x04, 0x10, 0x04, 0x10, 0x04, 0x10, 0x04, 0x10, 0x0F, 0xF8, 0x0F, 0xF8,
- 0x06, 0x00, 0x0E, 0x00, 0x1F, 0x00, 0x38, 0x80, 0x70, 0x40, 0xE0, 0x40, 0x60, 0x40, 0x10, 0x40,
- 0x0F, 0x3C, 0x00, 0x82, 0x00, 0x81, 0x00, 0x83, 0x00, 0x87, 0x00, 0x4E, 0x00, 0x3C, 0x00, 0x38,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0xFC, 0x3F, 0xC2, 0x43, 0xC1, 0x83, 0xC0, 0x03,
- 0xC1, 0x83, 0xC2, 0x43, 0xFC, 0x3F, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x38, 0x00, 0x3C, 0x00, 0x4E, 0x00, 0x87, 0x00, 0x83, 0x00, 0x81, 0x00, 0x82, 0x0F, 0x3C,
- 0x10, 0x40, 0x60, 0x40, 0xE0, 0x40, 0x70, 0x40, 0x38, 0x80, 0x1F, 0x00, 0x0E, 0x00, 0x06, 0x00,
- };
- #endif /* (!ENABLE_EMS_TEST_OBJECTS) */
- const U8 EMS_sample_picture_object_PDU_10[] = {EMS_PREDEFINED_PICTURE, 0x01, 0x20, 0x00, 0x20, 0x00, 0x80, 0x00,
- 0x00, 0xFE, 0x00, 0x00, 0x07, 0xFF, 0x80, 0x00, 0x3F, 0xFF, 0x70, 0x00, 0x7F, 0xFF, 0x8E, 0x00,
- 0x47, 0xFF, 0xC1, 0xC0, 0x40, 0xFF, 0xE0, 0x38, 0x40, 0x1F, 0xF0, 0x06, 0x40, 0x03, 0xF8, 0x02,
- 0x40, 0x00, 0x7C, 0x0E, 0x40, 0x00, 0x0E, 0x3E, 0x40, 0x00, 0x00, 0xFE, 0x20, 0x78, 0x03, 0xFC,
- 0x22, 0x1D, 0x03, 0xFC, 0x27, 0x0F, 0x03, 0xFC, 0x2F, 0x87, 0x03, 0xFC, 0x23, 0xCF, 0x07, 0xF8,
- 0x23, 0x03, 0x07, 0xF8, 0x13, 0x00, 0x07, 0xF8, 0x11, 0x00, 0x07, 0xF8, 0x11, 0x08, 0x8F, 0xF0,
- 0x10, 0x88, 0x8F, 0xF0, 0x10, 0x59, 0x8F, 0xF0, 0x08, 0x3F, 0x8F, 0xE0, 0x08, 0x1F, 0x1F, 0xE0,
- 0x08, 0x0C, 0x1F, 0xE0, 0x04, 0x02, 0x1F, 0xE0, 0x03, 0x00, 0x1F, 0xC0, 0x00, 0xC0, 0x1F, 0xC0,
- 0x00, 0x30, 0x3F, 0xC0, 0x00, 0x0C, 0x3F, 0x00, 0x00, 0x03, 0x3C, 0x00, 0x00, 0x00, 0xF0, 0x00,
- };
- const U8 EMS_sample_picture_object_PDU_11[] = {0x01, 0x01, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00,
- 0x00, 0x00, 0x1F, 0xF8, 0x20, 0x06, 0x26, 0x66, 0x23, 0xC6, 0x21, 0x86, 0x23, 0xC6, 0x26, 0x66,
- 0x20, 0x06, 0x20, 0x06, 0x2A, 0xAE, 0x20, 0x06, 0x35, 0x56, 0x2A, 0xAE, 0x3F, 0xFE, 0x1F, 0xFC,
- };
- const U8 EMS_sample_animation_object_PDU_11[] = {EMS_USERDEFINED_ANIMATION, 0x01, 0x08, 0x00, 0x08, 0x00, 0x20, 0x00,
- 0xFF, 0x81, 0x81, 0x81, 0xF1, 0xD1, 0xF1, 0xFF,
- 0xFF, 0x81, 0x81, 0x81, 0x8F, 0x8B, 0x8F, 0xFF,
- 0xFF, 0x8F, 0x8B, 0x8F, 0x81, 0x81, 0x81, 0xFF,
- 0xFF, 0xF1, 0xD1, 0xF1, 0x81, 0x81, 0x81, 0xFF,
- };
- #define MAX_EMS_PREDEFINED_PICTURES 10
- #if(ENABLE_EMS_TEST_OBJECTS)
- /* Temporary: Needs to populated with actual picture data */
- U8 *EMS_predefined_pictures[MAX_EMS_PREDEFINED_PICTURES] = { (U8 *) EMS_sample_picture_object_PDU_1,
- (U8 *) EMS_sample_picture_object_PDU_2,
- (U8 *) EMS_sample_picture_object_PDU_3,
- (U8 *) EMS_sample_picture_object_PDU_4,
- (U8 *) EMS_sample_picture_object_PDU_5,
- (U8 *) EMS_sample_picture_object_PDU_6,
- (U8 *) EMS_sample_picture_object_PDU_7,
- (U8 *) EMS_sample_picture_object_PDU_8,
- (U8 *) EMS_sample_picture_object_PDU_9,
- (U8 *) EMS_sample_picture_object_PDU_10,
- };
- #else /* (ENABLE_EMS_TEST_OBJECTS) */
- /* This gets populated at run time with picture data */
- U8 *EMS_predefined_pictures[MAX_EMS_PREDEFINED_PICTURES] = { (U8 *) EMS_sample_picture_object_PDU_11,
- (U8 *) EMS_sample_picture_object_PDU_11,
- (U8 *) EMS_sample_picture_object_PDU_11,
- (U8 *) EMS_sample_picture_object_PDU_11,
- (U8 *) EMS_sample_picture_object_PDU_11,
- (U8 *) EMS_sample_picture_object_PDU_11,
- (U8 *) EMS_sample_picture_object_PDU_11,
- (U8 *) EMS_sample_picture_object_PDU_11,
- (U8 *) EMS_sample_picture_object_PDU_11,
- (U8 *) EMS_sample_picture_object_PDU_11,
- };
- #endif /* (ENABLE_EMS_TEST_OBJECTS) */
- U16 EMS_predefined_images[MAX_EMS_PREDEFINED_PICTURES] = {IMG_EMS01_PIC,
- IMG_EMS02_PIC,
- IMG_EMS03_PIC,
- IMG_EMS04_PIC,
- IMG_EMS05_PIC,
- IMG_EMS06_PIC,
- IMG_EMS07_PIC,
- IMG_EMS08_PIC,
- IMG_EMS09_PIC,
- IMG_EMS010_PIC
- };
- #define MAX_EMS_PREDEFINED_ANIMATIONS 15
- U16 EMS_predefined_animations[MAX_EMS_PREDEFINED_ANIMATIONS] = {EMS_BI_ANIMATION_0_ID,
- EMS_BI_ANIMATION_1_ID,
- EMS_BI_ANIMATION_2_ID,
- EMS_BI_ANIMATION_3_ID,
- EMS_BI_ANIMATION_4_ID,
- EMS_BI_ANIMATION_5_ID,
- EMS_BI_ANIMATION_6_ID,
- EMS_BI_ANIMATION_7_ID,
- EMS_BI_ANIMATION_8_ID,
- EMS_BI_ANIMATION_9_ID,
- EMS_BI_ANIMATION_10_ID,
- EMS_BI_ANIMATION_11_ID,
- EMS_BI_ANIMATION_12_ID,
- EMS_BI_ANIMATION_13_ID,
- EMS_BI_ANIMATION_14_ID,
- };
- #define MAX_EMS_PREDEFINED_SOUNDS 10
- /* Temporary: Needs to be populated with the actual sound IDs */
- U16 EMS_predefined_sounds[MAX_EMS_PREDEFINED_SOUNDS] =
- {
- EMS_CHIMES_HIGH,
- EMS_CHIMES_LOW,
- EMS_DING,
- EMS_TADA,
- EMS_NOTIFY,
- EMS_DRUM,
- EMS_CLAPS,
- EMS_FANFAR,
- EMS_CHORE_HGH,
- EMS_CHORE_LOW,
- };
- #define MAX_EMS_PREDEFINED_MELODIES 10
- /* Temporary: Needs to be populated with the actual melody data */
- U8 *EMS_predefined_melodies[MAX_EMS_PREDEFINED_MELODIES] =
- {
- (U8 *) EMS_sample_melody_object_PDU_1,
- (U8 *) EMS_sample_melody_object_PDU_2,
- (U8 *) EMS_sample_melody_object_PDU_1,
- (U8 *) EMS_sample_melody_object_PDU_2,
- (U8 *) EMS_sample_melody_object_PDU_1,
- (U8 *) EMS_sample_melody_object_PDU_2,
- (U8 *) EMS_sample_melody_object_PDU_1,
- (U8 *) EMS_sample_melody_object_PDU_2,
- (U8 *) EMS_sample_melody_object_PDU_1,
- (U8 *) EMS_sample_melody_object_PDU_2,
- };
- /* data used for EMS_USERDEFINED_PICTURE, EMS_USERDEFINED_ANIMATION, EMS_USER_DEFINED_MELODY
- index used for EMS_PREDEFINED_PICTURE, EMS_PREDEFINED_MELODY.
- If index==-1, data is used for EMS_PREDEFINED_PICTURE, EMS_PREDEFINED_MELODY. */
- /*****************************************************************************
- * FUNCTION
- * EMS_load_object
- * DESCRIPTION
- *
- * PARAMETERS
- * type [IN]
- * data [?]
- * index [IN]
- * object [?]
- * RETURNS
- *
- *****************************************************************************/
- EMSTATUS EMS_load_object(U32 type, U8 *data, S32 index, EMSObjData *object)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 ID;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (type & 0xff)
- {
- case EMS_PREDEFINED_PICTURE:
- {
- if ((index >= MAX_EMS_PREDEFINED_PICTURES))
- {
- return (EMS_INVALID_OBJECT);
- }
- if (index >= 0)
- {
- data = EMS_predefined_pictures[index];
- }
- if (data == NULL)
- {
- return (EMS_NULL_POINTER);
- }
- ID = data[0];
- if (ID == EMS_PREDEFINED_PICTURE)
- {
- object->picture.bitsPerPixel = data[1];
- object->picture.attribute = data[2];
- object->picture.hDim = data[3] | (data[4] << 8);
- object->picture.vDim = data[5] | (data[6] << 8);
- object->picture.pdu_length = data[7] | (data[8] << 8);
- data += 9;
- object->picture.pdu = data;
- #ifdef __EMS_REL5__
- if ((object->picture.hDim == 0) || (object->picture.vDim == 0)
- || (object->picture.pdu_length == 0) || (object->picture.attribute == 1))
- #else /* __EMS_REL5__ */
- if ((object->picture.hDim == 0) || (object->picture.vDim == 0)
- || (object->picture.pdu_length == 0) || (object->picture.pdu_length > EMS_MAX_IMELODY_SIZE))
- #endif /* __EMS_REL5__ */
- return (EMS_INVALID_OBJECT);
- }
- else
- {
- return (EMS_INVALID_OBJECT);
- }
- }
- break;
- case EMS_USERDEFINED_PICTURE:
- {
- if (data == NULL)
- {
- return (EMS_NULL_POINTER);
- }
- ID = data[0];
- if (ID == EMS_USERDEFINED_PICTURE)
- {
- object->picture.bitsPerPixel = data[1];
- object->picture.attribute = data[2];
- object->picture.hDim = data[3] | (data[4] << 8);
- object->picture.vDim = data[5] | (data[6] << 8);
- object->picture.pdu_length = data[7] | (data[8] << 8);
- data += 9;
- object->picture.pdu = data;
- #ifdef __EMS_REL5__
- if ((object->picture.hDim == 0) || (object->picture.vDim == 0)
- || (object->picture.pdu_length == 0) || (object->picture.attribute == 1))
- #else /* __EMS_REL5__ */
- if ((object->picture.hDim == 0) || (object->picture.vDim == 0)
- || (object->picture.pdu_length == 0) || (object->picture.pdu_length > EMS_MAX_IMELODY_SIZE))
- #endif /* __EMS_REL5__ */
- return (EMS_INVALID_OBJECT);
- }
- else
- {
- return (EMS_INVALID_OBJECT);
- }
- }
- break;
- case EMS_USERDEFINED_ANIMATION:
- {
- if (data == NULL)
- {
- return (EMS_NULL_POINTER);
- }
- ID = data[0];
- if (ID == EMS_USERDEFINED_ANIMATION)
- {
- object->animation.bitsPerPixel = data[1];
- object->animation.attribute = data[2];
- object->animation.cFrame = data[3];
- object->animation.cRepeat = data[4];
- object->animation.Duration = data[5];
- object->animation.hDim = data[6] | (data[7] << 8);
- object->animation.vDim = data[8] | (data[9] << 8);
- object->animation.pdu_length = data[10] | (data[11] << 8);
- data += 12;
- object->animation.pdu = data;
- #ifdef __EMS_REL5__
- if ((object->animation.hDim == 0) || (object->animation.vDim == 0)
- || (object->animation.pdu_length == 0)
- || (object->animation.attribute == 1) || (object->animation.cFrame == 0))
- #else /* __EMS_REL5__ */
- if ((object->animation.hDim == 0) || (object->animation.vDim == 0)
- || (object->animation.pdu_length == 0) || (object->animation.pdu_length > EMS_MAX_IMELODY_SIZE))
- #endif /* __EMS_REL5__ */
- return (EMS_INVALID_OBJECT);
- }
- else
- {
- return (EMS_INVALID_OBJECT);
- }
- }
- break;
- /* MTK Joy added for customization, 1014 */
- #if defined(__MMI_IMELODY_SUPPORT__)
- case EMS_PREDEFINED_MELODY:
- {
- if ((index >= MAX_EMS_PREDEFINED_MELODIES))
- {
- return (EMS_INVALID_OBJECT);
- }
- if (index >= 0)
- {
- data = EMS_predefined_melodies[index];
- }
- if (data == NULL)
- {
- return (EMS_NULL_POINTER);
- }
- ID = data[0];
- if (ID == EMS_PREDEFINED_MELODY)
- {
- object->sound.attribute = data[1];
- object->sound.pdu_length = data[2] | (data[3] << 8);
- data += 4;
- object->sound.pdu = data;
- #ifdef __EMS_REL5__
- if ((object->sound.pdu_length == 0) || (object->sound.attribute == 1))
- #else
- if ((object->sound.pdu_length == 0) || (object->sound.pdu_length > EMS_MAX_IMELODY_SIZE))
- #endif
- return (EMS_INVALID_OBJECT);
- }
- else
- {
- return (EMS_INVALID_OBJECT);
- }
- }
- break;
- case EMS_USERDEFINED_MELODY:
- {
- if (data == NULL)
- {
- return (EMS_NULL_POINTER);
- }
- ID = data[0];
- if (ID == EMS_USERDEFINED_MELODY)
- {
- object->sound.attribute = data[1];
- object->sound.pdu_length = data[2] | (data[3] << 8);
- data += 4;
- object->sound.pdu = data;
- #ifdef __EMS_REL5__
- if ((object->sound.pdu_length == 0) || (object->sound.attribute == 1))
- #else
- if ((object->sound.pdu_length == 0) || (object->sound.pdu_length > EMS_MAX_IMELODY_SIZE))
- #endif
- return (EMS_INVALID_OBJECT);
- }
- else
- {
- return (EMS_INVALID_OBJECT);
- }
- }
- break;
- #endif /* defined(__MMI_IMELODY_SUPPORT__) */
- /* MTK end */
- }
- return (EMS_OK);
- }
- #if(ENABLE_EMS_TEST_DEMO || ENABLE_EMS_TEST_OBJECTS) /* test_block */
- #define MAX_EMS_TEST_OBJECTS 10
- U8 EMS_test_object_count = 0;
- U8 *EMS_test_objects[MAX_EMS_TEST_OBJECTS] = { (U8 *) EMS_sample_picture_object_PDU_1,
- (U8 *) EMS_sample_picture_object_PDU_2,
- (U8 *) EMS_sample_picture_object_PDU_3,
- (U8 *) EMS_sample_picture_object_PDU_4,
- (U8 *) EMS_sample_picture_object_PDU_5,
- (U8 *) EMS_sample_picture_object_PDU_6,
- (U8 *) EMS_sample_picture_object_PDU_7,
- (U8 *) EMS_sample_picture_object_PDU_8,
- (U8 *) EMS_sample_picture_object_PDU_9,
- (U8 *) EMS_sample_picture_object_PDU_10,
- };
- #endif /* (ENABLE_EMS_TEST_DEMO || ENABLE_EMS_TEST_OBJECTS) */
- #if(ENABLE_EMS_TEST_DEMO) /* test_block */
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_insert_object
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_inputbox_insert_object(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS ret;
- U8 *data;
- U8 ID;
- S32 index = EMS_test_object_count++;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (EMS_test_object_count > 9)
- {
- EMS_test_object_count = 0;
- }
- data = EMS_test_objects[index];
- ID = data[0];
- switch (ID)
- {
- case EMS_PREDEFINED_PICTURE:
- case EMS_USERDEFINED_PICTURE:
- ret = EMS_load_object(EMS_PREDEFINED_PICTURE, data, index, &object);
- if (ret == EMS_OK)
- {
- ret = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_PIC, &object, 0);
- }
- break;
- case EMS_USERDEFINED_ANIMATION:
- ret = EMS_load_object(EMS_USERDEFINED_ANIMATION, data, index, &object);
- if (ret == EMS_OK)
- {
- ret = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_USERDEF_ANM, &object, 0);
- }
- break;
- case EMS_PREDEFINED_ANIMATION:
- ret = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_PREDEF_ANM, NULL, data[1]);
- break;
- case EMS_PREDEFINED_SOUND:
- ret = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_PREDEF_SND, NULL, data[1]);
- break;
- case EMS_PREDEFINED_MELODY:
- ret = EMS_load_object(EMS_PREDEFINED_MELODY, data, index, &object);
- if (ret == EMS_OK)
- {
- ret = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_USERDEF_SND, &object, 0);
- }
- break;
- }
- /* show_EMS_inputbox(); */
- }
- #endif /* (ENABLE_EMS_TEST_DEMO) */
- #if(ENABLE_EMS_TEST_OBJECTS)
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_insert_predefined_picture
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- *
- *****************************************************************************/
- EMSTATUS EMS_inputbox_insert_predefined_picture(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- EMSTATUS ret;
- U8 *data;
- U8 ID;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (index < 0)
- {
- index = 0;
- }
- if (index > (MAX_EMS_TEST_OBJECTS - 1))
- {
- index = MAX_EMS_TEST_OBJECTS - 1;
- }
- data = EMS_test_objects[index];
- ID = data[0];
- switch (ID)
- {
- case EMS_PREDEFINED_PICTURE:
- case EMS_USERDEFINED_PICTURE:
- ret = EMS_load_object(EMS_PREDEFINED_PICTURE, data, index, &object);
- if (ret == EMS_OK)
- {
- ret = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_PIC, &object, 0);
- }
- break;
- case EMS_USERDEFINED_ANIMATION:
- ret = EMS_load_object(EMS_USERDEFINED_ANIMATION, data, index, &object);
- if (ret == EMS_OK)
- {
- ret = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_USERDEF_ANM, &object, 0);
- }
- break;
- case EMS_PREDEFINED_ANIMATION:
- ret = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_PREDEF_ANM, NULL, data[1]);
- break;
- case EMS_PREDEFINED_SOUND:
- ret = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_PREDEF_SND, NULL, data[1]);
- break;
- case EMS_PREDEFINED_MELODY:
- ret = EMS_load_object(EMS_PREDEFINED_MELODY, data, index, &object);
- if (ret == EMS_OK)
- {
- ret = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_USERDEF_SND, &object, 0);
- }
- break;
- }
- return (ret);
- }
- #else /* (ENABLE_EMS_TEST_OBJECTS) */
- /*****************************************************************************
- * FUNCTION
- * EMS_inputbox_insert_predefined_picture
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- *
- *****************************************************************************/
- EMSTATUS EMS_inputbox_insert_predefined_picture(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- U8 *data = NULL;
- EMSTATUS r = EMS_load_object(EMS_PREDEFINED_PICTURE, data, index, &object);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (r == EMS_OK)
- {
- r = gui_EMS_inputbox_add_object(&MMI_EMS_inputbox, EMS_TYPE_PIC, &object, 0);
- }
- return (r);
- }
- #endif /* (ENABLE_EMS_TEST_OBJECTS) */
- /*****************************************************************************
- * FUNCTION
- * EMS_get_object_size
- * DESCRIPTION
- *
- * PARAMETERS
- * type [IN]
- * objdata [?]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_get_object_size(U8 type, EMSObjData *objdata)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (EMSGetObjectSize(type, objdata));
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_check_object_size
- * DESCRIPTION
- *
- * PARAMETERS
- * type [IN]
- * objdata [?]
- * allowed [?]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_check_object_size(U8 type, EMSObjData *objdata, U8 *allowed)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- kal_bool flag;
- S32 size = EMSGetObjectSizeWithCheck(type, objdata, &flag);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (flag == KAL_TRUE)
- {
- *allowed = 1;
- }
- else
- {
- *allowed = 0;
- }
- return (size);
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_load_predefined_picture
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * data [?]
- * RETURNS
- * void
- *****************************************************************************/
- void EMS_load_predefined_picture(S32 index, U8 *data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((index >= 0) && (index < MAX_EMS_PREDEFINED_PICTURES))
- {
- EMS_predefined_pictures[index] = data;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EMS_get_predefined_picture_size
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- *
- *****************************************************************************/
- S32 EMS_get_predefined_picture_size(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSObjData object;
- U8 *data = NULL;
- EMSTATUS r = EMS_load_object(EMS_PREDEFINED_PICTURE, data, index, &object);
- /*----------------------------------------------------------------*/