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

📄 mmiresources.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 2 页
字号:
    T_MFW_HND win = mfw_parent(mfw_header());
    
	recources_Init(win);
/*..........................zy change the language flashdata 04/08/02.....................*/
	FFS_flashData.language=0;
    flash_write();
    MmiRsrcSetChinese();
/*..............................end of zy change ...............04/08/02.*/
	SEND_EVENT (recources_data.recources_win, SHOW_CONFIRM, 0, 0);

}

UBYTE Mmi_getCurrentLanguage(void)
{
	return currentLanguage;
}

UBYTE Mmi_layout_first_line(void)
{
	if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
		return FIRST_LINE_CHINESE;
	else
		return FIRST_LINE;
}
//BUG#616 Added procedures Mmi_layout_first_line_icons,Mmi_layout_second_line_icons for displays with icons.
UBYTE Mmi_layout_first_line_icons(void)
{
	if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
		return FIRST_LINE_CHINESE;
	else
		return FIRST_LINE_ICON;
}

UBYTE Mmi_layout_second_line(void)
{
	if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
		return SECOND_LINE_CHINESE;
	else
		return SECOND_LINE;
}
UBYTE Mmi_layout_second_line_icons(void)
{
	if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
		return SECOND_LINE_CHINESE;
	else
		return SECOND_LINE_ICON;
}

UBYTE Mmi_layout_third_line(void)
{
	if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
		return THIRD_LINE_CHINESE;
	else
		return THIRD_LINE;
}

UBYTE Mmi_layout_fourth_line(void)
{
	if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
		return FOURTH_LINE_CHINESE;
	else
		return FOURTH_LINE;
}

UBYTE Mmi_layout_fifth_line(void)
{
		return FIFTH_LINE;
}

UBYTE Mmi_layout_line_height(void)
{
	if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
		return LINE_HEIGHT_CHINESE;
	else
		return LINE_HEIGHT;
}

/* 2004/05/17 sunsj modify for menu line number */
UBYTE Mmi_number_of_lines_with_icons_on_top(void)
{
#if(MAIN_LCD_SIZE==3)//jhxu720
	if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
		return 4;
	else
		return 4;
#elif ( MAIN_LCD_SIZE==4 )
	if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
		return 8;
	else
		return 8;
#elif ( MAIN_LCD_SIZE==2)
	if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
		return 4;
	else
		return 4;
#endif
}

/* 2004/05/17 sunsj modify for menu line number */
UBYTE Mmi_number_of_lines_without_icons_on_top(void)
{
#if(MAIN_LCD_SIZE==3)//jhxu720
	if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
		return 6;
	else
		return 6;
#elif ( MAIN_LCD_SIZE==4 )
	if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
		return 9;
	else
		return 9;
#elif ( MAIN_LCD_SIZE==2 )
	if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
		return 6;
	else
		return 6;
#endif
}

void Mmi_layout_areas(void)
{
	selected_area.py =Mmi_layout_line_height();
	selected_area.sy =SCREEN_SIZE_Y-Mmi_layout_line_height()*2-1;
	//iconsMainIconsAreaSet(selected_area);
	Mmi_set_area_attr(&menuArea,0,0,SCREEN_SIZE_X,Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top());
	Mmi_set_area_attr(&menuNamesArea,0,0,SCREEN_SIZE_X,32);
	//Mmi_set_area_attr(&menuListArea,0,  0, SCREEN_SIZE_X, Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top()); xsf remarked it 12.18
	Mmi_set_area_attr(&editor_menuArea,Mmi_layout_first_line(),0,SCREEN_SIZE_X,Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top());
	//Mmi_set_area_attr(&network_menuArea,0,0,SCREEN_SIZE_X,Mmi_layout_line_height()*Mmi_number_of_lines_with_icons_on_top()); 
	Mmi_set_area_attr(&network_menuArea,0,0,SCREEN_SIZE_X,VIEWLIST_MENU_VERTICAL_SIZE); 
	Mmi_set_area_attr(&sat_setup_menuArea,0,0,SCREEN_SIZE_X,Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top());
	Mmi_set_area_attr(&sat_select_menuArea,0,0,SCREEN_SIZE_X,Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top());
	Mmi_set_area_attr(&smscb_M_CBArea,0,0,SCREEN_SIZE_X,Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top());
	Mmi_set_area_attr(&smscb_M_CB_ACTArea,0,0,SCREEN_SIZE_X,VIEWLIST_MENU_VERTICAL_SIZE);//Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top());
	Mmi_set_area_attr(&smscb_M_CB_TOPArea,0,0,SCREEN_SIZE_X,Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top()); 
	//Mmi_set_area_attr(&smscb_M_CB_TOP_CONSArea,0,0,SCREEN_SIZE_X,Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top());
	Mmi_set_area_attr(&smscb_M_CB_TOP_CONSArea,0,0,SCREEN_SIZE_X,VIEWLIST_MENU_VERTICAL_SIZE);
	Mmi_set_area_attr(&smscb_M_CB_TOP_CONS_SELArea,0,0,SCREEN_SIZE_X,Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top());
	Mmi_set_area_attr(&smscb_CBArea,0,0,SCREEN_SIZE_X,Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top()); 
	Mmi_set_area_attr(&smscb_CB_OPTArea,0,0,SCREEN_SIZE_X,VIEWLIST_MENU_VERTICAL_SIZE);//Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top());
	Mmi_set_area_attr(&readSMS_menuArea,0,0,SCREEN_SIZE_X,VIEWLIST_MENU_VERTICAL_SIZE-16);/* 2004/05/26 sunsj modify */
	Mmi_set_area_attr(&readSMS_menuAreaMo,0,0,SCREEN_SIZE_X,VIEWLIST_MENU_VERTICAL_SIZE);/*2003/12/4, wangyan modify*/
	Mmi_set_area_attr(&SmsRead_R_OPTArea,0,0,SCREEN_SIZE_X,VIEWLIST_MENU_VERTICAL_SIZE);//Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top());
	Mmi_set_area_attr(&SmsSend_R_OPTArea,0,0,SCREEN_SIZE_X,VIEWLIST_MENU_VERTICAL_SIZE);//Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top());
	//Mmi_set_area_attr(&melody_menuArea,0,0,SCREEN_SIZE_X,Mmi_layout_line_height()*Mmi_number_of_lines_without_icons_on_top()); 
	Mmi_set_area_attr(&melody_menuArea,0,0,SCREEN_SIZE_X,VIEWLIST_MENU_VERTICAL_SIZE); 
}


