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

📄 wgui_virtual_keyboard.c

📁 The font library converting tool MCT mainly introduces the process of the font formats to give us a
💻 C
📖 第 1 页 / 共 4 页
字号:
	{2,{0x5E,0x55},0xDB},
	
	/***Diaeresis***/
	{2,{0xA8,0x61},0xE4},
	{2,{0xA8,0x65},0xEB},
	{2,{0xA8,0x69},0xEF},
	{2,{0xA8,0x6F},0xF6},
	{2,{0xA8,0x75},0xFC},
	{2,{0xA8,0x79},0xFF},

	{2,{0xA8,0x41},0xC4},
	{2,{0xA8,0x45},0xCB},
	{2,{0xA8,0x49},0xCF},
	{2,{0xA8,0x4F},0xD6},
	{2,{0xA8,0x55},0xDC},
	
	/***Tilde***/
	{2,{0x7E,0x61},0xE3},
	{2,{0x7E,0x6F},0xF5},
	{2,{0x7E,0x6E},0xF1},
	{2,{0x7E,0x41},0xC3},
	{2,{0x7E,0x4F},0xD5},
	{2,{0x7E,0x4E},0xD1}
};

static const mmi_gui_dead_key_symbol_struct gui_turkish_symbols[]=
{
	/****Grave Accent***/
	{2,{0x60,0x61},0xE0},
	{2,{0x60,0x65},0xE8},
	{2,{0x60,0x69},0xEC},
	{2,{0x60,0x131},0xEC},
	{2,{0x60,0x6F},0xF2},
	{2,{0x60,0x75},0xF9},
	
	{2,{0x60,0x41},0xC0},
	{2,{0x60,0x45},0xC8},
	{2,{0x60,0x49},0xCC},
	{2,{0x60,0x130},0xCC},
	{2,{0x60,0x4F},0xD2},
	{2,{0x60,0x55},0xD9},
	
	/***Acute Accent***/
	{2,{0xB4,0x61},0xE1},
	{2,{0xB4,0x65},0xE9},
	{2,{0xB4,0x69},0xED},
	{2,{0xB4,0x131},0xED},
	{2,{0xB4,0x6F},0xF3},
	{2,{0xB4,0x75},0xFA},
	

	{2,{0xB4,0x41},0xC1},
	{2,{0xB4,0x45},0xC9},
	{2,{0xB4,0x49},0xCD},
	{2,{0xB4,0x130},0xCD},
	{2,{0xB4,0x4F},0xD3},
	{2,{0xB4,0x55},0xDA},
	
	/***circumflex accent***/
	{2,{0x5E,0x61},0xE2},
	{2,{0x5E,0x65},0xEA},
	{2,{0x5E,0x69},0xEE},
	{2,{0x5E,0x131},0xEE},
	{2,{0x5E,0x6F},0xF4},
	{2,{0x5E,0x75},0xFB},

	{2,{0x5E,0x41},0xC2},
	{2,{0x5E,0x45},0xCA},
	{2,{0x5E,0x49},0xCE},
	{2,{0x5E,0x130},0xCE},
	{2,{0x5E,0x4F},0xD4},
	{2,{0x5E,0x55},0xDB},
	
	/***Diaeresis***/
	{2,{0xA8,0x61},0xE4},
	{2,{0xA8,0x65},0xEB},
	{2,{0xA8,0x69},0xEF},
	{2,{0xA8,0x131},0xEF},
	{2,{0xA8,0x6F},0xF6},
	{2,{0xA8,0x75},0xFC},
	{2,{0xA8,0x79},0xFF},

	{2,{0xA8,0x41},0xC4},
	{2,{0xA8,0x45},0xCB},
	{2,{0xA8,0x49},0xCF},
	{2,{0xA8,0x130},0xCF},
	{2,{0xA8,0x4F},0xD6},
	{2,{0xA8,0x55},0xDC},
	
	/***Tilde***/
	{2,{0x7E,0x61},0xE3},
	{2,{0x7E,0x6F},0xF5},
	{2,{0x7E,0x6E},0xF1},
	
	{2,{0x7E,0x41},0xC3},
	{2,{0x7E,0x4F},0xD5},
	{2,{0x7E,0x4E},0xD1}
};
#endif /*__MMI_VKBD_EUROPEAN_SUPPORT__*/


