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

📄 bra_inse.c

📁 MTK6226修改平台UI的文件介绍
💻 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).
*
*****************************************************************************/
/*
 * Copyright (C) Teleca Mobile Technologies AB, 2002-2003.
 * All rights reserved.
 *
 * This software is covered by the license agreement between
 * the end user and Teleca Mobile Technologies AB, and may be 
 * used and copied only in accordance with the terms of the 
 * said agreement.
 *
 * Teleca Mobile Technologies AB assumes no responsibility or 
 * liability for any errors or inaccuracies in this software, 
 * or any consequential, incidental or indirect damage arising
 * out of the use of the software.
 *
  * $Log: bra_inse.c,v $
  * Revision 1.2  2007/05/21 11:04:36  liuxiannian
  * MT158-370
  * Modification Author:liuxn
  * Date:20070510
  * Content:
  * 纠正注释不规范BUG:
  * MT158-51 网络服务--->WAP 数字序号右半部分缺失
  *
  * Revision 1.1.1.1  2007/05/11 08:53:09  zhouxiang
  * no message
  *
  * Revision 1.2  2007/04/20 02:57:05  liuxiannian
  * MT158-51
  * Modification Author:liuxn
  * Date:20070418
  * Content:解决网络服务--->WAP 数字序号右半部分缺失 的问题
  *            
 */
/*
 * bra_inse.c
 *
 * Description:
 *		This file contains code for the Internet Services menu
 */
#include "bra_main.h"
#include "bra_win.h"
#include "bra_view.h"
#include "bra_req.h"
#include "bra_set.h"
#include "bra_sig.h"
#include "bra_cmn.h"
#include "bra_str.h"
#include "bra_inse.h"
#include "bra_bkm.h"
#include "bra_prof.h"
#include "bra_dlg.h"
#include "bra_rpl.h"
#include "bra_sif.h"

#ifdef BRA_CONFIG_SECURITY
#include "bra_sec.h"
#endif

#ifdef BRA_CFG_OFFLINE_PAGES
#include "bra_ofln.h"
#endif

#include "wap.h"

#include "msf_lib.h"
#include "msf_core.h"


/************************************************************
 * Local Types
 ************************************************************/

/* start menu */
typedef struct {
  MsfWindowHandle windowHandle;
  MsfActionHandle selectActionHandle;
  MsfActionHandle backActionHandle;
} bra_inse_menu_t;

#ifdef WAP_MEM_DEBUG

static MSF_UINT8 dump;

typedef struct {
  MsfWindowHandle windowHandle;
  MsfActionHandle selectActionHandle;
  MsfActionHandle backActionHandle;
} bra_mem_logging_menu_t;

/************************************************************
 * Memory Logging Function 
 ************************************************************/

static void
bra_widget_action_mem_logging_menu (bra_win_t *win, MSF_UINT32 bra_action)
{
  bra_mem_logging_menu_t *p;
  MSF_UINT8 i = 0;

  p = (bra_mem_logging_menu_t *)(win);

	if (bra_action == p->backActionHandle)
	{
      bra_win_close_window(BRA_WIN_CLOSE_CURRENT, 0);
	}
	else if (bra_action == p->selectActionHandle)
	{
      extern void wap_set_mem_debug_mod(MSF_UINT8 modId);

		if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Memory Dump to Catcher*/
      dump = 0;      
      }
#ifndef __MTK_TARGET__
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Memory Dump to File*/      
      dump = 1;
      }
#endif
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Set MSM as Memory Logging Module*/
      wap_set_mem_debug_mod(MSF_MODID_MSM);
		}
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Set STK as Memory Logging Module*/
      wap_set_mem_debug_mod(MSF_MODID_STK);
		}
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Set BRS as Memory Logging Module*/
      wap_set_mem_debug_mod(MSF_MODID_BRS);
		}
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Set BRA as Memory Logging Module*/
      wap_set_mem_debug_mod(MSF_MODID_BRA);
		}
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Set PHS as Memory Logging Module*/
      wap_set_mem_debug_mod(MSF_MODID_PHS);
		}
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Set UIS as Memory Logging Module*/
      wap_set_mem_debug_mod(MSF_MODID_UIS);
		}
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Set PRS as Memory Logging Module*/
      wap_set_mem_debug_mod(MSF_MODID_PRS);
		}
