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

📄 mmi.cpp

📁 MTK手机平台的MMI部分的源代码
💻 CPP
📖 第 1 页 / 共 4 页
字号:
	void				*tempKeyBrdMsg;
	MYQUEUE	Message;
	KEYBRD_MESSAGE	*KeyBrdMsg;


	/*----------------------------------------------------------------*/
   /* Code Body                                                      */
   /*----------------------------------------------------------------*/
	/* MessageBeep(0xFFFFFFFF); */
	Message.oslSrcId = 0xFFFF;
	Message.oslDestId = MOD_PRT;
	Message.oslMsgId = WM_KEYUP;
	/* OslFreeDataPtr(Message.oslDataPtr); */
	tempKeyBrdMsg = OslConstructDataPtr(sizeof(KEYBRD_MESSAGE));
	KeyBrdMsg = (KEYBRD_MESSAGE *)tempKeyBrdMsg;
	/* KeyBrdMsg = (KEYBRD_MESSAGE *)OslConstructDataPtr(sizeof(KEYBRD_MESSAGE)); */
	KeyBrdMsg->nKeyCode = wParam;
	Message.oslDataPtr = KeyBrdMsg;

  	DebugInfo("shortcut keyup code              %d \n", KeyBrdMsg->nKeyCode);

   if (writeKeyMsgOnCondition(&Message) != TRUE)
      OslFreeDataPtr(tempKeyBrdMsg);
} /* keyup_by_shortcut */


/*****************************************************************************
* FUNCTION
*  keydown_by_shortcut
* DESCRIPTION
*  function for key down
*
* PARAMETERS
*	hWnd			IN		window handle
*	wParam		IN		wParam
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
*****************************************************************************/
void keydown_by_shortcut(HWND hWnd, int wParam)
{
	/*----------------------------------------------------------------*/
   /* Local Variables                                                */
   /*----------------------------------------------------------------*/
	void				*tempKeyBrdMsg;
	MYQUEUE	Message;
	KEYBRD_MESSAGE	*KeyBrdMsg;


	/*----------------------------------------------------------------*/
   /* Code Body                                                      */
   /*----------------------------------------------------------------*/
	MessageBeep(0xFFFFFFFF);
	Message.oslSrcId = 0xFFFF;
	Message.oslDestId = MOD_PRT;
	Message.oslMsgId = WM_KEYDOWN;
	/* OslFreeDataPtr(Message.oslDataPtr); */
	tempKeyBrdMsg = OslConstructDataPtr(sizeof(KEYBRD_MESSAGE));
	KeyBrdMsg = (KEYBRD_MESSAGE *)tempKeyBrdMsg;
	/* KeyBrdMsg = (KEYBRD_MESSAGE *)OslConstructDataPtr(sizeof(KEYBRD_MESSAGE)); */
	KeyBrdMsg->nKeyCode = wParam;
	Message.oslDataPtr = KeyBrdMsg;

  	DebugInfo("shortcut keydown code %d \n", KeyBrdMsg->nKeyCode);

   if (writeKeyMsgOnCondition(&Message) != TRUE)
      OslFreeDataPtr(tempKeyBrdMsg);
} /* end of keydown_by_shortcut */


/*****************************************************************************
* FUNCTION
*  mouse_move_enable
* DESCRIPTION
*  function for key down (used for the compatibility of MNT_UI)
*
* PARAMETERS
*	hWnd			IN		window handle
*	xPos			IN		X position of the mouse
*	yPos			IN		Y position of the mouse
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
*****************************************************************************/
void mouse_move_enable(HWND hWnd, int xPos, int yPos)
{
	/*----------------------------------------------------------------*/
   /* Local Variables                                                */
   /*----------------------------------------------------------------*/


	/*----------------------------------------------------------------*/
   /* Code Body                                                      */
   /*----------------------------------------------------------------*/
#if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
	TouchScreenSimButtonMove();
#endif /* __MMI_TOUCH_SCREEN__ */
} /* end of mouse_move_enable */


/*****************************************************************************
* FUNCTION
*  key_detect_ind
* DESCRIPTION
*  used for the compatibility of MNT_UI
*
* PARAMETERS
*	key_status	IN		key status
*	key_code		IN		key code
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
*****************************************************************************/
void	key_detect_ind(unsigned char key_status, unsigned char key_code)
{
	/*----------------------------------------------------------------*/
   /* Local Variables                                                */
   /*----------------------------------------------------------------*/


	/*----------------------------------------------------------------*/
   /* Code Body                                                      */
   /*----------------------------------------------------------------*/
} /* end of key_detect_ind */


/*****************************************************************************
* FUNCTION
*  charger_inout
* DESCRIPTION
*  used for the compatibility of MNT_UI
*
* PARAMETERS
*	void
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
*****************************************************************************/
void	charger_inout(void)
{
	/*----------------------------------------------------------------*/
   /* Local Variables                                                */
   /*----------------------------------------------------------------*/


	/*----------------------------------------------------------------*/
   /* Code Body                                                      */
   /*----------------------------------------------------------------*/
	/* used for __CUSTOMER_LEVEL_1_RELEASE__ power on in DLL_UI */
	automatic_power_on();

} /* end of charger_inout */


/*****************************************************************************
* FUNCTION
*  incoming_call
* DESCRIPTION
*  used for the compatibility of MNT_UI
*
* PARAMETERS
*	void
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
*****************************************************************************/
void	incoming_call(void)
{
	/*----------------------------------------------------------------*/
   /* Local Variables                                                */
   /*----------------------------------------------------------------*/


	/*----------------------------------------------------------------*/
   /* Code Body                                                      */
   /*----------------------------------------------------------------*/
} /* end of incoming_call */


/*****************************************************************************
* FUNCTION
*  draw_main_bitmap
* DESCRIPTION
*  draw main bitmap
*
* PARAMETERS
*	hdc			IN    dc handle
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
*****************************************************************************/
void draw_main_bitmap(HDC hdc)
{
	/*----------------------------------------------------------------*/
   /* Local Variables                                                */
   /*----------------------------------------------------------------*/


	/*----------------------------------------------------------------*/
   /* Code Body                                                      */
   /*----------------------------------------------------------------*/
	FeedBackFeelingKeyAction(-1);
} /* end of draw_main_bitmap */


/*****************************************************************************
* FUNCTION
*  launch_nw_simulator
* DESCRIPTION
*  launch the network simulator
*
* PARAMETERS
*	void
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
*****************************************************************************/
void launch_nw_simulator(void)
{
	/*----------------------------------------------------------------*/
   /* Local Variables                                                */
   /*----------------------------------------------------------------*/


	/*----------------------------------------------------------------*/
   /* Code Body                                                      */
   /*----------------------------------------------------------------*/
#ifndef __CUSTOMER_LEVEL_1_RELEASE__

	if (bFlagNWSimulatorStart)
	{
		NWSimEngine.ShowSimulator();
	}
	else
	{
		bFlagNWSimulatorStart = TRUE;
		NWSimEngine.SetReadQueueHandler(OslReceiveMsgExtQ);
		NWSimEngine.SetWriteQueueHandler(OslMsgSendExtQueue);
      /* task_info_g1[10] is NW-simulator queue
         task_info_g1[11] is MMI queue.          */
		NWSimEngine.SetReadQueueHandle(task_info_g1[10].task_ext_qid);
		NWSimEngine.SetWriteQueueHandle(task_info_g1[MOD_PRT].task_ext_qid);
		NWSimEngine.InitSimulator();
	}

#endif /* __CUSTOMER_LEVEL_1_RELEASE__ */
} /* end of launch_nw_simulator */


/*****************************************************************************
* FUNCTION
*  shutdown_system_operation
* DESCRIPTION
*  shutdown system operation
*
* PARAMETERS
*	void
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
*****************************************************************************/
void shutdown_system_operation(void)
{
	/*----------------------------------------------------------------*/
   /* Local Variables                                                */
   /*----------------------------------------------------------------*/


	/*----------------------------------------------------------------*/
   /* Code Body                                                      */
   /*----------------------------------------------------------------*/
#ifdef USING_DLL_UI
	ShutdownSystemOperation();
#ifndef __CUSTOMER_LEVEL_1_RELEASE__
   if (bFlagNWSimulatorStart == TRUE)
		NWSimEngine.SendShutDownMsg();
#endif
#endif
} /* end of shutdown_system_operation */


