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

📄 mmiextras.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 2 页
字号:

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

					CONDAT (UK)

********************************************************************************                                                                              

 This software product is the property of Condat (UK) Ltd and may not be
 disclosed to any third party without the express permission of the owner.                                 
                                                                              
********************************************************************************

 $Project name:	Basic MMI                                                      
 $Project code:	BMI (6349)                                                           
 $Module:		MMI
 $File:		    MmiExtras.c
 $Revision:		1.0                                                       
                                                                              
 $Author:		Condat(UK)                                                         
 $Date:		    25/10/00                                                      
                                                                               
********************************************************************************
                                                                              
 Description:

    MMI extras handling
                        
********************************************************************************
 $History: MmiExtras.c

	25/10/00			Original Condat(UK) BMI version.	
	   
 $End

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




/*******************************************************************************
                                                                              
                                Include Files
                                                                              
*******************************************************************************/
#define ENTITY_MFW

/* includes */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#if defined (NEW_FRAME)

#include "typedefs.h"
#include "vsi.h"
#include "pei.h"
#include "custom.h"
#include "gsm.h"

#else

#include "stddefs.h"
#include "custom.h"
#include "gsm.h"
#include "vsi.h"

#endif
#include "nucleus.h"

#include "mfw_sys.h"


#include "mfw_mfw.h"
#include "mfw_win.h"
#include "mfw_kbd.h"
#include "mfw_tim.h"
#include "mfw_edt.h"
#include "mfw_lng.h"
#include "mfw_icn.h"
#include "mfw_mnu.h"

#include "mfw_sim.h"
#include "mfw_nm.h"
#include "mfw_phb.h"
#include "ksd.h"
#include "psa.h"
#include "mfw_sat.h"
#include "mfw_sms.h"

#include "dspl.h"
#include "MmiBookShared.h"
#include "MmiMmi.h"
// #include "MmiLang.h"
#include "MmiMain.h"
#include "MmiStart.h"
#include "MmiPins.h"

#include "MmiDummy.h"
#include "MmiDialogs.h"
#include "MmiLists.h"


#include "MmiMenu.h"
/* kk 011030 file does not exist #include "MmiExtras.h"*/


static int WinEvent  ( MfwEvt e, MfwWin *w );
static int KeyEvent  ( MfwEvt e, MfwKbd *kc );
static int ConfirmMesgTimerEvent( MfwEvt e, MfwTim *tc );
static int TimerEvent( MfwEvt e, MfwTim *tc );

static void extrasInitGame ( void );


static MfwHnd winExtras;              /* our window handler       */
static MfwHnd kbdExtras;              /* our keyboard handler     */
static MfwHnd timerExtras1;           /* our timer handler        */
static MfwHnd timerExtras2;           /* confirm message timer handler */
static MfwHnd oldFocus;               /* store old focus          */

static int extrasSelection;
static int extrasFlipLevel;
static int extrasC4Level;
static int extrasC4Mode;
static int extrasEntryScreen = EXTRAS_MAIN;

//static MmiState nextState;           /* next state when finished */



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

 $Function:    	extrasInit

 $Description:	init extras handling
 
 $Returns:		None

 $Arguments:	None
 
*******************************************************************************/
void extrasInit ( void )
{
    winExtras 	   = winCreate( NULL, NULL, MfwWinVisible, (MfwCb)WinEvent );
    winShow(winExtras);
    kbdExtras  	   = kbdCreate( winExtras,  KEY_ALL,       (MfwCb)KeyEvent );
    timerExtras1   = timCreate( winExtras,  GAMES_TIMER,   (MfwCb)TimerEvent );
    timerExtras2   = timCreate( winExtras,  CONFIRMATION_TIMER, (MfwCb)ConfirmMesgTimerEvent );

// initialise the games configurables

    extrasSelection = EXTRAS_MIN;
}


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

 $Function:    	extrasExit

 $Description:	exit extras handling
 
 $Returns:		None

 $Arguments:	None
 
