gui_inputs.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:662k
源码类别:
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:
- * ---------
- * gui_inputs.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * General Editor - UI component
- *
- * [Single-line input box]
- * [Multi-line input box]
- * [Dialer input box]
- *
- * 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!
- *
- * 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: gui_inputs.c
- Author: manju
- Date Created: July-22-2002
- Contains: PixTel UI routines for Input objects
- Contains functions for Multitap,
- Single Line, Multi Line input boxes.
- **********************************************************************************/
- #include "gui_inputs.h"
- #include "gui_themes.h"
- #include "MMI_features.h"
- #include "gui_theme_struct.h"
- #include "GlobalDefs.h"
- #include "kal_non_specific_general_types.h"
- #include "gdi_include.h"
- #include "lcd_sw_rnd.h"
- #include "DebugInitDef.h"
- #include "SimDetectionGprot.h"
- #if defined(__UI_PAGING_IN_MULTILINE_EDITOR__)
- #include "Gui_Setting.h"
- #endif
- /* MTK Arabic Connectivity issue */
- #ifdef __MMI_ZI_V7__
- #include "ezicmn.h"
- #endif
- #if defined (__MMI_ZI_ARABIC__) || defined (__MMI_ZI_PERSIAN__)
- #include "zi8ARshape.h"
- #endif /* defined (__MMI_ZI_ARABIC__) || defined (__MMI_ZI_PERSIAN__) */
- /* MTK End */
- /* if needs to modify this define ,remember to update the define in ChatGType.h */
- #define MAX_MSG_SIZE_UCS2 256
- #ifdef __MMI_HINDI_ALG__
- #include "hf_rules.h"
- #define MAX_EDITOR_DISP_LEN 60
- #endif /* __MMI_HINDI_ALG__ */
- #include "gui_ems.h"
- /* MTK Elvis for R2L characters */
- #include "BIDIDEF.h"
- #include "BIDIProt.h"
- /* MTK end */
- #ifdef __MMI_LANG_VIETNAMESE__
- #include "gui_lang_viet.h"
- #endif
- /* start vijay 20050221 */
- #ifdef __MMI_TOUCH_SCREEN__
- #include "wgui.h"
- #include "TouchScreenGprot.h"
- #include "GlobalConstants.h"
- #endif /* __MMI_TOUCH_SCREEN__ */
- /* end vijay */
- #if defined (__MMI_TOUCH_DIAL_SCREEN_WITH_FUNCTION__)
- /* PMT HIMANSHU START 20050825 */
- #include "IdleAppDef.h"
- #include "SimDetectionGprot.h"
- /* PMT HIMANSHU END 20050825 */
- #endif /* defined (__MMI_TOUCH_DIAL_SCREEN_WITH_FUNCTION__) */
- /* MTK Elvis 20031126 */
- #include "TimerEvents.h"
- /* MTK end */
- #include "wgui_categories.h" /* for WCSS editor */
- #include "wgui_categories_defs.h"
- #include "wgui_categories_inputs.h"
- #ifdef __MMI_ARSHAPING_ENGINE__
- extern void ArabicShapeEngine(PU16, PU16);
- #endif
- #if defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__
- // for total text shaping
- U16 shaping_str[MAX_TEXT_LENGTH * BIDI_ENCODING_LENGTH];
- U16 OrgToSha[MAX_TEXT_LENGTH * BIDI_ENCODING_LENGTH];
- S32 unshaped_text_len = 0;
- // for 2nd pass line shaping
- U16 shaping_str1[128];
- U16 OrgToSha1[128];
- #endif /* defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__ */
- extern void wgui_redraw_remaining_characters_display(void);
- #ifdef __MMI_HINDI_ALG__
- #define UI_CHK_CONSONANT(ch) (( (ch >= 0x15 && ch <= 0x39) || (ch >= 0x58 && ch <= 0x5f) || ch==0x50 )? (1):(0))
- UI_buffer_type save_cursor_p = NULL;
- UI_buffer_type save_cursor_text_p = NULL;
- #endif /* __MMI_HINDI_ALG__ */
- /* MTK Terry for inline multiline issue */
- extern void (*complete_inline_item_edit) (void);
- /* MTK Steven 20050505 */
- #ifdef __MMI_LANG_THAI__
- #define isThaiChar(ch) (((ch >= 0x0E01) && (ch <= 0x0E7F))? (1):(0))
- #endif
- /* MTK End */
- /*
- * Rich text
- */
- typedef enum
- {
- GUI_INPUT_ALIGN_LEFT,
- GUI_INPUT_ALIGN_CENTER,
- GUI_INPUT_ALIGN_RIGHT
- } gui_input_alignment_enum;
- #define GUI_INPUT_IS_MARKER(ch)
- ((ch)>= GUI_INPUT_MARKER_BEGIN && (ch) <= GUI_INPUT_MARKER_END)
- #define GUI_INPUT_IS_FORMAT_MARKER(ch)
- (((ch) & GUI_INPUT_MARKER_FORMAT_MASK) == GUI_INPUT_MARKER_FORMAT)
- #define GUI_INPUT_IS_PARAGRAPH_MARKER(ch)
- (((ch) & GUI_INPUT_MARKER_PARAGRAPH_MASK) == GUI_INPUT_MARKER_PARAGRAPH)
- /* Format marker */
- /* test 1-bit flag */
- #define GUI_INPUT_CHECK_FORMAT_MARKER(ch, flag)
- (((ch) & (flag)) == (flag))
- /* test multiple-bit flag */
- #define GUI_INPUT_CHECK_SIZE_MARKER(ch, flag)
- (((ch) & GUI_INPUT_MARKER_SIZE_MASK) == (flag))
- /* test 1-bit flag */
- #define GUI_INPUT_CHECK_PARAGRAPH_MARKER(ch, flag)
- (((ch) & (flag)) == (flag))
- /* test multiple-bit flag */
- #define GUI_INPUT_CHECK_ALIGN_MARKER(ch, flag)
- (((ch) & GUI_INPUT_MARKER_ALIGN_MASK) == (flag))
- #define GUI_INPUT_CHECK_LINE_SPACING_MARKER(ch, flag)
- (((ch) & GUI_INPUT_MARKER_LINE_SPACING_MASK) == (flag))
- typedef struct
- {
- color default_color;
- color curr_color;
- /* USAT */
- color default_text_bg_color;
- color curr_text_bg_color;
- U8 draw_text_bg_color;
- gui_input_alignment_enum default_alignment;
- gui_input_alignment_enum curr_alignment;
- stFontAttribute curr_font;
- U8 curr_border; /* border not part of font attribute */
- /* USAT */
- U8 curr_strikethrough; /* strikethrough not part of font attribute */
- /* backup the font used at the beginning of a line */
- stFontAttribute line_begin_font;
- U8 line_begin_border;
- /* USAT */
- U8 line_begin_strikethrough;
- /* attributes that are only active in the current line */
- U8 more_line_spacing;
- U8 line_separator;
- } gui_input_richtext_struct;
- /* USAT */
- extern void UI_draw_horizontal_line(S32 x1, S32 x2, S32 y, color c);
- extern void UI_fill_rectangle(S32 x1, S32 y1, S32 x2, S32 y2, color c);
- color gui_richtext_strikethrough_color = {255, 112, 125, 240};
- color gui_richtext_default_text_bg_color = {255, 255, 255, 100};
- /* barcode */
- color gui_hilite_underline_color = {0, 0, 220};
- /* 122 colors */
- static const color g_mmi_gui_input_format_color_table[] =
- {
- {255, 0, 0, 100},
- {255, 255, 0, 100},
- {0, 255, 0, 100},
- {0, 255, 255, 100},
- {0, 0, 235, 100}, /* Avoid transparent color */
- {255, 0, 255, 100},
- {255, 255, 255, 100},
- {230, 230, 230, 100},
- {218, 218, 218, 100},
- {205, 205, 205, 100},
- {192, 192, 192, 100},
- {180, 180, 180, 100},
- {168, 168, 168, 100},
- {154, 154, 154, 100},
- {141, 141, 141, 100},
- {129, 129, 129, 100},
- {230, 0, 6, 100},
- {255, 237, 0, 100},
- {0, 152, 55, 100},
- {0, 166, 234, 100},
- {45, 29, 134, 100},
- {228, 0, 132, 100},
- {116, 116, 116, 100},
- {102, 102, 102, 100},
- {89, 89, 89, 100},
- {75, 75, 75, 100},
- {62, 62, 62, 100},
- {48, 48, 48, 100},
- {33, 33, 33, 100},
- {19, 19, 19, 100},
- {10, 10, 10, 100},
- {0, 0, 0, 100},
- {240, 148, 115, 100},
- {244, 173, 124, 100},
- {249, 200, 134, 100},
- {255, 245, 148, 100},
- {209, 224, 149, 100},
- {173, 210, 149, 100},
- {141, 199, 149, 100},
- {136, 203, 199, 100},
- {129, 207, 244, 100},
- {136, 169, 217, 100},
- {141, 147, 199, 100},
- {144, 127, 186, 100},
- {169, 134, 188, 100},
- {195, 141, 187, 100},
- {238, 155, 193, 100},
- {238, 151, 156, 100},
- {233, 98, 63, 100},
- {240, 136, 70, 100},
- {245, 175, 77, 100},
- {255, 240, 87, 100},
- {138, 208, 96, 100},
- {136, 192, 102, 100},
- {79, 176, 104, 100},
- {66, 138, 177, 100},
- {12, 188, 239, 100},
- {85, 138, 199, 100},
- {98, 109, 179, 100},
- {104, 81, 159, 100},
- {139, 85, 160, 100},
- {172, 91, 161, 100},
- {233, 102, 163, 100},
- {233, 101, 117, 100},
- {230, 0, 6, 100},
- {234, 89, 0, 100},
- {242, 143, 0, 100},
- {255, 237, 0, 100},
- {153, 192, 0, 100},
- {79, 172, 37, 100},
- {0, 152, 55, 100},
- {0, 158, 150, 100},
- {0, 166, 234, 100},
- {0, 104, 180, 100},
- {1, 70, 154, 100},
- {45, 29, 134, 100},
- {107, 18, 133, 100},
- {149, 0, 133, 100},
- {228, 0, 132, 100},
- {229, 0, 79, 100},
- {159, 0, 3, 100},
- {161, 60, 0, 100},
- {167, 98, 0, 100},
- {179, 162, 0, 100},
- {102, 132, 0, 100},
- {45, 118, 21, 100},
- {0, 105, 35, 100},
- {0, 109, 103, 100},
- {0, 113, 164, 100},
- {0, 69, 128, 100},
- {0, 43, 109, 100},
- {32, 4, 95, 100},
- {74, 0, 94, 100},
- {103, 0, 92, 100},
- {159, 0, 90, 100},
- {160, 0, 52, 100},
- {117, 0, 0, 100},
- {120, 43, 0, 100},
- {124, 70, 0, 100},
- {131, 118, 0, 100},
- {69, 96, 0, 100},
- {22, 86, 10, 100},
- {0, 76, 23, 100},
- {0, 79, 74, 100},
- {0, 82, 121, 100},
- {0, 47, 93, 100},
- {0, 23, 77, 100},
- {22, 0, 68, 100},
- {56, 0, 67, 100},
- {78, 0, 65, 100},
- {119, 0, 64, 100},
- {118, 0, 33, 100},
- {203, 187, 164, 100},
- {165, 141, 121, 100},
- {125, 99, 85, 100},
- {90, 65, 58, 100},
- {63, 41, 35, 100},
- {199, 163, 111, 100},
- {176, 130, 78, 100},
- {150, 98, 46, 100},
- {124, 74, 25, 100},
- {101, 51, 7, 100}
- };
- /* 147 colors */
- static const color g_mmi_gui_input_format_w3c_color_table[] =
- {
- {240, 248, 255, 100},
- {250, 235, 215, 100},
- {0, 255, 255, 100},
- {127, 255, 212, 100},
- {240, 255, 255, 100},
- {245, 245, 220, 100},
- {255, 228, 196, 100},
- {0, 0, 0, 100},
- {255, 235, 205, 100},
- {0, 0, 235, 100}, /* Avoid transparent color */
- {138, 43, 226, 100},
- {165, 42, 42, 100},
- {222, 184, 135, 100},
- {95, 158, 160, 100},
- {127, 255, 0, 100},
- {210, 105, 30, 100},
- {255, 127, 80, 100},
- {100, 149, 237, 100},
- {255, 248, 220, 100},
- {220, 20, 60, 100},
- {0, 255, 255, 100},
- {0, 0, 139, 100},
- {0, 139, 139, 100},
- {184, 134, 11, 100},
- {169, 169, 169, 100},
- {0, 100, 0, 100},
- {169, 169, 169, 100},
- {189, 183, 107, 100},
- {139, 0, 139, 100},
- {85, 107, 47, 100},
- {255, 140, 0, 100},
- {153, 50, 204, 100},
- {139, 0, 0, 100},
- {233, 150, 122, 100},
- {143, 188, 143, 100},
- {72, 61, 139, 100},
- {47, 79, 79, 100},
- {47, 79, 79, 100},
- {0, 206, 209, 100},
- {148, 0, 211, 100},
- {255, 20, 147, 100},
- {0, 191, 255, 100},
- {105, 105, 105, 100},
- {105, 105, 105, 100},
- {30, 144, 255, 100},
- {178, 34, 34, 100},
- {255, 250, 240, 100},
- {34, 139, 34, 100},
- {255, 0, 255, 100},
- {220, 220, 220, 100},
- {248, 248, 255, 100},
- {255, 215, 0, 100},
- {218, 165, 32, 100},
- {128, 128, 128, 100},
- {128, 128, 128, 100},
- {0, 128, 0, 100},
- {173, 255, 47, 100},
- {240, 255, 240, 100},
- {255, 105, 180, 100},
- {205, 92, 92, 100},
- {75, 0, 130, 100},
- {255, 255, 240, 100},
- {240, 230, 140, 100},
- {230, 230, 250, 100},
- {255, 240, 245, 100},
- {124, 252, 0, 100},
- {255, 250, 205, 100},
- {173, 216, 230, 100},
- {240, 128, 128, 100},
- {224, 255, 255, 100},
- {250, 250, 210, 100},
- {211, 211, 211, 100},
- {144, 238, 144, 100},
- {211, 211, 211, 100},
- {255, 182, 193, 100},
- {255, 160, 122, 100},
- {32, 178, 170, 100},
- {135, 206, 250, 100},
- {119, 136, 153, 100},
- {119, 136, 153, 100},
- {176, 196, 222, 100},
- {255, 255, 224, 100},
- {0, 255, 0, 100},
- {50, 205, 50, 100},
- {250, 240, 230, 100},
- {255, 0, 255, 100},
- {128, 0, 0, 100},
- {102, 205, 170, 100},
- {0, 0, 205, 100},
- {186, 85, 211, 100},
- {147, 112, 219, 100},
- {60, 179, 113, 100},
- {123, 104, 238, 100},
- {0, 250, 154, 100},
- {72, 209, 204, 100},
- {199, 21, 133, 100},
- {25, 25, 112, 100},
- {245, 255, 250, 100},
- {255, 228, 225, 100},
- {255, 228, 181, 100},
- {255, 222, 173, 100},
- {0, 0, 128, 100},
- {253, 245, 230, 100},
- {128, 128, 0, 100},
- {107, 142, 35, 100},
- {255, 165, 0, 100},
- {255, 69, 0, 100},
- {218, 112, 214, 100},
- {238, 232, 170, 100},
- {152, 251, 152, 100},
- {175, 238, 238, 100},
- {219, 112, 147, 100},
- {255, 239, 213, 100},
- {255, 218, 185, 100},
- {205, 133, 63, 100},
- {255, 192, 203, 100},
- {221, 160, 221, 100},
- {176, 224, 230, 100},
- {128, 0, 128, 100},
- {255, 0, 0, 100},
- {188, 143, 143, 100},
- {65, 105, 225, 100},
- {139, 69, 19, 100},
- {250, 128, 114, 100},
- {244, 164, 96, 100},
- {46, 139, 87, 100},
- {255, 245, 238, 100},
- {160, 82, 45, 100},
- {192, 192, 192, 100},
- {135, 206, 235, 100},
- {106, 90, 205, 100},
- {112, 128, 144, 100},
- {112, 128, 144, 100},
- {255, 250, 250, 100},
- {0, 255, 127, 100},
- {70, 130, 180, 100},
- {210, 180, 140, 100},
- {0, 128, 128, 100},
- {216, 191, 216, 100},
- {255, 99, 71, 100},
- {64, 224, 208, 100},
- {238, 130, 238, 100},
- {245, 222, 179, 100},
- {255, 255, 255, 100},
- {245, 245, 245, 100},
- {255, 255, 0, 100},
- {154, 205, 50, 100}
- };
- /* USAT */
- /* 16 colors */
- static const color g_mmi_gui_input_format_w3c_text_background_color_table[] =
- {
- {169, 169, 169, 100},
- {139, 0, 0, 100},
- {255, 255, 0, 100},
- {0, 100, 0, 100},
- {0, 139, 139, 100},
- {0, 0, 139, 100},
- {139, 0, 139, 100},
- {128, 128, 128, 100},
- {255, 255, 255, 100},
- {255, 0, 0, 100},
- {255, 255, 224, 100},
- {144, 238, 144, 100},
- {224, 255, 255, 100},
- {173, 216, 230, 100},
- {255, 0, 255, 100},
- {0, 0, 0, 100}
- };
- #define MAX_GUI_INPUT_COLOR (sizeof(g_mmi_gui_input_format_color_table)/sizeof(color))
- #define MAX_GUI_INPUT_W3C_COLOR (sizeof(g_mmi_gui_input_format_w3c_color_table)/sizeof(color))
- /* USAT */
- #define MAX_GUI_INPUT_W3C_TEXT_BG_COLOR (sizeof(g_mmi_gui_input_format_w3c_text_background_color_table)/sizeof(color))
- /*
- * WCSS
- */
- #if defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__)
- #define PIXTEL_UI_ALL_INPUT_METHODS_ALLOWED 0x20
- #define PIXTEL_UI_WCSS_SPACE_DEFAULT_CHARACTER 0x40
- #define PIXTEL_UI_WCSS_STAR_INPUT 0x80
- /* Prevent automatically changing input method while deleting characters
- and also avoid reentrance of gui_change_WCSS_input_method() */
- static U8 WCSS_input_change_enable = 1;
- void gui_change_WCSS_input_method(multi_line_input_box *b);
- /* Force to change input method regardless of multitap state */
- static U8 WCSS_Esc_Char = 0;
- extern MMI_BOOL is_fisrt_entry_WCSS_editor;
- #endif /* defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__) */
- /* START FARHAD PMT 20050211 */
- #ifdef __MMI_HINDI_ALG__
- extern BOOL cancelWidth;
- #endif
- /* END FARHAD PMT 20050211 */
- /* for R2L characters */
- #ifdef __MMI_BIDI_ALG__
- U8 visual_str[MAX_TEXT_LENGTH * BIDI_ENCODING_LENGTH];
- /* MTK begin chat issue 2005.10.27 */
- #ifdef __MMI_MESSAGES_CHAT__
- U8 visual_str_chat[MAX_TEXT_LENGTH * BIDI_ENCODING_LENGTH];
- U8 *pTemp = NULL;
- #endif /* __MMI_MESSAGES_CHAT__ */
- /* MTK End */
- U8 MMI_bidi_input_type = BIDI_L;
- U16 pwcWord[MAX_TEXT_LENGTH];
- #endif /* __MMI_BIDI_ALG__ */
- BOOL r2lMMIFlag;
- /* MTK Terry for 0x81 encoding support for Phone Book */
- extern S16 MMI_current_input_ext_type;
- extern U8 mmi_phb_convert_to_0x81(S8 *input_name, BOOL is_convert);
- #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__)
- S8 hilited_item_changed = 0;
- extern void wgui_redraw_input_information_bar(void);
- #endif /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */
- /* GUI: multitap input object functions */
- extern U8 wgui_inputbox_information_flag;
- extern S32 wgui_inputbox_information_bar_height;
- extern void inline_fixed_list_goto_previous_item(void);
- extern void inline_fixed_list_goto_next_item(void);
- /* Auto scroll of Multiline Input text */
- extern void multiline_inputbox_vertical_scroll(void);
- /* START TARUN PMT 20041002 */
- extern S8 g_mmi_wgui_halfline_marquee_scroll_enable;
- #define MMI_HALF_LINE_MARQUEE_SCROLLING_ENABLE 1
- /* END TARUN PMT 20041002 */
- #if defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__)
- #include "SmsGuiInterfaceType.h"
- #include "SettingProfile.h"
- #include "MessagesResourceData.h"
- #include "MessagesExDcl.h"
- extern nsm_msg_struct g_nsm_msg_context;
- #if (0)
- /* under construction !*/
- #endif /* (0) */
- #endif /* defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__) */
- #if defined(__MMI_SMART_MESSAGE_MT__) || defined(__MMI_SMART_MESSAGE_MO__)
- extern S32 wgui_inputbox_buffer_size;
- #endif
- #if defined(__MMI_SMART_MESSAGE_MT__)
- #include "MessagesExDcl.h"
- #include "MessagesResourceData.h"
- #include "HistoryGprot.h"
- extern nsm_picmsg_text_struct picmsg_text_struct;
- #endif /* defined(__MMI_SMART_MESSAGE_MT__) */
- U8 numeric_leading_zero = TRUE;
- UI_multitap_input_theme *current_multitap_input_theme = NULL;
- UI_information_bar_theme *current_information_bar_theme = NULL;
- #ifdef __MMI_TOUCH_DIAL_SCREEN__
- MMI_ID_TYPE dialing_key_image[] =
- {
- IMG_DIALING_KEY_1,
- IMG_DIALING_KEY_2,
- IMG_DIALING_KEY_3,
- IMG_DIALING_KEY_4,
- IMG_DIALING_KEY_5,
- IMG_DIALING_KEY_6,
- IMG_DIALING_KEY_7,
- IMG_DIALING_KEY_8,
- IMG_DIALING_KEY_9,
- IMG_DIALING_KEY_STAR,
- IMG_DIALING_KEY_0,
- IMG_DIALING_KEY_HASH,
- #if defined (__MMI_TOUCH_DIAL_SCREEN_WITH_FUNCTION__)
- IMG_DIALING_KEY_PHB,
- IMG_DIALING_KEY_CALL,
- IMG_DIALING_KEY_IPCALL, //KP Jerry add on 2006-11-10
- #endif /* defined (__MMI_TOUCH_DIAL_SCREEN_WITH_FUNCTION__) */
- };
- #endif /* __MMI_TOUCH_DIAL_SCREEN__ */
- /* MTK Elvis 20040611 for color dialing font */
- const color_dialing_font color_dialing_font_map[] =
- {
- {'*', {255, 0, 0, 100}},
- {'#', {0, 0, 247, 100}},
- {'+', {0, 0, 247, 100}},
- {'p', {255, 0, 0, 100}},
- {'w', {0, 255, 0, 100}},
- {'0', {0, 255, 0, 100}},
- {'1', {255, 0, 0, 100}},
- {'2', {0, 255, 0, 100}},
- {'3', {0, 0, 247, 100}},
- {'4', {255, 0, 0, 100}},
- {'5', {0, 255, 0, 100}},
- {'6', {0, 0, 247, 100}},
- {'7', {255, 0, 0, 100}},
- {'8', {0, 255, 0, 100}},
- {'9', {0, 0, 247, 100}},
- {0, {0, 0, 0, 100}},
- };
- /* MTK end */
- //PMT VIKAS START 20050530
- //Remove this part of code.
- #if 0
- /* under construction !*/
- /* under construction !*/
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- /* PMT VIKAS END */
- /*****************************************************************************
- * FUNCTION
- * set_leading_zero
- * DESCRIPTION
- * set the flag..whether zero is allowed as first number or not
- * Input Parameter u8 u8type
- * PARAMETERS
- * u8type [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void set_leading_zero(U8 u8type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- numeric_leading_zero = u8type;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_set_multitap_input_current_theme
- * DESCRIPTION
- * Applies the current theme for a multitap input object
- * PARAMETERS
- * m [IN] Is the multitap input object
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_multitap_input_current_theme(multitap_input *m)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->normal_text_color = current_multitap_input_theme->normal_text_color;
- m->selected_text_color = current_multitap_input_theme->selected_text_color;
- m->selector_color = current_multitap_input_theme->selector_color;
- m->f = current_multitap_input_theme->f;
- m->text_font = current_multitap_input_theme->text_font;
- m->text_gap = current_multitap_input_theme->text_gap;
- m->flags |= current_multitap_input_theme->flags;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_set_multitap_input_theme
- * DESCRIPTION
- * Applies the given theme to a multitap input object
- * PARAMETERS
- * m [IN] Is the multitap input object
- * t [IN] Is the theme
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_multitap_input_theme(multitap_input *m, UI_multitap_input_theme *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- m->normal_text_color = t->normal_text_color;
- m->selected_text_color = t->selected_text_color;
- m->selector_color = t->selector_color;
- m->f = t->f;
- m->text_font = t->text_font;
- m->text_gap = t->text_gap;
- m->flags |= t->flags;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_set_multitap_input_text
- * DESCRIPTION
- *
- * PARAMETERS
- * b [?]
- * text [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_multitap_input_text(multitap_input *b, UI_string_type text)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 string_width, string_height;
- S32 width = b->width;
- S32 height = b->height;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->text = text;
- gui_set_font(b->text_font);
- gui_measure_string_w(text, b->text_gap, &string_width, &string_height);
- if (b->flags & UI_MULTITAP_INPUT_CENTER_X)
- {
- b->text_x = (width >> 1) - (string_width >> 1);
- }
- else
- {
- b->text_x = 0;
- }
- if (b->flags & UI_MULTITAP_INPUT_CENTER_Y)
- {
- b->text_y = (height >> 1) - (string_height >> 1);
- }
- else
- {
- b->text_y = 0;
- }
- b->length = gui_strlen(b->text);
- b->current_position = b->length - 1;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_create_multitap_input
- * DESCRIPTION
- * Applies the given theme to a multitap input object
- *
- * Note: Each key on a keypad requires one multitap input object.
- * For example, the text for multitap input for key 2 would be "ABC2"
- * PARAMETERS
- * b [?]
- * x [IN] Is the left-top corner
- * y [IN] Is the left-top corner
- * width [IN] Is the width of the multitap-input object
- * height [IN] Is the height of the multitap-input object
- * text [IN] Is a pointer to the string containing all the characters
- * m(?) [IN] Is the multitap input object
- * possible(?) [IN] With this multitap-input object.
- * RETURNS
- * void
- *****************************************************************************/
- void gui_create_multitap_input(multitap_input *b, S32 x, S32 y, S32 width, S32 height, UI_string_type text)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 string_width, string_height;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->x = x;
- b->y = y;
- b->width = width;
- b->height = height;
- b->flags = 0;
- b->text = text;
- gui_set_multitap_input_current_theme(b);
- /* Autocalculate the text position based on font */
- gui_set_font(b->text_font);
- /* PMT dara added for multitap thai */
- #ifdef __MMI_MULTITAP_THAI__
- Get_StringWidthHeight_multitap((U8*) text, b->text_gap, &string_width, &string_height);
- #else
- gui_measure_string_w(text, b->text_gap, &string_width, &string_height);
- #endif
- if (b->flags & UI_MULTITAP_INPUT_CENTER_X)
- {
- b->text_x = (width >> 1) - (string_width >> 1);
- }
- else
- {
- b->text_x = 0;
- }
- if (b->flags & UI_MULTITAP_INPUT_CENTER_Y)
- {
- b->text_y = (height >> 1) - (string_height >> 1);
- }
- else
- {
- b->text_y = 0;
- }
- b->length = gui_strlen(b->text);
- b->current_position = b->length - 1;
- b->input_complete_callback = UI_dummy_function;
- b->input_callback = UI_dummy_function_character;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_move_multitap_input
- * DESCRIPTION
- * move multitap to x , y position
- * PARAMETERS
- * b [?]
- * x [IN] Is the left-top corner
- * y [IN] Is the left-top corner
- * m(?) [IN] Is the multitap input object
- * RETURNS
- * void
- *****************************************************************************/
- void gui_move_multitap_input(multitap_input *b, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->x = x;
- b->y = y;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_resize_multitap_input
- * DESCRIPTION
- * resize multitap
- * PARAMETERS
- * b [?]
- * width [IN] Width of multitap
- * height [IN] Height of multitap
- * m(?) [IN] Is the multitap input object
- * RETURNS
- * void
- *****************************************************************************/
- void gui_resize_multitap_input(multitap_input *b, S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 string_width, string_height;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->width = width;
- b->height = height;
- /* Autocalculate the text position based on font */
- gui_set_font(b->text_font);
- /* PMT dara added for Multitap thai */
- #ifdef __MMI_MULTITAP_THAI__
- Get_StringWidthHeight_multitap((U8*) b->text, b->text_gap, &string_width, &string_height);
- #else
- gui_measure_string_w(b->text, b->text_gap, &string_width, &string_height);
- #endif
- if (b->flags & UI_MULTITAP_INPUT_CENTER_X)
- {
- b->text_x = (width >> 1) - (string_width >> 1);
- }
- else
- {
- b->text_x = 0;
- }
- if (b->flags & UI_MULTITAP_INPUT_CENTER_Y)
- {
- b->text_y = (height >> 1) - (string_height >> 1);
- }
- else
- {
- b->text_y = 0;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_set_multitap_input_callbacks
- * DESCRIPTION
- * Sets the callback functions for a multitap input object
- *
- * See the documentation for the operation of the callback functions.
- * PARAMETERS
- * b [?]
- * input_callback [IN] Is the function that is called whenever the
- * input_complete_callback [IN] Is the function that is called when
- * the(?) [IN] Input character is confirmed.
- * m(?) [IN] Is the multitap input object
- * This(?) [IN] Causes the timer associated witht the multitap object
- * state(?) [IN] Of the multitap inputobject changes
- * to(?) [IN] Expire and call the input_complete_callback function)
- * ke(?) [IN] (Ex: in "ABC2", the user has selected "B" and releases the key,
- * in(?) [IN] (Ex: in "ABC2", the user has selected "B" and releases the key,
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_multitap_input_callbacks(
- multitap_input *b,
- void (*input_callback) (UI_character_type),
- void (*input_complete_callback) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->input_complete_callback = input_complete_callback;
- b->input_callback = input_callback;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_change_multitap_input_state
- * DESCRIPTION
- * Causes the multitap input object to change its state
- *
- * Example, if "ABC2" is now highlighting "A", calling this
- * function will cause it to highlight "B".
- * This also causes the input_callback function to be called.
- * This function is normally called on key-down or key-repeat
- * PARAMETERS
- * b [?]
- * m(?) [IN] Is the multitap input object
- * RETURNS
- * void
- *****************************************************************************/
- void gui_change_multitap_input_state(multitap_input *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* MTK Terry for null multitap */
- if (0 == b->length)
- {
- return;
- }
- b->current_position++;
- if (b->current_position >= b->length)
- {
- b->current_position = 0;
- }
- /* MTK Terry for multitap length > lcm width */
- if (b->text_x <= 0)
- {
- S32 string_width = 0, string_height = 0;
- gui_set_font(b->text_font);
- gui_measure_string_w(b->text, b->text_gap, &string_width, &string_height);
- if (b->current_position > ((b->length) >> 1))
- {
- b->text_x = b->width - string_width;
- }
- else
- {
- b->text_x = 0;
- }
- }
- b->input_callback(b->text[b->current_position]);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_multitap_input_complete
- * DESCRIPTION
- * Completes the input in the current multitap object
- *
- * This also causes the input_complete_callback function to be called.
- * This function is normally called on key-up
- * PARAMETERS
- * b [?]
- * m(?) [IN] Is the multitap input object
- * RETURNS
- * void
- *****************************************************************************/
- void gui_multitap_input_complete(multitap_input *b)
- {
- #if defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Gurinder - It will chnage the cursor location on multitap complete */
- /*
- * Justin: it will not invokes gui_show_multi_line_inputbox on multitap completion
- * * and it needs to change input method by itself
- */
- if (MMI_multiline_inputbox.flags & UI_MULTI_LINE_WCSS_INPUT_BOX_ENABLE)
- {
- /* To Solve Input Mode Change Bug - Gurinder 4/5/2003 */
- WCSS_Esc_Char = 1;
- gui_change_WCSS_input_method(&MMI_multiline_inputbox);
- }
- #endif /* defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__) */
- b->current_position = b->length - 1;
- b->input_complete_callback();
- }
- /*****************************************************************************
- * FUNCTION
- * gui_show_multitap_input
- * DESCRIPTION
- * Displays the multitap input object
- * PARAMETERS
- * b [?]
- * m(?) [IN] Is the multitap input object
- * RETURNS
- * void
- *****************************************************************************/
- void gui_show_multitap_input(multitap_input *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1, y1, x2, y2;
- S32 sy1, sy2;
- S32 text_x, text_y;
- color text_color;
- UI_filled_area *f;
- #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__)
- UI_filled_area fTemp;
- #endif
- UI_character_type current_character;
- S32 i;
- S32 character_width;
- UI_string_type text = b->text;
- #ifdef __MMI_HINDI_ALG__
- S32 character_height;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- x1 = b->x;
- y1 = b->y;
- x2 = x1 + b->width - 1;
- y2 = y1 + b->height - 1;
- text_x = b->text_x + x1;
- text_y = b->text_y + y1;
- sy1 = y1;
- sy2 = y2;
- f = b->f;
- if ((b->f->flags & UI_FILLED_AREA_DOUBLE_BORDER) == UI_FILLED_AREA_DOUBLE_BORDER)
- {
- sy1 += 2;
- sy2 -= 2;
- }
- else if (b->f->flags & UI_FILLED_AREA_BORDER)
- {
- sy1 += 1;
- sy2 -= 1;
- }
- gui_push_clip();
- gui_set_clip(x1, y1, x2 + 2, y2 + 2);
- /* Pixtel - Gurinder - 2/6/4 - Dont show mutlitap shadow if __MMI_INSCREEN_MULTILINE_TEXTBOX__ is defined. */
- #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__)
- fTemp = *f;
- if (MMI_multi_line_inputbox_present)
- {
- if (f->flags & UI_FILLED_AREA_SHADOW)
- {
- fTemp.flags &= ~UI_FILLED_AREA_SHADOW;
- }
- }
- gui_draw_filled_area(x1, y1, x2, y2, &fTemp);
- #else /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */
- gui_draw_filled_area(x1, y1, x2, y2, f);
- #endif /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */
- gui_push_text_clip();
- gui_set_text_clip(x1, y1, x2, y2);
- gui_set_font(b->text_font);
- for (i = 0; i < b->length; i++)
- {
- current_character = gui_get_next_character(&text); /* get next character of text */
- /* HACK: Space character should be displayed as 0x86 but input as 0x20 */
- if (current_character == (UI_character_type) 0x20)
- {
- current_character = (UI_character_type) 0x86;
- }
- /* get character width in pixels */
- character_width = gui_get_character_width(current_character);
- /* set text xolor */
- text_color = b->normal_text_color;
- #if defined(__MMI_HINDI_ALG__)
- /* START VIJAY PMT 20050725...ADDED VALUE 134 FOR DOT */
- if (UI_HINDI_CHARACTER_UCS2_RANGE(current_character) || current_character == 46 || current_character == 134)
- /* END VIJAY PMT 20050725 */
- {
- get_multitap_text_x(&text_x, current_character, b->length, i);
- }
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "pixtel_UI_show_text_x[text_x]:%d ", text_x));
- #endif /* defined(__MMI_HINDI_ALG__) */
- if (i == b->current_position)
- {
- #if defined(__MMI_HINDI_ALG__)
- if (UI_HINDI_CHARACTER_UCS2_RANGE(current_character))
- {
- Get_CharWidthHeight(current_character, &character_width, &character_height);
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "pixtel_UI_show_character_width[character_width]:%d ",
- character_width));
- gui_fill_rectangle(
- text_x - (b->text_gap - 1),
- sy1,
- text_x + b->text_gap + character_width - 2,
- sy2,
- b->selector_color);
- }
- else
- #endif /* defined(__MMI_HINDI_ALG__) */
- gui_fill_rectangle(
- text_x - (b->text_gap - 1),
- sy1,
- text_x + b->text_gap + character_width - 2,
- sy2,
- b->selector_color);
- text_color = b->selected_text_color;
- }
- /* MTK Elvis for R2L characters */
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(text_x + character_width, text_y);
- }
- else
- {
- gui_move_text_cursor(text_x, text_y);
- }
- /* MTK end */
- /* gui_move_text_cursor(text_x,text_y); */
- gui_set_text_color(text_color);
- gui_print_character(current_character);
- text_x += b->text_gap + character_width;
- }
- gui_pop_text_clip();
- gui_pop_clip();
- }
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * gui_multitap_input_translate_pen_position
- * DESCRIPTION
- *
- * PARAMETERS
- * b [IN]
- * x [IN]
- * y [IN]
- * index [?]
- * char_index(?) [OUT]
- * RETURNS
- * whether the point is inside multitap input
- *****************************************************************************/
- BOOL gui_multitap_input_translate_pen_position(multitap_input *b, S32 x, S32 y, S32 *index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* FIXME. Hindi code has potential problems */
- S32 i;
- S32 xoffset = b->x + b->text_x;
- UI_string_type text = b->text;
- UI_character_type current_character;
- S32 character_width;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_set_font(b->text_font);
- if (PEN_CHECK_BOUND(x, y, b->x, b->y, b->width, b->height) && x >= xoffset)
- {
- for (i = 0; i < b->length; i++)
- {
- current_character = gui_get_next_character(&text);
- /* HACK: Space character should be displayed as 0x86 but input as 0x20 */
- if (current_character == (UI_character_type) 0x20)
- {
- current_character = (UI_character_type) 0x86;
- }
- character_width = gui_get_character_width(current_character);
- #if defined(__MMI_HINDI_ALG__)
- if (UI_HINDI_CHARACTER_UCS2_RANGE(current_character) || current_character == 46)
- {
- get_multitap_text_x(&xoffset, current_character, b->length, i);
- }
- #endif /* defined(__MMI_HINDI_ALG__) */
- xoffset += b->text_gap + character_width;
- if (xoffset > x)
- {
- *index = i;
- return MMI_TRUE;
- }
- }
- return MMI_FALSE;
- }
- else
- {
- return MMI_FALSE;
- }
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * UI_dummy_validation_function
- * DESCRIPTION
- * dummy validation function
- * PARAMETERS
- * text [IN]
- * cursor_p [IN]
- * text_length [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void UI_dummy_validation_function(UI_buffer_type text, UI_buffer_type cursor_p, S32 text_length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(text);
- UI_UNUSED_PARAMETER(cursor_p);
- UI_UNUSED_PARAMETER(text_length);
- }
- /* GUI: Blinking cursor functions */
- #if(UI_BLINKING_CURSOR_SUPPORT)
- #define UI_CURSOR_BACKUP_BITMAP_SIZE 256
- extern void _show_bitmap(S32 x1, S32 y1, bitmap *b);
- extern void _get_bitmap(S32 x1, S32 y1, S32 x2, S32 y2, bitmap *b);
- /* MTK Elvis */
- extern U16 StopMyTimer(U16 nTimerId);
- extern U16 StartMyTimerInt(U16 nTimerId, U32 nTimeDuration, oslTimerFuncPtr TimerExpiry, U8 alignment);
- /* MTK end */
- U8 UI_cursor_backup_bitmap_data[UI_CURSOR_BACKUP_BITMAP_SIZE];
- S32 UI_cursor_x1 = 0; /* cursor x1 postioon */
- S32 UI_cursor_y1 = 0; /* cursor y1 position */
- S32 UI_cursor_x2 = 0; /* cursor x2 postion */
- S32 UI_cursor_y2 = 0; /* cursor y2position */
- color UI_cursor_color = {0, 0, 0, 0}; /* cursor color black */
- U8 UI_cursor_blink_flag = 0; /* blinking flag of cursor */
- /* cusror bitmap */
- bitmap UI_cursor_backup_bitmap =
- {
- 0,
- 0,
- 0,
- 0,
- NULL,
- UI_cursor_backup_bitmap_data
- };
- /*****************************************************************************
- * FUNCTION
- * UI_inputbox_blink_cursor
- * DESCRIPTION
- * show blinking crusor in input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void UI_inputbox_blink_cursor(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_reset_clip();
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- if (UI_cursor_blink_flag) /* if blinking curosr flag is set */
- {
- gui_fill_rectangle(UI_cursor_x1, UI_cursor_y1, UI_cursor_x2, UI_cursor_y2, UI_cursor_color);
- UI_cursor_blink_flag = 0;
- }
- else
- {
- _show_bitmap(UI_cursor_x1, UI_cursor_y1, &UI_cursor_backup_bitmap);
- UI_cursor_blink_flag = 1;
- }
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(UI_cursor_x1, UI_cursor_y1, UI_cursor_x2, UI_cursor_y2);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- //gui_start_timer(UI_CURSOR_BLINK_TIME,UI_inputbox_blink_cursor);
- //MTK Elvis to StartMyTimerInt instead of the gui_start_timer
- StartMyTimerInt(BLINKING_CURSOR, UI_CURSOR_WAIT_TIME, (oslTimerFuncPtr) UI_inputbox_blink_cursor, 0);
- /* MTK end */
- }
- /*****************************************************************************
- * FUNCTION
- * UI_inputbox_show_cursor
- * DESCRIPTION
- * show blinking crusor in input box
- * PARAMETERS
- * x1 [IN] X1 position of cursor
- * y1 [IN] Y1 position of cursor
- * x2 [IN] X2 position of cursor
- * y2 [IN] Y2 position of cursor
- * c [IN] Color of cursor
- * RETURNS
- * void
- *****************************************************************************/
- void UI_inputbox_show_cursor(S32 x1, S32 y1, S32 x2, S32 y2, color c)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //gui_cancel_timer(UI_inputbox_blink_cursor);
- //MTK Elvis
- StopMyTimer(BLINKING_CURSOR);
- /* MTK end */
- UI_cursor_x1 = x1;
- UI_cursor_y1 = y1;
- UI_cursor_x2 = x2;
- UI_cursor_y2 = y2;
- UI_cursor_color = c;
- _get_bitmap(x1, y1, x2, y2, &UI_cursor_backup_bitmap); /* get bitmp of bliknkig cursor */
- gui_fill_rectangle(x1, y1, x2, y2, c);
- //gui_start_timer(UI_CURSOR_WAIT_TIME,UI_inputbox_blink_cursor);
- //MTK Elvis to StartMyTimerInt instead of the gui_start_timer
- StartMyTimerInt(BLINKING_CURSOR, UI_CURSOR_WAIT_TIME, (oslTimerFuncPtr) UI_inputbox_blink_cursor, 0);
- /* MTK end */
- UI_cursor_blink_flag = 0;
- }
- #endif /* (UI_BLINKING_CURSOR_SUPPORT) */
- /* GUI: single line input box functions */
- UI_single_line_input_box_theme *current_single_line_input_box_theme = NULL;
- /*****************************************************************************
- * FUNCTION
- * gui_set_single_line_input_box_current_theme
- * DESCRIPTION
- * Applies the current theme for the single-line inputbox.
- * PARAMETERS
- * b [IN] Is the single-line inputbox object
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_single_line_input_box_current_theme(single_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->normal_filler = current_single_line_input_box_theme->normal_filler;
- b->disabled_filler = current_single_line_input_box_theme->disabled_filler;
- b->selected_filler = current_single_line_input_box_theme->selected_filler;
- b->normal_text_color = current_single_line_input_box_theme->normal_text_color;
- b->disabled_text_color = current_single_line_input_box_theme->disabled_text_color;
- b->selected_text_color = current_single_line_input_box_theme->selected_text_color;
- b->selection_color = current_single_line_input_box_theme->selection_color;
- b->selection_text_color = current_single_line_input_box_theme->selection_text_color;
- b->cursor_color = current_single_line_input_box_theme->cursor_color;
- b->text_font = current_single_line_input_box_theme->text_font;
- b->text_gap = current_single_line_input_box_theme->text_gap;
- b->mask_character = current_single_line_input_box_theme->mask_character;
- b->flags |= current_single_line_input_box_theme->flags;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_set_single_line_input_box_theme
- * DESCRIPTION
- * Applies the given theme to the single-line inputbox.
- * PARAMETERS
- * b [IN] Is the single-line inputbox object
- * t [?]
- * RETURNS
- * void
- *****************************************************************************/
- void gui_set_single_line_input_box_theme(single_line_input_box *b, UI_single_line_input_box_theme *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->normal_filler = t->normal_filler;
- b->disabled_filler = t->disabled_filler;
- b->selected_filler = t->selected_filler;
- b->normal_text_color = t->normal_text_color;
- b->disabled_text_color = t->disabled_text_color;
- b->selected_text_color = t->selected_text_color;
- b->selection_color = t->selection_color;
- b->selection_text_color = t->selection_text_color;
- b->cursor_color = t->cursor_color;
- b->text_font = t->text_font;
- b->text_gap = t->text_gap;
- b->mask_character = t->mask_character;
- b->flags |= t->flags;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_single_line_input_box_clear
- * DESCRIPTION
- * clearthe single-line inputbox.
- * PARAMETERS
- * b [IN] Is the single-line inputbox object
- * RETURNS
- * void
- *****************************************************************************/
- void gui_single_line_input_box_clear(single_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (b->text == NULL)
- {
- b->text_length = 0;
- b->allocated_length = 0;
- b->available_length = 0;
- }
- else
- {
- b->text[0] = ' ';
- b->text[1] = 0;
- b->text_length = 2;
- }
- b->current_text_p = b->text;
- b->last_position_p = b->text;
- b->UCS2_count = 0;
- if (b->flags & UI_SINGLE_LINE_INPUT_BOX_USE_ENCODING_BASED_LENGTH)
- {
- b->available_length = b->allocated_length;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_create_single_line_input_box
- * DESCRIPTION
- * Creates a single line input box
- *
- * The object should be allocated before calling this function.
- * The buffer is automatically allocated by the inputbox.
- * The buffer is set to blank on creation of this object.
- * See also gui_destroy_single_line_input_box()
- * PARAMETERS
- * b [IN] Is the single-line inputbox object (pre-allocated)
- * x [IN] Is the left-top corner
- * y [IN] Is the left-top corner
- * width [IN] Is the width of the inputbox
- * height [IN] Is the height of the inputbox
- * length [IN] Is the length of the buffer to use
- * RETURNS
- * void
- *****************************************************************************/
- void gui_create_single_line_input_box(single_line_input_box *b, S32 x, S32 y, S32 width, S32 height, S32 length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->x = x;
- b->y = y;
- b->width = width;
- b->height = height;
- b->text = (UI_buffer_type) gui_malloc(length * sizeof(UI_character_type));
- b->allocated_length = length;
- b->available_length = length;
- /* initilze the single input box */
- gui_single_line_input_box_clear(b);
- b->current_text_p = b->text;
- b->text_offset_x = 0;
- b->flags = 0;
- b->ext_flags = 0;
- b->grid_width = 0;
- /* set theme of single input box */
- gui_set_single_line_input_box_current_theme(b);
- b->validation_callback = UI_dummy_validation_function; /* set validation input box func handler to dummy */
- b->overflow_callback = UI_dummy_function;
- b->change_callback = UI_dummy_function;
- b->text_x = 2 + b->text_gap;
- /* Autocalculate the text position based on font */
- if (b->flags & UI_SINGLE_LINE_INPUT_BOX_CENTER_Y)
- {
- S32 string_height;
- gui_set_font(b->text_font);
- string_height = gui_get_character_height();
- b->text_y = (height >> 1) - (string_height >> 1);
- }
- else
- {
- b->text_y = 2;
- }
- b->UCS2_count = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_create_single_line_input_box_use_buffer
- * DESCRIPTION
- * Creates a single line input box
- *
- * The object should be allocated before calling this function.
- * Also, the buffer should be allocated and passed to this function.
- * The buffer is set to blank on creation of this object.
- * PARAMETERS
- * b [IN] Is the single-line inputbox object (pre-allocated)
- * x [IN] Is the left-top corner
- * y [IN] Is the left-top corner
- * width [IN] Is the width of the inputbox
- * height [IN] Is the height of the inputbox
- * buffer [IN] Is the buffer the inputbox should use (pre-allocated)
- * length [IN] Is the length of the buffer
- * RETURNS
- * void
- *****************************************************************************/
- void gui_create_single_line_input_box_use_buffer(
- single_line_input_box *b,
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- UI_string_type buffer,
- S32 length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->x = x;
- b->y = y;
- b->width = width;
- b->height = height;
- b->text = (UI_buffer_type) buffer;
- b->allocated_length = length;
- b->available_length = length;
- b->flags = 0;
- b->ext_flags = 0;
- b->grid_width = 0;
- gui_single_line_input_box_clear(b);
- b->current_text_p = b->text;
- b->text_offset_x = 0;
- gui_set_single_line_input_box_current_theme(b);
- b->overflow_callback = UI_dummy_function;
- b->change_callback = UI_dummy_function;
- b->validation_callback = UI_dummy_validation_function;
- b->text_x = 2 + b->text_gap;
- /* Autocalculate the text position based on font */
- if (b->flags & UI_SINGLE_LINE_INPUT_BOX_CENTER_Y)
- {
- S32 string_height;
- gui_set_font(b->text_font);
- string_height = gui_get_character_height();
- b->text_y = (height >> 1) - (string_height >> 1);
- }
- else
- {
- b->text_y = 2;
- }
- b->UCS2_count = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_create_single_line_input_box_set_buffer
- * DESCRIPTION
- * Creates a single line input box
- *
- * The object should be allocated before calling this function.
- * Also, the buffer should be allocated and passed to this function.
- * The buffer retains the string passed.
- * VJ
- * PARAMETERS
- * b [IN] Is the single-line inputbox object (pre-allocated)
- * x [IN] Is the left-top corner
- * y [IN] Is the left-top corner
- * width [IN] Is the width of the inputbox
- * height [IN] Is the height of the inputbox
- * buffer [IN] Is the buffer the inputbox should use (pre-allocated)
- * length [IN] Is the length of the buffer
- * text_length [IN]
- * edit_position [IN] Is the cursor_position
- * RETURNS
- * void
- *****************************************************************************/
- void gui_create_single_line_input_box_set_buffer(
- single_line_input_box *b,
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- UI_string_type buffer,
- S32 length,
- S32 text_length,
- S32 edit_position)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type dummy_c = 0;
- UI_buffer_type text;
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->x = x; /* start x position of single lien input box */
- b->y = y; /* stat y position of single line inputr box */
- b->width = width; /* width of single line input box */
- b->height = height; /* heightof ingle lien input box */
- b->text = (UI_buffer_type) buffer; /* set text of single lie input box */
- b->current_text_p = b->text;
- b->allocated_length = length;
- b->available_length = length;
- b->UCS2_count = 0;
- if (b->text != NULL)
- {
- text = b->text;
- for (i = 0; i < edit_position; i++)
- {
- UI_STRING_GET_NEXT_CHARACTER(text, dummy_c);
- UI_TEST_UCS2_INCREMENT_COUNT(dummy_c, b->UCS2_count);
- if (UI_STRING_END_OF_STRING_CHARACTER(dummy_c))
- {
- break;
- }
- }
- b->current_text_p = text;
- for (i = edit_position; !UI_STRING_END_OF_STRING_CHARACTER(dummy_c); i++)
- {
- UI_STRING_GET_NEXT_CHARACTER(text, dummy_c);
- UI_TEST_UCS2_INCREMENT_COUNT(dummy_c, b->UCS2_count);
- }
- b->text_length = text_length;
- b->last_position_p = b->current_text_p;
- }
- else
- {
- b->text_length = 0;
- }
- b->text_offset_x = 0;
- b->flags = 0;
- b->ext_flags = 0;
- b->grid_width = 0;
- /* set theme of single line input box */
- gui_set_single_line_input_box_current_theme(b);
- b->overflow_callback = UI_dummy_function;
- b->change_callback = UI_dummy_function;
- b->validation_callback = UI_dummy_validation_function;
- b->text_x = 2 + b->text_gap;
- /* Autocalculate the text position based on font */
- if (b->flags & UI_SINGLE_LINE_INPUT_BOX_CENTER_Y)
- {
- S32 string_height;
- gui_set_font(b->text_font);
- string_height = gui_get_character_height();
- b->text_y = (height >> 1) - (string_height >> 1);
- }
- else
- {
- b->text_y = 2;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_create_single_line_input_box_set_buffer_first_position
- * DESCRIPTION
- * set the current text to first position straing of text
- *
- * The object should be allocated before calling this function.
- * Also, the buffer should be allocated and passed to this function.
- * The buffer retains the string passed.
- * VJ
- * PARAMETERS
- * b [IN] Is the single-line inputbox object (pre-allocated)
- * x [IN] Is the left-top corner
- * y [IN] Is the left-top corner
- * width [IN] Is the width of the inputbox
- * height [IN] Is the height of the inputbox
- * buffer [IN] Is the buffer the inputbox should use (pre-allocated)
- * length [IN] Is the length of the buffer
- * text_length [IN]
- * edit_position [IN] Is the cursor_position
- * RETURNS
- * void
- *****************************************************************************/
- void gui_create_single_line_input_box_set_buffer_first_position(
- single_line_input_box *b,
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- UI_string_type buffer,
- S32 length,
- S32 text_length,
- S32 edit_position)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->x = x;
- b->y = y;
- b->width = width;
- b->height = height;
- b->text = (UI_buffer_type) buffer;
- b->current_text_p = b->text;
- b->allocated_length = length;
- b->available_length = length;
- b->UCS2_count = 0;
- b->text_offset_x = 0;
- b->flags = 0;
- b->ext_flags = 0;
- b->grid_width = 0;
- gui_set_single_line_input_box_current_theme(b);
- b->overflow_callback = UI_dummy_function;
- b->change_callback = UI_dummy_function;
- b->validation_callback = UI_dummy_validation_function;
- b->text_x = 2 + b->text_gap;
- /* Autocalculate the text position based on font */
- if (b->flags & UI_SINGLE_LINE_INPUT_BOX_CENTER_Y)
- {
- S32 string_height;
- gui_set_font(b->text_font);
- string_height = gui_get_character_height();
- b->text_y = (height >> 1) - (string_height >> 1);
- }
- else
- {
- b->text_y = 2;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * gui_move_single_line_input_box
- * DESCRIPTION
- * Moves a single line input box
- * PARAMETERS
- * b [IN] Is the single-line inputbox object (pre-allocated)
- * x [IN] Is the left-top corner
- * y [IN] Is the left-top corner
- * RETURNS
- * void
- *****************************************************************************/
- void gui_move_single_line_input_box(single_line_input_box *b, S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- b->x = x;
- b->y = y;
- }
- /*****************************************************************************
- * FUNCTION
- * gui_single_line_input_box_show_cursor
- * DESCRIPTION
- * Displays the cursor in a single-line inputbox (internal function)
- *
- * This function is used internally.
- * PARAMETERS
- * b [IN] Is the single-line inputbox object
- * x [IN] Is the left-top corner of the cursor
- * y [IN] Is the left-top corner of the cursor
- * height [IN] Is the height of cursor
- * RETURNS
- * void
- *****************************************************************************/
- void gui_single_line_input_box_show_cursor(single_line_input_box *b, S32 x, S32 y, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c = b->cursor_color;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if(UI_BLINKING_CURSOR_SUPPORT)
- UI_inputbox_show_cursor(x, y, x + 1, y + height - 1, c);
- #else
- gui_fill_rectangle(x, y, x + 1, y + height - 1, c);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * gui_show_single_line_input_box
- * DESCRIPTION
- * Displays a single-line inputbox
- * PARAMETERS
- * b [IN] Is the single-line inputbox object
- * RETURNS
- * void
- *****************************************************************************/
- /* MTK modify for stacked character--Thai */
- void gui_show_single_line_input_box(single_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_show_single_line_input_box_ext(b, -1, -1);
- }
- /*****************************************************************************
- * FUNCTION
- * gui_show_single_line_input_box_ext
- * DESCRIPTION
- * Displays a single-line inputbox
- * PARAMETERS
- * b [IN] Is the single-line inputbox object
- * move_to_x [IN]
- * move_to_y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- /* MTK modify for stacked character--Thai */
- void gui_show_single_line_input_box_ext(single_line_input_box *b, S32 move_to_x, S32 move_to_y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1, y1, x2, y2, cx, cy, ch;
- S32 sy1, sy2;
- color text_color;
- UI_filled_area *f;
- U8 selection_flag = 0, overwrite_mode_flag = 0, set_cursor_flag = 0;
- UI_character_type current_character = 0, pre2_character = 0, pre_character = 0;
- S32 character_width = 0, box_width, current_text_width, text_height;
- UI_buffer_type previous_text_p = b->text;
- UI_buffer_type current_text_p = b->text;
- U32 flags = b->flags;
- U8 done = 0;
- S32 text_x, text_y, total_width = 0;
- U8 cursor_displayed_flag = 0;
- S32 text_gap = b->text_gap;
- color b_normal_text_color = b->normal_text_color;
- color b_selection_text_color = b->selection_text_color;
- color b_selection_color = b->selection_color;
- UI_character_type mask_character = b->mask_character;
- UI_buffer_type b_current_text_p = b->current_text_p;
- U8 second_word_highlight = 0;
- U8 word_highlight = 0;
- U8 border_type = 0;
- PMT_BIDI_TYPES default_direction = BIDI_L;
- #if defined (__MMI_LANG_ARABIC__) || defined (__MMI_LANG_PERSIAN__)
- UI_buffer_type temp_p;
- UI_character_type next_char = 0;
- #endif /* defined (__MMI_LANG_ARABIC__) || defined (__MMI_LANG_PERSIAN__) */
- /* MTK end */
- #ifdef __MMI_HINDI_ALG__
- U16 single_line_disp_cluster[MAX_EDITOR_DISP_LEN];
- PU8 single_line_temp_p = b->text;
- PU8 single_line_prev_p = b->text;
- PU8 single_line_curr_p = b->text;
- S32 single_editor_moves = 1; /* for skipping by cluster */
- S32 parse_hindi = 1; /* added farhad 24122004 */
- #endif /* __MMI_HINDI_ALG__ */
- #ifdef __MMI_BIDI_ALG__
- U16 logical_cur_pos;
- U8 *temp_text_pt;
- U8 *temp_cursor_p;
- U16 visual_str_len;
- U16 visual_cur_pos;
- U16 logical_hilight_start;
- U16 logical_hilight_end;
- U16 visual_hilight_start;
- U16 visual_hilight_end;
- UI_buffer_type temp_hilight_start;
- UI_buffer_type temp_hilight_end;
- U32 iCount;
- pBOOL arabic_char_flag = MMI_FALSE;
- U8 lastest_char_type;
- UI_buffer_type ptr_current_text_p;
- pBOOL BIDI_done_flag = MMI_FALSE;
- S32 text_len;
- PU8 ptr_text_buffer;
- #endif /* __MMI_BIDI_ALG__ */
- #if defined(__MMI_LANG_VIETNAMESE__)
- UI_character_type next_character = 0;
- viet_tone_mark tone_mark = VIET_TONE_NONE;
- viet_vowel_letter viet_vowel = VIET_VOWEL_NONE;
- #endif /* defined(__MMI_LANG_VIETNAMESE__) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if defined (__MMI_LANG_ARABIC__) || defined(__MMI_LANG_PERSIAN__)
- if ((b->text_length != 0) && ((b->text_length / ENCODING_LENGTH) - 1 != 0) && !(flags & UI_SINGLE_LINE_INPUT_BOX_DISABLE_DRAW))
- {
- pfnUnicodeStrncpy((S8*) shaping_str, (const S8*)b->text, (b->text_length / ENCODING_LENGTH) - 1);
- unshaped_text_len = text_len = (b->text_length/2)-1;
- #ifdef __MMI_ZI__
- #ifdef __MMI_ZI_V7__
- #if defined(__MMI_ZI_ARABIC__) && defined(__MMI_ZI_PERSIAN__)
- ZiStringShapeEx(ZI8_LANG_FA, (U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL); /* 19 is the Arabic id */
- #elif defined(__MMI_ZI_PERSIAN__)
- ZiStringShapeEx(ZI8_LANG_FA, (U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL); /* 19 is the Arabic id */
- #elif defined(__MMI_ZI_ARABIC__)
- ZiStringShapeEx(ZI8_LANG_AR, (U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL); /* 19 is the Arabic id */
- #endif
- #else /* __MMI_ZI_V7__ */
- ArabicStringShape2((U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL);
- #endif /* __MMI_ZI_V7__ */
- #else /* __MMI_ZI__ */
- ArabicShapeEngine2((U16*) & text_len, (U16*) shaping_str, (U16*) OrgToSha, NULL);
- #endif /* __MMI_ZI__ */
- }
- #endif /* defined (__MMI_LANG_ARABIC__) || defined(__MMI_LANG_PERSIAN__) */
- #if defined __MMI_HINDI_ALG__
- overwrite_current_language_for_hindi_rules_based_on_input_method();
- #endif
- if (((-1) != move_to_x) || ((-1) != move_to_y))
- {
- flags |= UI_SINGLE_LINE_INPUT_BOX_DISABLE_DRAW;
- }
- #ifdef __MMI_BIDI_ALG__
- /* MTK Terry for BIDI Issue */
- if ((((b->text_length >> 1) - 1) != 0) && (b->text_length > 0))
- {
- bidi_get_char_type(b->text, (U8*) & default_direction);
- if (default_direction == BIDI_R || default_direction == AL)
- default_direction = BIDI_R;
- else
- default_direction = BIDI_L;
- for (iCount = 0; iCount < (U32) ((b->text_length >> 1) - 1); iCount++)
- {
- bidi_get_char_type((U8*) (b->text + iCount * ENCODING_LENGTH), (U8*) & lastest_char_type);
- if ((lastest_char_type == AL) || (lastest_char_type == AN) || (lastest_char_type == BIDI_R))
- {
- arabic_char_flag = MMI_TRUE;
- break;
- }
- }
- }
- if (!(flags & UI_SINGLE_LINE_INPUT_BOX_DISABLE_DRAW) && arabic_char_flag)
- if((((b->text_length>>1)-1) !=0) && (b->text_length > 0))
- {
- bidi_get_char_type(b->text, (U8*) & default_direction);
- logical_cur_pos = ((b->current_text_p - b->text) + 1) / ENCODING_LENGTH;
- if (flags & UI_SINGLE_LINE_INPUT_BOX_WORD_HIGHLIGHT)
- {
- temp_hilight_start = b->highlight_start_position;
- temp_hilight_end = b->highlight_end_position;
- logical_hilight_start = (b->highlight_start_position - b->text) >> 1;
- logical_hilight_end = (b->highlight_end_position - b->text) >> 1;
- }
- else if (flags & UI_SINGLE_LINE_INPUT_BOX_STATE_MULTITAP)
- {
- temp_hilight_start = b->highlight_start_position;
- temp_hilight_end = b->highlight_end_position;
- flags |= UI_SINGLE_LINE_INPUT_BOX_WORD_HIGHLIGHT;
- b->highlight_start_position = b->current_text_p - ENCODING_LENGTH;
- b->highlight_end_position = b->current_text_p;
- logical_hilight_start = (b->highlight_start_position - b->text) >> 1;
- logical_hilight_end = (b->highlight_end_position - b->text) >> 1;
- }
- else
- {
- logical_hilight_start = 0;
- logical_hilight_end = 0;
- }
- if (default_direction == BIDI_R || default_direction == AL)
- {
- bidi_main(
- b->text,
- (U16) UCS2Strlen((const S8*)b->text),
- logical_cur_pos,
- visual_str,
- &visual_str_len,
- &visual_cur_pos,
- MMI_TRUE,
- MMI_bidi_input_type,
- logical_hilight_start,
- logical_hilight_end,
- &visual_hilight_start,
- &visual_hilight_end);
- default_direction = BIDI_R;
- }
- else /* if(default_direction == BIDI_L) */
- {
- bidi_main(
- b->text,
- (U16) UCS2Strlen((const S8*)b->text),
- logical_cur_pos,
- visual_str,
- &visual_str_len,
- &visual_cur_pos,
- MMI_FALSE,
- MMI_bidi_input_type,
- logical_hilight_start,
- logical_hilight_end,
- &visual_hilight_start,
- &visual_hilight_end);
- default_direction = BIDI_L;
- }
- BIDI_done_flag = MMI_TRUE;
- temp_text_pt = b->text;
- b->text = visual_str;
- temp_cursor_p = b->current_text_p;
- b->current_text_p = b->text + visual_cur_pos * ENCODING_LENGTH;
- previous_text_p = b->text;
- current_text_p = b->text;
- b_current_text_p = b->current_text_p;
- if (flags & UI_SINGLE_LINE_INPUT_BOX_WORD_HIGHLIGHT)
- {
- b->highlight_start_position = b->text + (visual_hilight_start * ENCODING_LENGTH);
- b->highlight_end_position = b->text + (visual_hilight_end * ENCODING_LENGTH);
- }
- }
- #endif /* __MMI_BIDI_ALG__ */
- #ifdef __MMI_HINDI_ALG__
- memset(single_line_disp_cluster, 0, sizeof(single_line_disp_cluster));
- single_line_temp_p = b->text;
- single_line_prev_p = b->text;
- single_line_curr_p = b->text;
- #endif /* __MMI_HINDI_ALG__ */
- x1 = b->x; /* start x position of single line input box */
- y1 = b->y; /* start y position of single line input box */
- x2 = x1 + b->width - 1; /* end x position of single line input box */
- y2 = y1 + b->height - 1; /* end y position of single line input box */
- sy1 = y1;
- sy2 = y2;
- /* MTK Leo add 1205 */
- if (flags & UI_SINGLE_LINE_INPUT_BOX_TRUNCATE_CONTENT)
- {
- text_gap = 0;
- }
- /* MTK Leo end 1205 */
- if (flags & UI_SINGLE_LINE_INPUT_BOX_STATE_SELECTED)
- {
- f = b->selected_filler;
- text_color = b->selected_text_color;
- }
- else if (flags & UI_SINGLE_LINE_INPUT_BOX_STATE_DISABLED)
- {
- f = b->disabled_filler;
- text_color = b->disabled_text_color;
- }
- else
- {
- f = b->normal_filler;
- text_color = b->normal_text_color;
- }
- if ((f->flags & UI_FILLED_AREA_DOUBLE_BORDER) == UI_FILLED_AREA_DOUBLE_BORDER)
- {
- sy1 += 3;
- sy2 -= 3;
- border_type = 2;
- }
- else if (f->flags & UI_FILLED_AREA_BORDER)
- {
- sy1 += 2;
- sy2 -= 2;
- border_type = 1;
- }
- /* PMT VIKAS START 20050524 */
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- //PMT VIKAS START 20050630
- // remove the function call.
- //gui_single_line_disable_transparent_effect(&f);// to disable transparent effect flag for single line edit
- //PMT VIKAS END 20050630
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- /* PMT VIKAS END */
- gui_push_clip();
- if (flags & UI_SINGLE_LINE_INPUT_BOX_NO_BORDER)
- {
- gui_set_clip(x1 + 1, y1 + 1, x2 - 1, y2 - 1);
- sy1 += 1;
- sy2 -= 1;
- border_type = 1;
- }
- else
- {
- gui_set_clip(x1, y1, x2 + 2, y2 + 2);
- }
- /* Add by Leo */
- if (flags & UI_SINGLE_LINE_INPUT_BOX_FORCE_BORDER_DISPLAY)
- {
- S32 string_width = 0, string_height = 0;
- gui_measure_string((UI_string_type) MMI_singleline_inputbox.text, &string_width, &string_height);