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

📄 wgui.c

📁 The font library converting tool MCT mainly introduces the process of the font formats to give us a
💻 C
📖 第 1 页 / 共 3 页
字号:
/*****************************************************************************
*  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..c
 *
 * Project:
 * --------
 *  MAUI
 *
 * Description:
 * ------------
 *  key_handlers wrappers and initialize UI..
 *
 * 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!
 *
 *	Copyright Notice
 *	(c) 2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
 *	Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
 * removed!
 * removed!
 */
 
/**********************************************************************************
	Filename:		wgui.c
	Author:			manju
	Date Created:	August-07-2002
	Contains:		PixTel UI wrapper routines
					Contains several parts and has been split to multiple
					code files. See other files named wgui_*.c and wgui_*.h
					This file contains common functions and data.
**********************************************************************************/


/* Include: MMI header file */
#include "gui_config.h"
#include "gui_themes.h"
#include "wgui.h"
#include "wgui_softkeys.h"
#include "wgui_menu_shortcuts.h"
#include "wgui_fixed_menus.h"
#include "wgui_fixed_menuitems.h"
#include "wgui_status_icons.h"	
#include "wgui_inputs.h"
#include "wgui_virtual_keyboard.h"
#include "IdleAppDef.h"
#include "wgui_categories.h"
#include "Gui_Setting.h"
#include "UCS2prot.h"
#include "FunAndGamesDefs.h"
#include "NVRAMType.h"
#include "NVRAMProt.h"
#include "NVRAMEnum.h"
#ifdef __MMI_GB__
#include "gb_wrapper.h"
#endif

#if(!UI_DISABLE_EMS_INPUT_BOX)
#include "gui_ems.h"
#endif

/* 
** Local Variable
*/
static void (*MMI_keyboard_key_handler)(S32 vkey_code,S32 key_state)=NULL;
static void (*MMI_keyboard_input_handler)(S32 vkey_code)=NULL;
static void (*MMI_keyboard_global_key_handler)(S32 vkey_code,S32 key_state)=NULL;
static void (*MMI_keyboard_global_input_handler)(S32 vkey_code)=NULL;
static void (*MMI_key_input_handler_function)(MMI_key_code_type key_code,MMI_key_event_type key_event);
static void (*MMI_key_down_handler_function)(MMI_key_code_type key_code);
static void (*MMI_key_up_handler_function)(MMI_key_code_type key_code);


/* 
** Global Variable
*/
byte MMI_disable_title_shortcut_display=0;
S32	MMI_status_bar_height;
S32	MMI_content_x;
S32	MMI_content_y;
S32	MMI_content_width;
S32	MMI_content_height;

extern MMI_theme theme_Default;
extern MMI_theme **MMI_themes;

/* 
** Global Function
*/

/*****************************************************************************
* FUNCTION
*  MMI_dummy_function
*
* DESCRIPTION
*   Dummy function used in MMI
*
* PARAMETERS
*  void
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void MMI_dummy_function(void)
{
}

/*	Functions for keyboard Support	*/
/*****************************************************************************
* FUNCTION
*  dummy_keyboard_key_handler
*
* DESCRIPTION
*   Dummy keyboard key handler
*
* PARAMETERS
*  vkey_code		IN		key_code
*  key_state		IN		key_state
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void dummy_keyboard_key_handler(S32 vkey_code,S32 key_state)
{
	UI_UNUSED_PARAMETER(vkey_code);
	UI_UNUSED_PARAMETER(key_state);
}

/*****************************************************************************
* FUNCTION
*  dummy_keyboard_input_handler
*
* DESCRIPTION
*   Dummy keyboard input handler
*
* PARAMETERS
*  vkey_code		IN		key_code
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void dummy_keyboard_input_handler(S32 vkey_code)
{	
	UI_UNUSED_PARAMETER(vkey_code);
}

/*****************************************************************************
* FUNCTION
*  keyboard_key_handler
*
* DESCRIPTION
*   Handles key events (UP/DOWN)
*
* PARAMETERS
*  vkey_code		IN		key's scan code
*  key_state		IN		key's state (up or down)
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void keyboard_key_handler(S32 vkey_code,S32 key_state)
{
	byte state=0;

	/*	Perform scan code and key state mapping here	*/
	if(key_state == KEYBOARD_KEY_DOWN)
		state=1;
	else if(key_state == KEYBOARD_KEY_UP)
		state=0;
	if (MMI_keyboard_key_handler != NULL)
		MMI_keyboard_key_handler(vkey_code,state);
}