void Mmi_set_area_attr(MfwRect* area,U16 px,U16 py,U16 sx,U16 sy)
{
	area->px = px;
	area->py = py;
	area->sx = sx;
	area->sy = sy;
}

/*******************************************************************************

 $Function:    	recources_Init

 $Description:	
 
 $Returns:		window

 $Arguments:	parent window
 
*******************************************************************************/
T_MFW_HND  recources_Init(T_MFW_HND parent_window)
{
  return (recources_create (parent_window));
}

/*******************************************************************************

 $Function:    	recources_Exit

 $Description:	exit network handling (Backward Compatibility interface)
 
 $Returns:		none

 $Arguments:	window
 
*******************************************************************************/
void recources_Exit (T_MFW_HND own_window)
{

    T_MFW_WIN   * win_data = ((T_MFW_HDR *)own_window)->data;
    T_recources * data     = (T_recources *)win_data->user;

  recources_destroy (data->recources_win);
}




/*******************************************************************************

 $Function:    	recources_create

 $Description:	create network top window
 
 $Returns:		window

 $Arguments:	parent_window
 
*******************************************************************************/
T_MFW_HND recources_create (T_MFW_HND parent_window)
{
  T_recources * data = &recources_data;
  T_MFW_WIN   * win;

  TRACE_FUNCTION ("recources_create()");

  data->recources_win = win_create (parent_window, 0, 0, (T_MFW_CB)recources_win_cb);

  if (data->recources_win EQ 0)
    return 0;

  /*
   * Create window handler
   */
  data->mmi_control.dialog = (T_DIALOG_FUNC)recources;
  data->mmi_control.data   = data;
  win                      = ((T_MFW_HDR *)data->recources_win)->data;
  win->user                = (void *) data;

 
  winShow(data->recources_win);
  /*
   * return window handle
   */
  return data->recources_win;
}



/*******************************************************************************

 $Function:    	recources_destroy

 $Description:	
 
 $Returns:		none

 $Arguments:	window
 
*******************************************************************************/
void recources_destroy (T_MFW_HND own_window)
{
  T_MFW_WIN   * win;
  T_recources * data;

  TRACE_FUNCTION ("recources_destroy()");

  if (own_window)
  {
    win  = ((T_MFW_HDR *)own_window)->data;
    data = (T_recources *)win->user;

    if (data)
    {

      /*
       * Delete WIN handler
       */
      win_delete (data->recources_win);
      data->recources_win = 0;
    }
  }
}


/*******************************************************************************

 $Function:    	recources_win_cb

 $Description:	network top window
 
 $Returns:		status int

 $Arguments:	event, window
 
*******************************************************************************/
static int recources_win_cb (T_MFW_EVENT event, T_MFW_WIN * win)
{
  /*
   * Top Window has no output
   */
  return 1;
}





/*******************************************************************************

 $Function:    	recources_language_confirm

 $Description:	
 
 $Returns:		void

 $Arguments:	void
 
*******************************************************************************/
static void recources_language_confirm(void)
{
  T_DISPLAY_DATA display_info;

  TRACE_FUNCTION ("recources_language_confirm()");

  dialog_info_init(&display_info);   
  display_info.TextId2       = TxtDone;  
  display_info.Time         = THREE_SECS;
  display_info.Callback     = (T_VOID_FUNC)recources_dialog_cb;
  display_info.iconindex    =REMIND_COMPLETE;
  /*
   * Call Info Screen
   */
  info_dialog (recources_data.recources_win, &display_info);

}


/*******************************************************************************

 $Function:    	recources_dialog_cb

 $Description:	
 
 $Returns:		void

 $Arguments:	window, identifier, reason
 
*******************************************************************************/
void recources_dialog_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason)
{
	TRACE_FUNCTION ("recources_dialog_cb()");

      switch (reason) 
      {
        case INFO_TIMEOUT:
          /* no break; */
        case INFO_KCD_HUP:
          /* no break; */
        case INFO_KCD_LEFT:
          /* no break; */
        case INFO_KCD_RIGHT:
            recources_Exit(win);
          break;
      }
}



/*******************************************************************************

 $Function:    	recources

 $Description:	
 
 $Returns:		void

 $Arguments:	window, event, value, parameter
 
*******************************************************************************/
void recources (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
{
  T_MFW_WIN         * win_data = ((T_MFW_HDR *) win)->data;
  T_recources       * data     = (T_recources *)win_data->user;

 TRACE_FUNCTION("recources()");

 switch (event)
  {
    case SHOW_CONFIRM:
		recources_language_confirm();
    break;
  }

}

/*******************************************************************************
                                                                              
                                End of File
                                                                              
*******************************************************************************/

⌨️ 快捷键说明

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