📄 jui_util.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) 2001
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* jui_util.c
*
* Project:
* --------
* Maui_Software
*
* Description:
* ------------
* This file implements Font adaption APIs
*
* 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!
*
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
/*************************************************************************
* Include header files
*************************************************************************/
#include "kal_release.h"
#include "stack_common.h"
#include "stack_msgs.h"
#include "app_ltlcom.h" /* Task message communiction */
#define MMIAPI_USING_UI
#include "mmiapi_struct.h"
#include "jal.h"
#include "jui_internal.h"
#include "gdi_const.h"
#include "MMI_features.h"
extern void jui_editor_callback(kal_bool result, int text_len);
/*****************************************************************************
* FUNCTION
* jui_util_msg_handler
* DESCRIPTION
* handle incoming messages for jui
* PARAMETERS
* ilm_ptr [IN] Incoming message
* RETURNS
*
*****************************************************************************/
kal_bool jui_util_msg_handler(ilm_struct *ilm_ptr)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
switch (ilm_ptr->msg_id)
{
case MSG_ID_MMIAPI_UI_ENTER_FULLSCREEN_EDITOR_RSP:
{
kal_bool result = KAL_FALSE;
int text_len = 0;
mmiapi_ui_enter_fullscreen_editor_rsp_struct *msg =
(mmiapi_ui_enter_fullscreen_editor_rsp_struct*) ilm_ptr->local_para_ptr;
result = msg->result;
text_len = msg->text_length;
jui_editor_callback(result, text_len);
}
break;
default:
return KAL_FALSE;
}
return KAL_TRUE;
}
/*****************************************************************************
* FUNCTION
* jui_set_device_bmp_header
* DESCRIPTION
* set header of image device bmp format
* PARAMETERS
* kal_int32 pixel_size
* kal_int32 width
* kal_int32 height
* kal_char* icon_mmi_fmt
* RETURNS
* kal_in32 the size of the image device bmp header.
*****************************************************************************/
kal_int32 jui_set_device_bmp_header(kal_int32 pixel_size, kal_int32 width, kal_int32 height, kal_char* icon_mmi_fmt)
{
icon_mmi_fmt[0] = GDI_IMAGE_TYPE_DEVICE_BITMAP;
icon_mmi_fmt[1] = 1;
/* total size */
icon_mmi_fmt[2] = ((pixel_size << 1) + 13) & 0xff;
icon_mmi_fmt[3] = (((pixel_size << 1) + 13) >> 8) & 0xff;
icon_mmi_fmt[4] = (((pixel_size << 1) + 13) >> 16) & 0xff;
/* width, height */
icon_mmi_fmt[5] = width & 0xff;
icon_mmi_fmt[6] = ((width & 0xf00) >> 8) + ((height & 0xf) << 4);
icon_mmi_fmt[7] = (height >> 4) & 0xff;
/* width */
icon_mmi_fmt[8] = width & 0xff;
icon_mmi_fmt[9] = (width >> 8) & 0xff;
icon_mmi_fmt[10] = (width >> 16) & 0xff;
icon_mmi_fmt[11] = (width >> 24) & 0xff;
/* height */
icon_mmi_fmt[12] = height & 0xff;
icon_mmi_fmt[13] = (height >> 8) & 0xff;
icon_mmi_fmt[14] = (height >> 16) & 0xff;
icon_mmi_fmt[15] = (height >> 24) & 0xff;
//#if ((defined(MMI_MAIN_BASE_LAYER_BITS_PER_PIXEL) && (MMI_MAIN_BASE_LAYER_BITS_PER_PIXEL == 24)) || \
// (defined(MMI_MAIN_LCD_DEFAULT_FORMAT) && (MMI_MAIN_LCD_DEFAULT_FORMAT == 24)))
// icon_mmi_fmt[16] = 24;
//#else /*16 bits device BMP */
icon_mmi_fmt[16] = 16;
//#endif
/* icon_len should be divided by 2 */
icon_mmi_fmt[17] = (width << 1) & 0xff;
icon_mmi_fmt[18] = (width >> 7) & 0xff;
icon_mmi_fmt[19] = (width >> 15) & 0xff;
icon_mmi_fmt[20] = (width >> 23) & 0xff;
return 21;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -