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

📄 mmiidle.c

📁 GSM手机设计软件代码
💻 C
📖 第 1 页 / 共 5 页
字号:
	txtFormat = 0;	
	switch (dataId)
	{
		case IDLE_NETWORK_NAME:
			if (idle_data.idleNetLogo == NULL)
				yPos = Mmi_layout_line_height()*4;
			else
				yPos = yPos + Mmi_layout_line_height()*3;
			break;

		case IDLE_CHARGING_MODE:
			yPos = yPos + Mmi_layout_line_height()*4;
			break;
						
		case IDLE_CALL_SMS_INFO:
			yPos = yPos + Mmi_layout_line_height()*5;
			break;
			
		case IDLE_CLOCK_STR:
            /* Marcus: Issue 1614: 23/01/2003: Start */
#ifdef NEW_EDITOR
			if (idle_data.editor == NULL)
#else
			if (idle_data.edt == NULL)
#endif
            /* Marcus: Issue 1614: 23/01/2003: End */
			{
    			xPos = 10;
    			yPos = yPos + Mmi_layout_line_height();
			}
			else
			{
				noRoom = 1;				
			}
			break;
		case IDLE_DATE_STR:
            /* Marcus: Issue 1614: 23/01/2003: Start */
#ifdef NEW_EDITOR
			if (idle_data.editor == NULL)
#else
			if (idle_data.edt == NULL)
#endif
			{
    			xPos = SCREEN_SIZE_X - txtWidth - 10;
    			yPos = yPos + Mmi_layout_line_height();
			}
			else
			{
				noRoom = 1;				
			}
            /* Marcus: Issue 1614: 23/01/2003: End */
			break;
		case IDLE_LOCKED_ECC:
			xPos = 10;
			yPos = yPos + Mmi_layout_line_height()*4;			
			dspl_Clear(xPos,yPos,mmiScrX,mmiScrY);
			dspl_Clear(xPos,yPos+ Mmi_layout_line_height()*5,mmiScrX,mmiScrY);
			break;
		case IDLE_LOCKED:
			xPos = 10;
			yPos = yPos + Mmi_layout_line_height()*4;
			break;
		case IDLE_MENU_PRESS:
			xPos = 10;
			yPos = yPos + Mmi_layout_line_height()*5;
			break;
			
		default:
			break;

	}
#endif

	if (!noRoom)
	{
		//GW 28/11/02 - Only display a non-null string

		/*MC SPR 1526, using dspl_TextOut rather than dspl_ScrText*/
		if (txtStr != NULL)
			dspl_TextOut(xPos,				yPos,	0, txtStr);
		if (lenSpace!= NULL)
			dspl_TextOut(xPos+lenStr,		yPos,	0, txtSpace);
		dspl_TextOut(xPos+lenStr+lenSpace,yPos,	0, idStr);
	}
}

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

 $Function:    	

 $Description:	Returns a pixel position for a line number on the idle screen
 
 $Returns:		y pixel position for the line

 $Arguments:	lineNo - line number
 				
 $History
  GW 09/10/02 - Created

*******************************************************************************/
static int idleLine( int lineNo )
{
	int yPos;
#ifndef LSCREEN
	return (Mmi_layout_line_icons(lineNo));
#else
	return (Mmi_layout_line(lineNo)*3/2+Mmi_layout_IconHeight());
#endif
}

/*SPR 1725, removed getClockString() and getDateString() functions*/

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

 $Function:    	

 $Description:	 
 
 $Returns:		

 $Arguments:	
 				
 $History
  GW 09/10/02 - Created