*******************************************************************************/
void extrasExit ( void )
{
	kbdDelete( kbdExtras );
	kbdExtras   = 0;

	timStop( timerExtras1 );

    timDelete( timerExtras1 );
    timerExtras1 = 0;

	timStop( timerExtras2 );

    timDelete( timerExtras2 );
    timerExtras2 = 0;


    winDelete( winExtras );
    winExtras   = 0;
}


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

 $Function:    	WinEvent

 $Description:	window event handler
 
 $Returns:		Status int

 $Arguments:	Window handler event, win
 
*******************************************************************************/
static int WinEvent ( MfwEvt e, MfwWin *w )
{
    switch ( e )
    {
        case MfwWinVisible:
            break;

        default:
            return 0;
    }

    return 1;
}


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

 $Function:    	popMenu

 $Description:	Routine to handle reversion to games menu on confirmation
            timeout or 'C' key press.
 
 $Returns:		None

 $Arguments:	None
 
*******************************************************************************/
static void popMenu( void )
{
    menuPop(1);

/* TO BE SORTED OUT !!!!
	showMenuSoftkeys();
END TO BE SORTED OU */
}



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

 $Function:    	keyEvent

 $Description:	keyboard event handler
 
 $Returns:		Status int

 $Arguments:	Window handler event, keyboard control block
 
*******************************************************************************/
static int KeyEvent ( MfwEvt e, MfwKbd *k )
{
	char kp = 0;

	switch( k->code )
	{
	  case KCD_0:
		  kp = '0';
		  break;

  	  case KCD_1:
		  kp = '1';
		  break;

	  case KCD_2:
		  kp = '2';
		  break;

	  case KCD_3:
		  kp = '3';
		  break;

	  case KCD_4:
		  kp = '4';
		  break;

	  case KCD_5:
		  kp = '5';
		  break;

	  case KCD_6:
		  kp = '6';
		  break;

	  case KCD_7:
		  kp = '7';
		  break;

	  case KCD_8:
		  kp = '8';
		  break;

	  case KCD_9:
		  kp = '9';
		  break;

	  case KCD_STAR:
		  kp = '*';
		  break;

	  case KCD_HASH:
		  kp = '#';
		  break;

	  case KCD_LEFT:
		  kp = 'L';
		  break;

	  case KCD_RIGHT:
		  kp = 'R';
		  break;

	  case KCD_HUP:
 		  kp = 'C';
		  break;

	  default:
		  break;
	}

	if( kp != 0 )
	{
		switch ( extrasSelection )
		{
			case EXTRAS_C4 :

				break;

			case EXTRAS_SPS	:

				break;

			case EXTRAS_PIPES :

				break;

			case EXTRAS_FLIP_IT :

				break;

			case EXTRAS_ROLL_EM	:
				break;

			case EXTRAS_LOTTERY	:
				break;

			case EXTRAS_CALCULATOR :
				break;

			case EXTRAS_STOP_WATCH :
				break;

			default:
				break;
		}
	}

    return 1;
}



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

 $Function:    	TimerEvent

 $Description:	All extra menu features general timer handler
 
 $Returns:		Status int

 $Arguments:	Window handler event, timer control block
 
*******************************************************************************/
static int TimerEvent( MfwEvt e, MfwTim *tc )
{
    int end_state;

	switch ( extrasSelection )
	{
		case EXTRAS_C4 :

			break;

		case EXTRAS_SPS	:

			break;

		case EXTRAS_PIPES :

			break;

		case EXTRAS_FLIP_IT :

			break;

		case EXTRAS_ROLL_EM	:
			break;

		case EXTRAS_LOTTERY	:
			break;

		case EXTRAS_CALCULATOR :
			break;

		case EXTRAS_STOP_WATCH :
			break;

		default:
			break;
	}

	if ( end_state != TRUE )
	{
	   timStart( timerExtras1 );
	}

    return 1;
}


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

 $Function:    	ConfirmMesgTimerEvent

 $Description:	General confirmation (timerExtras2) screen handler
 
 $Returns:		Status int

 $Arguments:	Window handler event, timer control block
 
*******************************************************************************/
static int ConfirmMesgTimerEvent( MfwEvt e, MfwTim *tc )
{
	MfwMnu *mnuDetails;

/* TO BE SORTED OUT !!!!
    mnuDetails = (MfwMnu *)mfwControl( getMenuHandler() );

⌨️ 快捷键说明

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