/*****************************************************************************
* FUNCTION
*  keyboard_input_handler
*
* DESCRIPTION
*   Handles keyboard input
*
* PARAMETERS
*  vkey_code		IN		key's character code (ASCII)
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void keyboard_input_handler(S32 vkey_code)
{
	if (MMI_keyboard_input_handler != NULL)
		MMI_keyboard_input_handler(vkey_code);
}

/*****************************************************************************
* FUNCTION
*  keyboard_global_key_handler
*
* DESCRIPTION
*   Handles key events (UP/DOWN)
*
* PARAMETERS
*  vkey_code		IN		key's scan code
*  key_state		IN		key's state (up or down)
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void keyboard_global_key_handler(S32 vkey_code,S32 key_state)
{
	byte state=0;

	/*	Perform scan code and key state mapping here	*/
	if(key_state == KEYBOARD_KEY_DOWN)
		state=1;
	else if(key_state == KEYBOARD_KEY_UP)
		state=0;

	if (MMI_keyboard_global_key_handler != NULL)
		MMI_keyboard_global_key_handler(vkey_code,state);
}

/*****************************************************************************
* FUNCTION
*  keyboard_global_input_handler
*
* DESCRIPTION
*   Handles keyboard input
*
* PARAMETERS
*  vkey_code		IN		key's character code (ASCII)
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void keyboard_global_input_handler(S32 vkey_code)
{	
	if(MMI_keyboard_global_input_handler != NULL)
		MMI_keyboard_global_input_handler(vkey_code);
}

/*****************************************************************************
* FUNCTION
*  register_keyboard_key_handler
*
* DESCRIPTION
*   Registers a function to be called for key handling
*
* PARAMETERS
*  f		IN		function to be called for key handling
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void register_keyboard_key_handler(void (*f)(S32 vkey_code,S32 key_state))
{	
	MMI_keyboard_key_handler = f;
}

/*****************************************************************************
* FUNCTION
*  register_keyboard_input_handler
*
* DESCRIPTION
*   Registers a function to be called for key input
*
* PARAMETERS
*  f		IN		function that is called upon key events
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void register_keyboard_input_handler(void (*f)(S32 vkey_code))
{
	MMI_keyboard_input_handler = f;
}

/*****************************************************************************
* FUNCTION
*  register_keyboard_global_key_handler
*
* DESCRIPTION
*   Registers a function to be called for key handling
*
* PARAMETERS
*  f		IN		function that is called upon key events
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void register_keyboard_global_key_handler(void (*f)(S32 vkey_code,S32 key_state))
{
	MMI_keyboard_global_key_handler = f;
}

/*****************************************************************************
* FUNCTION
*  register_keyboard_global_input_handler
*
* DESCRIPTION
*   Register_keyboard_global_input_handler
*
* PARAMETERS
*  f		IN		function that is called upon key events
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void register_keyboard_global_input_handler(void (*f)(S32 vkey_code))
{	
	MMI_keyboard_global_input_handler = f;
}

/*****************************************************************************
* FUNCTION
*  clear_keyboard_key_handler
*
* DESCRIPTION
*   Clears the function called to handle key events
*
* PARAMETERS
*  void
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void clear_keyboard_key_handler(void)
{	
	MMI_keyboard_key_handler = dummy_keyboard_key_handler;
}

/*****************************************************************************
* FUNCTION
*  clear_keyboard_input_handler
*
* DESCRIPTION
*   Clears the function called to handle key input
*
* PARAMETERS
*  void
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void clear_keyboard_input_handler(void)
{	
	MMI_keyboard_input_handler = dummy_keyboard_input_handler;
}

/*****************************************************************************
* FUNCTION
*  clear_keyboard_global_key_handler
*
* DESCRIPTION
*   Clears the function called to handle key events
*
* PARAMETERS
*  void
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void clear_keyboard_global_key_handler(void)
{	
	MMI_keyboard_global_key_handler = dummy_keyboard_key_handler;
}

/*****************************************************************************
* FUNCTION
*  clear_keyboard_global_input_handler
*
* DESCRIPTION
*   Clears the function called to handle key input
*
* PARAMETERS
*  void
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void clear_keyboard_global_input_handler(void)
{
	MMI_keyboard_global_input_handler = dummy_keyboard_input_handler;
}

/*	Key handling wrappers		*/
/*****************************************************************************
* FUNCTION
*  clear_key_handlers
*
* DESCRIPTION
*   Clears the key handlers
*
* PARAMETERS
*  void
*
* RETURNS
*  
* GLOBALS AFFECTED
*  
*****************************************************************************/
void clear_key_handlers(void)
{	

⌨️ 快捷键说明

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