/* The order should be the same as mmi_gui_virtual_keyboard_language_enum */
const mmi_gui_dead_key_map_struct gui_dead_key_symbol_table[]=
{
		/* English */
		{NULL, 0},
		{NULL, 0},
		/* Symbol */
		{NULL, 0},
		/* Tray */
		{NULL, 0},
		/* Number */
		{NULL, 0},
		/* Phone Number */
		{NULL, 0},
		/* Empty Tray */
		{NULL, 0},
		/* Number Tray */
		{NULL, 0},
		/* Number Dot Tray */
		{NULL, 0}
/*MTK Terry Temp Solution for Custom Release*/
//#ifdef __MMI_LANG_SM_CHINESE__
		,{NULL, 0}
//#endif
//#ifdef __MMI_LANG_TR_CHINESE__
		,{NULL, 0}
//#endif
//#if defined(__MMI_LANG_TR_CHINESE__) || defined(__MMI_LANG_SM_CHINESE__)
		,{NULL, 0}
//#endif
	/* Asia-pacific */
#ifdef __MMI_LANG_THAI__
#endif
#ifdef __MMI_LANG_INDONESIAN__
#endif
#ifdef __MMI_LANG_MALAY__
#endif
#ifdef __MMI_LANG_VIETNAMESE__
#endif
	/* Hindi */
#ifdef __MMI_LANG_HINDI__
#endif
	/* Arabic */
#ifdef __MMI_LANG_ARABIC__
#endif
	/* Europe */
#ifdef __MMI_LANG_SPANISH__
		,{gui_european_symbols,sizeof(gui_european_symbols)/sizeof(gui_european_symbols[0])}
		,{gui_european_symbols,sizeof(gui_european_symbols)/sizeof(gui_european_symbols[0])}
#endif
#ifdef __MMI_LANG_FRENCH__
		,{gui_european_symbols,sizeof(gui_european_symbols)/sizeof(gui_european_symbols[0])}
		,{gui_european_symbols,sizeof(gui_european_symbols)/sizeof(gui_european_symbols[0])}
#endif
#ifdef __MMI_LANG_GERMAN__
		,{gui_european_symbols,sizeof(gui_european_symbols)/sizeof(gui_european_symbols[0])}
		,{gui_european_symbols,sizeof(gui_european_symbols)/sizeof(gui_european_symbols[0])}
#endif
#ifdef __MMI_LANG_ITALIAN__
		,{gui_european_symbols,sizeof(gui_european_symbols)/sizeof(gui_european_symbols[0])}
		,{gui_european_symbols,sizeof(gui_european_symbols)/sizeof(gui_european_symbols[0])}
#endif
#ifdef __MMI_LANG_RUSSIAN__
		,{NULL, 0}
		,{NULL, 0}
#endif
#ifdef __MMI_LANG_TURKISH__
		,{gui_turkish_symbols,sizeof(gui_turkish_symbols)/sizeof(gui_turkish_symbols[0])}
		,{gui_turkish_symbols,sizeof(gui_turkish_symbols)/sizeof(gui_turkish_symbols[0])}
#endif
#ifdef __MMI_LANG_PORTUGUESE__
		,{gui_european_symbols,sizeof(gui_european_symbols)/sizeof(gui_european_symbols[0])}
		,{gui_european_symbols,sizeof(gui_european_symbols)/sizeof(gui_european_symbols[0])}
#endif
#ifdef __MMI_VKBD_EUROPEAN_SUPPORT__
		,{NULL, 0}
#endif
};


/***************************************************************************** 
* Global Function
*****************************************************************************/


/*****************************************************************************
* FUNCTION
*  create_virtual_keyboard
* DESCRIPTION
*  Create virtual keyboard object
*
* PARAMETERS
*	void
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
* REMARKS
*	The function is dummy because the keyboard object is statically allocated.
*****************************************************************************/
void create_virtual_keyboard(void)
{
	S32 map_index, key_index;
	S32 max_value=0, tmp;
	const gui_keyboard_layout_struct		*layout;
	const gui_keyboard_language_struct	*lang;

	MMI_DBG_ASSERT(sizeof(MMI_virtual_keyboard_language_map)/sizeof(gui_keyboard_lang_map_struct) == MMI_GUI_VIRTUAL_KEYBOARD_MAX_LANG);
	MMI_DBG_ASSERT(sizeof(gui_dead_key_symbol_table)/sizeof(mmi_gui_dead_key_map_struct) == MMI_GUI_VIRTUAL_KEYBOARD_MAX_LANG);

	/* Compute the cache size of key */
	for (map_index = 0; map_index < MMI_GUI_VIRTUAL_KEYBOARD_MAX_LANG; map_index++)
	{
		layout = MMI_virtual_keyboard_language_map[map_index].virtual_keyboard_layout;
		lang = MMI_virtual_keyboard_language_map[map_index].virtual_keyboard_language;

		for (key_index = 0; key_index < layout->n_custom_keys; key_index++)
		{
			if (lang->custom_key_type[key_index] == GUI_VKBD_PEN_DISPLAY_AREA)
			{
				/* Display area is not cached due to its size */
				continue; 
			}
			tmp = layout->custom_keys[key_index].key_height * layout->custom_keys[key_index].key_width;
			if (tmp > max_value)
			{
				max_value = tmp;
			}
		}
	}

	MMI_virtual_keyboard_bitmap_cache_size = ((max_value * gdi_layer_get_bit_per_pixel()) + 7) >> 3;
	
	/* MMI_GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY is the default value */
	pixtel_UI_create_virtual_keyboard(&MMI_virtual_keyboard, (S16) MMI_content_x, (S16) MMI_content_y, MMI_GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY);
}


/*****************************************************************************
* FUNCTION
*  wgui_setup_virtual_keyboard
* DESCRIPTION
*  Setup the language of virtual keyboard object
*
* PARAMETERS
*	lang_type	IN		Language
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
* REMARKS
*
*****************************************************************************/
void wgui_setup_virtual_keyboard(mmi_gui_virtual_keyboard_language_enum lang_type)
{
	S32 vkbd_height = MMI_virtual_keyboard_language_map[lang_type].virtual_keyboard_layout->height;
	pixtel_UI_create_virtual_keyboard(&MMI_virtual_keyboard, (S16) MMI_content_x, (S16) (MMI_content_y + MMI_content_height - vkbd_height ), lang_type);
}


/*****************************************************************************
* FUNCTION
*  wgui_close_virtual_keyboard
* DESCRIPTION
*  Release the resource used by virtual keyboard object
*
* PARAMETERS
*	lang_type	IN		Language
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
* REMARKS
*	Used in exit function or exit category function 
*****************************************************************************/
void wgui_close_virtual_keyboard(void)
{
	/* DUMMY */
}


/*****************************************************************************
* FUNCTION
*  wgui_set_virtual_keyboard_display_area
* DESCRIPTION
*  Update text displayed on display area
*
* PARAMETERS
*	string		IN		string to be displayed in display area
*	redraw		IN		whether to redraw the keyboard
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
* REMARKS
*	
*****************************************************************************/
void wgui_set_virtual_keyboard_display_area(const U8 *string, BOOL redraw)
{
	pixtel_UI_set_virtual_keyboard_display_area(&MMI_virtual_keyboard, string, redraw);
}


/*****************************************************************************
* FUNCTION
*  wgui_get_virtual_keyboard_size
* DESCRIPTION
*  Get the current size of virtual keyboard
*
* PARAMETERS
*	width		OUT		
*	height	OUT
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
* REMARKS
*	Keyboards of different languages have different size
*****************************************************************************/
void wgui_get_virtual_keyboard_size(S32 *width, S32 *height)
{
	*width = MMI_virtual_keyboard.width;
	*height = MMI_virtual_keyboard.height;
}


/*****************************************************************************
* FUNCTION
*   wgui_set_virtual_keyboard_allowed_characters
* DESCRIPTION
*   Only the allowd characters can be input on keyboard.
*   This function and wgui_set_virtual_keyboard_disabled_list() are mutually-exclusive.
*
*   Control keys such as GUI_VKBD_PEN_HIDE, GUI_VKBD_PEN_SHOW... are enabled because 
*   they are not related to character insertion.
*
*   `allowed_characters' may contain '-' for consecutive characters
*   (Ex. 'a-z' for characters from a to z.)
*   If we want to accept "-", please write it as '\-'.
*   For example, '\-0-9.' represents "-0123456789."
*
*   Example of valid characters in email addresss:
*   wgui_set_virtual_keyboard_allowed_characters((const UI_character_type *) L"+_\\-.@A-Za-z0-9");
*   (it is not a complete list of all characters allowed in RFC, but it satisfies almost all cases)
*
* PARAMETERS
*	allowed_chars		IN		allowed characters 
* RETURNS
*  void
*****************************************************************************/
void wgui_set_virtual_keyboard_allowed_characters(const UI_character_type *allowed_chars)
{
    pixtel_UI_set_virtual_keyboard_allowed_characters(&MMI_virtual_keyboard, allowed_chars);
}


/*****************************************************************************
* FUNCTION
*  wgui_set_virtual_keyboard_disabled_list
* DESCRIPTION
*  Set disabled characters in virtual keyboard
*
* PARAMETERS
*	disabled_chars		IN		ended by '\0'
*	disabled_symbols	IN		ended by GUI_VKBD_PEN_NONE
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
* REMARKS
*	
*****************************************************************************/
void wgui_set_virtual_keyboard_disabled_list(const UI_character_type *disabled_chars, 
															const mmi_gui_virtual_keyboard_pen_enum *disabled_symbols)
{
	pixtel_UI_set_virtual_board_disable_list(&MMI_virtual_keyboard, disabled_chars, disabled_symbols);
}

/*****************************************************************************
* FUNCTION
*  wgui_move_virtual_keyboard
* DESCRIPTION
*  Move the position of virtual keyboard
*
* PARAMETERS
*	x		IN		
*	y		IN
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
* REMARKS
*	
*****************************************************************************/
void wgui_move_virtual_keyboard(S32 x, S32 y)
{
	pixtel_UI_move_virtual_keyboard(&MMI_virtual_keyboard, (S16) x, (S16) y);
}


/*****************************************************************************
* FUNCTION
*  wgui_show_virtual_keyboard
* DESCRIPTION
*  Display virtual keyboard 
*
* PARAMETERS
*
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
* REMARKS
*	
*****************************************************************************/
void wgui_show_virtual_keyboard(void)
{
	pixtel_UI_lock_double_buffer();
	pixtel_UI_show_virtual_keyboard(&MMI_virtual_keyboard);
	pixtel_UI_unlock_double_buffer();
	pixtel_UI_BLT_double_buffer(MMI_virtual_keyboard.x, MMI_virtual_keyboard.y, 
		MMI_virtual_keyboard.x + MMI_virtual_keyboard.width - 1, MMI_virtual_keyboard.y + MMI_virtual_keyboard.height - 1);
}


/*****************************************************************************
* FUNCTION
*  wgui_greyscale_virtual_keyboard
* DESCRIPTION
*  Make the 'displayed' virtual keyboard as greyed (disabled)
*
* PARAMETERS
*
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
* REMARKS
*	
*****************************************************************************/
void wgui_greyscale_virtual_keyboard(void)
{
	pixtel_UI_lock_double_buffer();
	pixtel_UI_greyscale_rectangle(MMI_virtual_keyboard.x, MMI_virtual_keyboard.y, 
		MMI_virtual_keyboard.x + MMI_virtual_keyboard.width - 1, MMI_virtual_keyboard.y + MMI_virtual_keyboard.height - 1,
		MMI_VKBD_GRAYSCALE_VALUE, MMI_BG_GREYSCALE_BLACK_VALUE);//102605 greyscale Calvin modified
	pixtel_UI_unlock_double_buffer();
	pixtel_UI_BLT_double_buffer(MMI_virtual_keyboard.x, MMI_virtual_keyboard.y, 
		MMI_virtual_keyboard.x + MMI_virtual_keyboard.width - 1, MMI_virtual_keyboard.y + MMI_virtual_keyboard.height - 1);
}

⌨️ 快捷键说明

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