#ifdef BRA_CONFIG_SECURITY
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Set SEC as Memory Logging Module*/
      wap_set_mem_debug_mod(MSF_MODID_SEC);
		}
#endif
#ifdef BRA_CONFIG_MMS
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Set MMS as Memory Logging Module*/
      wap_set_mem_debug_mod(MSF_MODID_MMS);
		}
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Set MEA as Memory Logging Module*/
      wap_set_mem_debug_mod(MSF_MODID_MEA);
		}
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Set SLS as Memory Logging Module*/
      wap_set_mem_debug_mod(MSF_MODID_SLS);
		}
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Set SMA as Memory Logging Module*/
      wap_set_mem_debug_mod(MSF_MODID_SMA);
		}
#endif
		else if (MSF_WIDGET_CHOICE_GET_ELEM_STATE(p->windowHandle, i++) & MSF_CHOICE_ELEMENT_SELECTED)
		{
      /*Set WIDGET as Memory Logging Module*/
      wap_set_mem_debug_mod(MSF_MODID_WIDGET);
		}
      bra_win_close_window(BRA_WIN_CLOSE_CURRENT, 0);
	}
}

static void
bra_delete_mem_logging_menu (bra_win_t *win)
{
  extern void wap_mem_debug_dump_catcher(void);
#ifndef __MTK_TARGET__
  extern void wap_mem_debug_dump_file(void);
#endif
  bra_mem_logging_menu_t *p;

  p = (bra_mem_logging_menu_t *)(win);

  MSF_WIDGET_REMOVE (bra_win_get_screen (), p->windowHandle); 

	MSF_WIDGET_RELEASE (p->windowHandle); 
	MSF_WIDGET_RELEASE (p->selectActionHandle);
	MSF_WIDGET_RELEASE (p->backActionHandle);

  BRA_FREE (p);

  if(dump == 0)
     wap_mem_debug_dump_catcher();
#ifndef __MTK_TARGET__
  else if(dump == 1)
     wap_mem_debug_dump_file();
#endif     
}

void
bra_create_mem_logging_menu (void)
{
  bra_mem_logging_menu_t *win;
  MsfPosition pos = BRA_CFG_MENU_POS;
  MsfDeviceProperties prop;
  MSF_UINT8 i = 0;
  MsfStringHandle ms;
  extern unsigned int wapadp_alloc_mem[WAP_MEM_POOL_NUM];
  extern unsigned int wapadp_max_mem[WAP_MEM_POOL_NUM];
  char s[32];

  MSF_WIDGET_DEVICE_GET_PROPERTIES(&prop);
	
  /*remove menu key action from screen*/
  bra_view_disable ();

  win = BRA_ALLOCTYPE (bra_mem_logging_menu_t);
  
	win->selectActionHandle = MSF_WIDGET_ACTION_CREATE(MSF_MODID_BRA, BRA_STR_OK,MsfSelect,1, 0x8000);
	win->backActionHandle = MSF_WIDGET_ACTION_CREATE(MSF_MODID_BRA, BRA_STR_BACK,MsfBack,1, 0x8000);
	win->windowHandle = MSF_WIDGET_MENU_CREATE(MSF_MODID_BRA,
                                             MsfImplicitChoice,
                                             &prop.displaySize,
                                             win->selectActionHandle,
                                             0, /*Element Position*/
                                             MSF_CHOICE_ELEMENT_STRING_1, /*Bit Mask*/
                                             0x8000, /*Property Mask*/
                                             0 /*Default Style*/);

   ms = BRA_STRCONV("Dump to Catcher");
   MSF_WIDGET_CHOICE_SET_ELEMENT (win->windowHandle, i++, ms,  0, bra_cmn_get_list_num_image(i), 0, TRUE);

⌨️ 快捷键说明

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