/*****************************************************************************
* FUNCTION
*  on_timer
* DESCRIPTION
*  Message handler for WM_TIMER
*
* PARAMETERS
*	id				IN			id
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
*****************************************************************************/
void	on_timer(unsigned int id)
{
	/*----------------------------------------------------------------*/
   /* Local Variables                                                */
   /*----------------------------------------------------------------*/
  	MYQUEUE	Message;
    void *temp;
    TIMER_MESSAGE	*timerMsg;


	/*----------------------------------------------------------------*/
   /* Code Body                                                      */
   /*----------------------------------------------------------------*/
 	Message.oslSrcId = 0xFFFF;
	Message.oslDestId = MOD_PRT;
	Message.oslMsgId = PRT_MMI_TIMER_IND;
	temp = OslConstructDataPtr(sizeof(TIMER_MESSAGE));
    timerMsg =(TIMER_MESSAGE *)temp;
	timerMsg->id = id;
	Message.oslDataPtr = timerMsg;

 	OslMsgSendExtQueue(&Message);
} /* end of on_timer */


/*****************************************************************************
* FUNCTION
*  automatic_power_on
* DESCRIPTION
*  power on the phone automatically
*
* PARAMETERS
*	void
* RETURNS
*  void
* GLOBALS AFFECTED
*  void
*****************************************************************************/
void automatic_power_on(void)
{
	/*----------------------------------------------------------------*/
   /* Local Variables                                                */
   /*----------------------------------------------------------------*/


	/*----------------------------------------------------------------*/
   /* Code Body                                                      */
   /*----------------------------------------------------------------*/
#if defined(__CUSTOMER_LEVEL_1_RELEASE__)
	if(is_first_bootup)
	{
		SetTimer(0, 0, 1000, AutomaticBoopup);
		is_first_bootup = FALSE;
	}
#endif
} /* end of automatic_power_on */


static int keyDownUpCount = 0;
/* for debugging */
static int  keyNumSkipped = 0;


/*****************************************************************************
* FUNCTION
*  writeKeyMsgOnCondition
* DESCRIPTION
*  If message queue is not too crowed, write key message. Also onsider key up pairing.
*
* PARAMETERS
*	void
* RETURNS
*  wrote to queue or not
*  
* GLOBALS AFFECTED
*  void
*****************************************************************************/
BOOL writeKeyMsgOnCondition(MYQUEUE *Message)
{
	/*----------------------------------------------------------------*/
   /* Local Variables                                                */
   /*----------------------------------------------------------------*/
   BOOL        toSend = TRUE;
   U16         num;

	/*----------------------------------------------------------------*/
   /* Code Body                                                      */
   /*----------------------------------------------------------------*/

   /* check sending critera */
   num = OslNumOfQMsgs();
   // work around by decreasing key message number in queue
   if ((num < (MAX_PRT_NODES/4.0)) ||
      ((keyDownUpCount < 0) && ((Message->oslMsgId == WM_KEYUP) || (Message->oslMsgId == WM_LBUTTONUP))))
   {
      toSend = TRUE;
   }
   else
   {
      toSend = FALSE;
   }

   /* send the msg */
   if (toSend == TRUE)
   {
      if ((Message->oslMsgId != WM_KEYUP) && (Message->oslMsgId != WM_LBUTTONUP))
         keyDownUpCount ++;
      else
         keyDownUpCount --;

      OslMsgSendExtQueue(Message);
      return TRUE;
   }
   else
   {
  	  DebugInfo("writeKeyMsgOnCondition return FALSE.  num %d \n", num);

      keyNumSkipped ++;
      return FALSE;
   }
}
#endif /* MMI_ON_WIN32 */
#endif /* _MMI_CPP */

⌨️ 快捷键说明

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