*******************************************************************************/
void idle_draw_main_idle( void )
{
T_CURRENT_NETWORK current_network;
char text[20];
int txtStrId;	//Id of text string to be displayed
int txtNo;		//Numeric value to be displayed (0=no value)
int xOfs;		//used to offset text id when a number is to be displayed 
int lenStr, txtFormat;
static int nTimes=0;
int oldborderSize;

		TRACE_FUNCTION("idle_draw_main_idle()");

		/* If we have not finished animation, do not draw any of the idle screen */
		if (mmiStart_animationComplete()!=TRUE)
			return;

TRACE_FUNCTION("idle_draw_main_idle");

		resources_setColour( COLOUR_IDLE );
		dspl_ClearAll();
		idle_initDisplayData();		

	    if (idle_data.starting_up) /*SPR#1662 - NH Show please wait since the phone is not ready yet*/
	    {
			idle_displayData(IDLE_NETWORK_NAME,TxtPleaseWait,NULL);
	        return;
	    }

	    /* GW SPR#1721 - Add a border round all the text on the idle screen */
#ifdef COLOURDISPLAY			
		oldborderSize = dspl_setBorderWidth(1);
#endif
		if (dspl_GetFgdColour()==dspl_GetBorderColour())
		{
			//Get a colour that contrasts with the foreground colour
			dspl_SetBorderColour(dspl_GetContrastColour(dspl_GetFgdColour()));
			//If this is the same as the background colour... too bad
		}

		if(idle_data.idleBgd != NULL)
			dspl_BitBlt2(idle_data.idleBgd->area.px,idle_data.idleBgd->area.py,idle_data.idleBgd->area.sx,idle_data.idleBgd->area.sy,(void *)idle_data.idleBgd->icons,0,idle_data.idleBgd->icnType);
		

		if (idle_data.nm_status == NETWORK_FULL_SERVICE)
		{
			network_get_name (&current_network);
#ifdef COLOURDISPLAY			
			idle_data.idleNetLogo = icon_getNetworkIcon(current_network.network_name);		
#else
			idle_data.idleNetLogo = NULL;		
#endif
		}
		else
			idle_data.idleNetLogo = NULL;		

//The animation complete will provide a better 

		if (idle_data.idleNetLogo)
		{
			int xOfs,yOfs;
			T_BITMAP* icn=idle_data.idleNetLogo;
			
			if (icn->area.sy < SCREEN_SIZE_Y - Mmi_layout_IconHeight())
			{
				yOfs = Mmi_layout_IconHeight();	
				if (icn->area.sy + yOfs < idle_data.defTextOffset)
					yOfs = yOfs + (idle_data.defTextOffset - icn->area.sy)/2;
			}
			else
				yOfs = 0;
			
			if (icn->area.sx < SCREEN_SIZE_X)
				xOfs = (SCREEN_SIZE_X - icn->area.sx)/2;
			else
				xOfs = 0;
#ifdef COLOURDISPLAY			
	        dspl_BitBlt2(xOfs,yOfs,icn->area.sx,icn->area.sy,icn->icons,0,icn->icnType);
#endif
		}

		if (smsidle_get_unread_sms_available())
			iconsSetState(iconIdSMS);/* Indicate SMS delivery to MS-User. */
		else
			iconsDeleteState(iconIdSMS);


		/*
		DISPLAY ZONE 1
		*/
		GlobalIconStatus = GlobalSignalIconFlag | GlobalBatteryIconFlag
						| GlobalSMSIconFlag| GlobalVoiceMailIconFlag
						| GlobalCallForwardingIconFlag| GlobalKeyplockIconFlag
						| GlobalRingerIconFlag | GlobalRingVibrIconFlag
						| GlobalVibratorIconFlag | GlobalAlarmIconFlag
						| GlobalSilentRingerIconFlag|GlobalCipheringActivIconFlag
						| GlobalCipheringDeactivIconFlag
		/* SH 18/01/02. Flag for GPRS On icon. */
#ifdef MMI_GPRS_ENABLED
						| GlobalGPRSOnIconFlag
#endif
		/* SPR759 - SH - Flag for Homezone icon */
#ifdef MMI_HOMEZONE_ENABLED
						| GlobalHomezoneIconFlag
#endif
		/* SPR#1352 - SH - Flag for TTY icon */
#ifdef MMI_TTY_ENABLED
						| GlobalTTYIconFlag
#endif
		/* SH end */
						;
		iconsShow();

		/*
		DISPLAY ZONE 2
		*/
		switch (idle_data.nm_status)
		{
			case NETWORK_FULL_SERVICE :
				if (globalMobileMode == (GlobalMobileOn|GlobalCharging))
				{
					if(globalBatteryMode == GlobalBatteryFull) 
					{
						idle_displayData(IDLE_CHARGING_MODE,TxtChargComplete,NULL);

					}
					else
					{
						idle_displayData(IDLE_CHARGING_MODE,TxtCharging,NULL);
					}
					break;
				}
				else
				{
					if (DivertStatus == MFW_CFLAG_SET)
					{
						idle_displayData(IDLE_CHARGING_MODE,TxtCallDivert,NULL);
					}
				}
				/*NM p032
				set the flag when the TEST SIM is inserted*/
				if (!strcmp((char *)current_network.network_name,"00101"))
				{
					test_sim = TRUE;
				}
				else
				{
					test_sim = FALSE;
				}
				/*p032 end */
                /* Marcus: Issue 1618: 24/01/2003: Start *
				 *
				 * If we have a service provider name, show that,
				 * else show the PLMN name
				 */
                		if (strlen((char *)current_network.service_provider_name))
    					idle_displayData(IDLE_NETWORK_NAME,TxtNull,(char*)current_network.service_provider_name);
                		else
    					idle_displayData(IDLE_NETWORK_NAME,TxtNull,(char*)current_network.plmn_name);
                /* Marcus: Issue 1618: 24/01/2003: End */
				break;
				
			case NETWORK_SEARCH_NETWORK :
				idle_displayData(IDLE_NETWORK_NAME,TxtSearching,NULL);
				break;
			case NETWORK_NO_SERVICE :
				if (sim_status_check() == SIM_NOT_ACTIVE)
					idle_displayData(IDLE_NETWORK_NAME,TxtNoCard,NULL);
				else
					idle_displayData(IDLE_NETWORK_NAME,TxtNoNetwork,NULL);
				break;
			case NETWORK_NO_PLMN_XXX_AVAIL:
				if (sim_status_check() == SIM_NOT_ACTIVE)
					idle_displayData(IDLE_NETWORK_NAME,TxtNoCard,NULL);
				else
					idle_displayData(IDLE_NETWORK_NAME,TxtNoNetwork,NULL);
			default:
				idle_displayData(IDLE_NETWORK_NAME,TxtNoNetwork,NULL);
				break;
		}

		/*
		DISPLAY ZONE 3
		*/

		TRACE_EVENT("DISPLAY ZONE 3");
		txtStrId = TxtNull;
		txtNo= 0;
		xOfs= 0;
		if (!idle_data.clean_screen) //for clean the DISPLAY ZONE 3
		//dont show the following information when the user pressed 
		// the HUP key once in the idle screen
		{
			TRACE_EVENT("Not clean screen");
			idle_data.new_sms = FALSE;
		/*
		** NDH : 15/05/2003 : Change the priority for the idle display, such that
		** CB, SAT Idle Display Text or Class 0 SMS are displayed with
		** the highest priority
		*/
		/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
			/* Normal incoming cell broadcast */
			if (idle_data.new_cbch)
			{
				if (idle_data.editor)
				{
					ATB_edit_Hide(idle_data.editor);
				}

				/* SPR759 - SH. Hide SAT idle mode text if present */
				if (idle_data.editor_sat)
				{
					ATB_edit_Hide(idle_data.editor_sat);
				}
				txtStrId = TxtNewCbMessage;
				TRACE_EVENT("new_cbch");
			}

			/* SPR759 - SH - Display SAT idle mode text */
			else if (idle_data.editor_sat)
			{
				ATB_edit_Unhide(idle_data.editor_sat);
				ATB_edit_Show(idle_data.editor_sat);
				TRACE_EVENT("editor_sat");
			}

			/* Dialling editor, Immediate incoming cell broadcast */
			else if (idle_data.editor)
			{
				TRACE_EVENT("*** Displaying number editor *");
				ATB_edit_Unhide(idle_data.editor);
				ATB_edit_Show(idle_data.editor);
			}
#else /* NEW_EDITOR */
			/* Normal incoming cell broadcast */
			if (idle_data.new_cbch)
			{
				if (idle_data.edt)
				{
					edtHide(idle_data.edt);
				}

				/* SPR759 - SH. Hide SAT idle mode text if present */
				if (idle_data.edt_sat)
				{
					edtHide(idle_data.edt_sat);
				}
				txtStrId = TxtNewCbMessage;
			}

			/* SPR759 - SH - Display SAT idle mode text */
			else if (idle_data.edt_sat)
			{
				edtUnhide(idle_data.edt_sat);
				edtShow(idle_data.edt_sat);
			}

			/* Immediate incoming cell broadcast */
			else if (idle_data.edt)
			{
				edtUnhide(idle_data.edt);
				edtShow(idle_data.edt);
			}
#endif /* NEW_EDITOR */
			else if (idle_data.missedCalls)
			{
				txtNo = idle_data.missedCalls;
				if(txtNo <= 1)
				{
					txtStrId = TxtMissedCall;
				}
				else
				{
					txtStrId = TxtMissedCalls;
				}
			TRACE_EVENT("missed calls");
			}
			else if (sms_message_count(MFW_SMS_UNREAD) > 0 )
			{
				txtStrId = smsidle_display_sms_status(&txtNo );
				idle_data.new_sms = TRUE;
			}
			else if(FFS_flashData.settings_status & SettingsSilentMode)
			{
				txtStrId = TxtSilentMode;
				TRACE_EVENT("Silent mode");
			}
			/* Marcus: Issue 1604: 23/01/2003: Start */
			else if (smsidle_get_ready_state() && smsidle_get_memory_full())
			{
			    TRACE_EVENT("No unread SMS, but list is full");
			    txtStrId = TxtSmsListFull;
			}
			/* Marcus: Issue 1604: 23/01/2003: End */
            else
			{
				TRACE_EVENT("None of the above!");
			}
		}
		else //(!idle_data.clean_screen)
		{
		TRACE_EVENT("Clean screen");
		/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
			//this is for the immediate incoming cell broadcast
			if (idle_data.editor)
			{
				ATB_edit_Unhide(idle_data.editor);
				ATB_edit_Show(idle_data.editor);
			}
#else /* NEW_EDITOR */
			//this is for the immediate incoming cell broadcast
			if (idle_data.edt)
			{
				edtUnhide(idle_data.edt);
				edtShow(idle_data.edt);
			}
#endif /* NEW_EDITOR */

			//20/4/01 MZ check for silent_mode status.
			else if(FFS_flashData.settings_status & SettingsSilentMode)
			{
				txtStrId = TxtSilentMode;
			}
			else
			{
				TRACE_EVENT("None of the above 2");
			}
		}
		//If data has been set up, then show it
		if (txtStrId != TxtNull)
		{
			if (txtNo != 0)
			{
				sprintf((char*)text,"%d",txtNo);
				idle_displayData(IDLE_CALL_SMS_INFO,txtStrId,text);
			}
			else
				idle_displayData(IDLE_CALL_SMS_INFO,txtStrId,NULL);
		}

		idle_displayData(IDLE_CLOCK_STR,	TxtNull, mfw_td_get_clock_str());/*SPR 1725*/
		idle_displayData(IDLE_DATE_STR,		TxtNull, mfw_td_get_date_str()); /*SPR 1725*///Only displayed on D-sample

		/*
		DISPLAY ZONE 4
		*/

		TRACE_EVENT("DISPLAY ZONE 4");
		resources_setSKColour( COLOUR_IDLE );

	    /* GW SPR#1721 - Changed from a case statement so we restore colour/border info   */		
		if ((idle_data.search) && ((idle_data.nm_status==NETWORK_NO_SERVICE) ||
								(idle_data.nm_status==NETWORK_NO_PLMN_XXX_AVAIL)))
		{
			TRACE_EVENT("idle_win_cb()-no network yet");
			softKeys_displayId(TxtSearchName,TxtNull,0,COLOUR_IDLE);
		}
		else if ( smsidle_get_unread_sms_available() 
			&& (!idle_data.clean_screen)
			&& idle_data.new_sms )
		{
			TRACE_EVENT("idle_win_cb()-unread SMS");
			softKeys_displayId(TxtRead,TxtSoftMenu,0,COLOUR_IDLE);
		}
		else if ((!idle_data.clean_screen) && idle_data.new_cbch)
		{
			TRACE_EVENT("idle_win_cb()-new CBCH");
			softKeys_displayId(TxtRead,TxtSoftMenu,0,COLOUR_IDLE);
		}
		else if (idle_data.missedCalls > 0)
		{
			TRACE_EVENT("idle_win_cb()-missed calls");
			softKeys_displayId(TxtRead,TxtSoftMenu,0,COLOUR_IDLE);
		}
		else
		{
			TRACE_EVENT("idle_win_cb()-phonebook");
			softKeys_displayId(TxtNames,TxtSoftMenu,0,COLOUR_IDLE);
		}
		resources_restoreMnuColour();//required only if other menu items are to be drawn afterwards

		resources_restoreColour();

#ifdef COLOURDISPLAY			
		dspl_setBorderWidth(oldborderSize);
#endif

		//Debug - output how much memory is left.
		mfwCheckMemoryLeft();
		
	TRACE_FUNCTION("end of idle_draw_main_idle()");

⌨️ 快捷键说明

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