海思c++架构

class CSyApplication:public CSyObject
{

public:
// 输出组合
enum DispAttachModeE{
DISP_SEPARATE_CVBS_VGA = 0,
DISP_ATTACH_CVBS_TO_VGA,
DISP_SEPARATE_CVBS_HDMI,
DISP_ATTACH_CVBS_TO_HDMI,
};
public:
CSyApplication();
virtual ~CSyApplication();
static CSyApplication * getInstance();
static CSyContext * getInstanceContext();
#ifdef SY_PLAYER_SUPPORT
static CSyPlayerCtx * getInstancePlayerCtx();
#endif
CSyContext * getContext();
CSyApplication::DispAttachModeE getDispAttachMode();
void setDispAttachMode(CSyApplication::DispAttachModeE enDispAttachMode);


#ifdef SY_VIEW_SUPPORT
CSyViewCtx * getTvViewCtx();
CSyViewCtx * getUiViewCtx();
#endif



INT32 initDevice();
void synchronizeTimeEventStart();
void synchronizeTimeEventEnd();
INT32 run();
void parseAppStop();
void exitProcess();
private:
INT32 createInstances();
INT32 deleteInstances();
#ifdef SY_VIEW_SUPPORT
INT32 createViewInstances();
INT32 deleteViewInstances();
#endif

#ifdef SY_PLAYER_SUPPORT
INT32 runPlayerInit();
INT32 runPlayerDeinit();
#endif

private:
// 应用Context
CSyContext * m_lpclContext;


CSyInputDevMgr * m_lpclInputDevMgr;




// 视图Context
#ifdef SY_VIEW_SUPPORT
// TV 
CSyViewCtx * m_lpclTvViewCtx;
// UI
CSyViewCtx * m_lpclUiViewCtx;
#endif




#ifdef SY_PLAYER_SUPPORT
// 播放器CTX
CSyPlayerCtx * m_lpclPlayerCtx;
#endif


// 绑定模式
CSyApplication::DispAttachModeE m_enDispAttachMode;

// 唯一应用实例
static CSyApplication * m_lpclApplication;

};


CSyApplication * CSyApplication::m_lpclApplication = NULL; 


/*****************************
构造
******************************/
CSyApplication::CSyApplication(){
// 运行程序
syDbgMsg("<CSyApplication> CREATE.\n");
 
// context
m_lpclContext = new CSyContext();
// 指定app应用
m_lpclContext->setApplication(this);


#ifdef SY_VIEW_SUPPORT
m_lpclTvViewCtx = new CSyViewCtx();
m_lpclTvViewCtx->setAppCtx(m_lpclContext);
m_lpclUiViewCtx = new CSyViewCtx();
m_lpclUiViewCtx->setAppCtx(m_lpclContext);
#endif









#ifdef SY_PLAYER_SUPPORT
m_lpclPlayerCtx = NULL;
#endif


// 绑定
m_enDispAttachMode = CSyApplication::DISP_SEPARATE_CVBS_VGA;

// 唯一实例
m_lpclApplication = this;
}


/*****************************
析构
******************************/
CSyApplication::~CSyApplication(){
// 停止
parseAppStop();

}


/*****************************
获得唯一实例
******************************/
CSyApplication * CSyApplication::getInstance(){
return m_lpclApplication;
}
/*****************************
获得唯一实例context
******************************/
CSyContext * CSyApplication::getInstanceContext(){
if(NULL != m_lpclApplication){
return m_lpclApplication->m_lpclContext;
}
return NULL;
}
#ifdef SY_PLAYER_SUPPORT
/*****************************
获得唯一实例播放器context
******************************/
CSyPlayerCtx * CSyApplication::getInstancePlayerCtx(){
if(NULL != m_lpclApplication){
return m_lpclApplication->m_lpclPlayerCtx;
}
return NULL;
}
#endif
/*****************************
获得context
******************************/
CSyContext * CSyApplication::getContext(){
return m_lpclContext;
}
/*****************************
获得绑定输出
******************************/
CSyApplication::DispAttachModeE CSyApplication::getDispAttachMode(){
return m_enDispAttachMode;
}
/*****************************
设置绑定输出
******************************/
void CSyApplication::setDispAttachMode(CSyApplication::DispAttachModeE enDispAttachMode){
m_enDispAttachMode = enDispAttachMode;
}




#ifdef SY_VIEW_SUPPORT


/*****************************
创建实例
******************************/
INT32 CSyApplication::createViewInstances(){


// 皮肤
#ifdef SY_SKIN_SUPPORT
if(NULL != m_lpclContext){
CSySkin * lpclSkin = m_lpclContext->getSkin();
if(NULL != lpclSkin){
lpclSkin->createAllBuildPara();
}
}
#endif

// TV 视图
if(NULL != m_lpclTvViewCtx){
#ifdef SY_DISPLAY_SUPPORT
m_lpclTvViewCtx->setDisplay(new CSyDisplay(m_lpclTvViewCtx, CSyDisplay::OUTPUT_DEV_TYPE_TV, CSyDisplay::OUTPUT_CHAN_CVBS));
#endif
#ifdef SY_VIEW_DLG_SUPPORT
{
CPosTvViewDlgMgr * lpclTvDlgMgr = new CPosTvViewDlgMgr(m_lpclTvViewCtx);
lpclTvDlgMgr->init();
m_lpclTvViewCtx->setViewDlgMgr(lpclTvDlgMgr);
}
#endif

}
// UI视图
if(NULL != m_lpclUiViewCtx){
#ifdef SY_DISPLAY_SUPPORT
// 输出频道
switch(getDispAttachMode()){
case(CSyApplication::DISP_SEPARATE_CVBS_VGA):
case(CSyApplication::DISP_ATTACH_CVBS_TO_VGA):{
m_lpclUiViewCtx->setDisplay(new CSyDisplay(m_lpclUiViewCtx, CSyDisplay::OUTPUT_DEV_TYPE_UI, CSyDisplay::OUTPUT_CHAN_VGA));
break;
}
case(CSyApplication::DISP_SEPARATE_CVBS_HDMI):
case(CSyApplication::DISP_ATTACH_CVBS_TO_HDMI):
default:{
m_lpclUiViewCtx->setDisplay(new CSyDisplay(m_lpclUiViewCtx, CSyDisplay::OUTPUT_DEV_TYPE_UI, CSyDisplay::OUTPUT_CHAN_HDMI));
break;
}
}
#endif
#ifdef SY_VIEW_DLG_SUPPORT
{
CPosUiViewDlgMgr * lpclUiDlgMgr = new CPosUiViewDlgMgr(m_lpclUiViewCtx);
lpclUiDlgMgr->init();
// 创建页面实例
lpclUiDlgMgr->createDlgInstances();
m_lpclUiViewCtx->setViewDlgMgr(lpclUiDlgMgr);
}
#endif

}


return SY_OK;
}
/*****************************
释放实例
******************************/
INT32 CSyApplication::deleteViewInstances(){
// TV视图
if(NULL != m_lpclTvViewCtx){
#ifdef SY_VIEW_DLG_SUPPORT
{
CSyViewDlgMgr * lpclViewDlgMgr = m_lpclTvViewCtx->getViewDlgMgr();
if(NULL != lpclViewDlgMgr){
delete(lpclViewDlgMgr);
m_lpclTvViewCtx->setViewDlgMgr(NULL);
}
}
#endif
#ifdef SY_DISPLAY_SUPPORT
{
CSyDisplay * lpclDisplay = m_lpclTvViewCtx->getDisplay();
if(NULL != lpclDisplay){
delete(lpclDisplay);
m_lpclTvViewCtx->setDisplay(NULL);
}
}
#endif


}


// UI视图
if(NULL != m_lpclUiViewCtx){
#ifdef SY_VIEW_DLG_SUPPORT
{
CSyViewDlgMgr * lpclViewDlgMgr = m_lpclUiViewCtx->getViewDlgMgr();
if(NULL != lpclViewDlgMgr){
delete(lpclViewDlgMgr);
m_lpclUiViewCtx->setViewDlgMgr(NULL);
}
}
#endif
#ifdef SY_DISPLAY_SUPPORT
{
CSyDisplay * lpclDisplay = m_lpclUiViewCtx->getDisplay();
if(NULL != lpclDisplay){
delete(lpclDisplay);
m_lpclUiViewCtx->setDisplay(NULL);
}
}
#endif
}






return SY_OK;
}


/*****************************
获得
******************************/
CSyViewCtx * CSyApplication::getTvViewCtx(){
return m_lpclTvViewCtx;
}
/*****************************
获得
******************************/
CSyViewCtx * CSyApplication::getUiViewCtx(){
return m_lpclUiViewCtx;
}
#endif












/*****************************
创建实例
******************************/
INT32 CSyApplication::createInstances(){
if(NULL != m_lpclContext){
// 播放器PLAYER
#ifdef SY_PLAYER_SUPPORT
CSyPlayerCommClient * lpclPlayerCommClient = new CSyPlayerCommClient(m_lpclContext);
m_lpclContext->setPlayerCommClient(lpclPlayerCommClient);
#endif
// 磁盘
#ifdef SY_DISK_SUPPORT
m_lpclContext->setDisk(new CSyDisk(m_lpclContext));
#endif
// TIMER
#ifdef SY_TIMER_SUPPORT
m_lpclContext->setTimer(new CSyTimer(m_lpclContext));
#endif
// 语言
#ifdef SY_LANG_RES_SUPPORT
{
CSyLangRes * lpclLangRes = new CSyLangRes(m_lpclContext);
lpclLangRes->init();
m_lpclContext->setLangRes(lpclLangRes);
}
#endif
// 图片资源
#ifdef SY_IMG_RES_SUPPORT
m_lpclContext->setImgRes(new CSyImgRes(m_lpclContext));
#endif




// 读写
#ifdef SY_REQ_RT_SUPPORT
{
CSyReqRT * lpclReqRT = new CSyReqRT(m_lpclContext);
lpclReqRT->init();
m_lpclContext->setReqRT(lpclReqRT);
}
#endif


// IR
#ifdef SY_IR_SUPPORT
m_lpclContext->setIR(new CSyIR(m_lpclContext));
#endif
#if 0
// MOUSE
#ifdef SY_MOUSE_SUPPORT
m_lpclContext->setMouse(new CSyMouse(m_lpclContext));
#endif
//Keyboard
#ifdef SY_KEYBOARD_SUPPORT
m_lpclContext->setKeyboard(new CSyKeyboard(m_lpclContext));
#endif


#ifdef SY_UART_TOUCH_SUPPORT
m_lpclContext->setUartTouch(new CSyUartTouch(m_lpclContext));
#endif
#endif
#ifdef SY_FONT_MGR_SUPPORT
m_lpclContext->setFontMgr(new CSyFontMgr(m_lpclContext));
#endif
// 皮肤
#ifdef SY_SKIN_SUPPORT
m_lpclContext->setSkin(new CSySkin(m_lpclContext));
#endif


#ifdef ST_HANDWRITING_SUPPORT
m_lpclContext->setHandwritingCommunicateClient(new CSyHandwritingCommunicateClient());
#endif




}



return SY_OK;
}


/*****************************
删除实例
******************************/
INT32 CSyApplication::deleteInstances(){
if(NULL != m_lpclContext){
// 播放器
#ifdef SY_PLAYER_SUPPORT
{
CSyPlayerCommClient * lpclPlayerCommClient = m_lpclContext->getPlayerCommClient();
if(NULL != lpclPlayerCommClient){
delete(lpclPlayerCommClient);
m_lpclContext->setPlayerCommClient(NULL);
}
}
#endif





// 磁盘
#ifdef SY_DISK_SUPPORT
{
CSyDisk * lpclDisk = m_lpclContext->getDisk();
if(lpclDisk != NULL){
delete(lpclDisk);
m_lpclContext->setDisk(NULL);
}
}
#endif


// 读写
#ifdef SY_REQ_RT_SUPPORT
{
CSyReqRT * lpclReqRT = m_lpclContext->getReqRT();
if(lpclReqRT != NULL){
delete(lpclReqRT);
m_lpclContext->setReqRT(NULL);
}
}
#endif


#ifdef SY_IR_SUPPORT
{
CSyIR * lpclIR = m_lpclContext->getIR();
if(NULL != lpclIR){
delete(lpclIR);
m_lpclContext->setIR(NULL);
}
}
#endif
#if 0
// MOUSE
#ifdef SY_MOUSE_SUPPORT
{
CSyMouse * lpclMouse = m_lpclContext->getMouse();
if(lpclMouse != NULL){
delete(lpclMouse);
m_lpclContext->setMouse(NULL);
}
}
#endif
//Keyboard
#ifdef SY_MOUSE_SUPPORT
{
CSyKeyboard* lpclKeyboard = m_lpclContext->getKeyboard();
if(lpclKeyboard != NULL){
delete(lpclKeyboard);
m_lpclContext->setKeyboard(NULL);
}
}
#endif
// UART TOUCH
#ifdef SY_UART_TOUCH_SUPPORT
{
CSyUartTouch * lpclUartTouch = m_lpclContext->getUartTouch();
if(lpclUartTouch != NULL){
delete(lpclUartTouch);
m_lpclContext->setUartTouch(NULL);
}
}
#endif
#endif


// TIMER
#ifdef SY_TIMER_SUPPORT
{
CSyTimer * lpclTimer = m_lpclContext->getTimer();
if(lpclTimer != NULL){
delete(lpclTimer);
m_lpclContext->setTimer(NULL);
}
}
#endif
#ifdef SY_FONT_MGR_SUPPORT
{
CSyFontMgr * lpclFontMgr = m_lpclContext->getFontMgr();
if(lpclFontMgr != NULL){
delete(lpclFontMgr);
m_lpclContext->setFontMgr(NULL);
}
}
#endif
// 语言
#ifdef SY_LANG_RES_SUPPORT
{
CSyLangRes * lpclLangRes = m_lpclContext->getLangRes();
if(lpclLangRes != NULL){
delete(lpclLangRes);
m_lpclContext->setLangRes(NULL);
}
}
#endif
// 皮肤
#ifdef SY_SKIN_SUPPORT
{
CSySkin * lpclSkin = m_lpclContext->getSkin();
if(lpclSkin != NULL){
delete(lpclSkin);
m_lpclContext->setSkin(NULL);
}
}
#endif
// 图片
#ifdef SY_IMG_RES_SUPPORT
{
CSyImgRes * lpclImgRes = m_lpclContext->getImgRes();
if(lpclImgRes != NULL){
delete(lpclImgRes);
m_lpclContext->setImgRes(NULL);
}
}
#endif


#ifdef ST_HANDWRITING_SUPPORT
{
CSyHandwritingCommunicateClient * lpclHandwritingCommumicateClient  = m_lpclContext->getHandwritingCommunicateClient();
if(lpclHandwritingCommumicateClient != NULL){
delete(lpclHandwritingCommumicateClient);
m_lpclContext->setHandwritingCommunicateClient(NULL);
}
}
#endif

}
return SY_OK;
}


#ifdef SY_PLAYER_SUPPORT
/*****************************
运行播放器初始化
******************************/
INT32 CSyApplication::runPlayerInit(){
m_lpclPlayerCtx = new CSyPlayerCtx();


CSyPlayerMgr::PlayerAttachModeE enPlayerAttachMode;
// 输出频道
switch(getDispAttachMode()){
case(CSyApplication::DISP_SEPARATE_CVBS_VGA):{
enPlayerAttachMode = CSyPlayerMgr::PLAYER_SEPARATE_CVBS_VGA;
break;
}
case(CSyApplication::DISP_ATTACH_CVBS_TO_VGA):{
enPlayerAttachMode = CSyPlayerMgr::PLAYER_ATTACH_CVBS_TO_VGA;
break;
}
case(CSyApplication::DISP_SEPARATE_CVBS_HDMI):{
enPlayerAttachMode = CSyPlayerMgr::PLAYER_SEPARATE_CVBS_HDMI;
break;
}
case(CSyApplication::DISP_ATTACH_CVBS_TO_HDMI):{
enPlayerAttachMode = CSyPlayerMgr::PLAYER_ATTACH_CVBS_TO_HDMI;
break;
}
default:{
enPlayerAttachMode = CSyPlayerMgr::PLAYER_SEPARATE_CVBS_VGA;
break;
}
}
return CSyPlayerMgr::runInit(m_lpclPlayerCtx, enPlayerAttachMode);


}
/*****************************
运行播放器去初始化
******************************/
INT32 CSyApplication::runPlayerDeinit(){
if(NULL != m_lpclPlayerCtx){
CSyPlayerMgr::runDeInit(m_lpclPlayerCtx);
// 释放
delete(m_lpclPlayerCtx);
m_lpclPlayerCtx = NULL;
}
return SY_OK;
}
#endif




/*****************************
初始化HISI设备
初始化I2C, 图层,声音,播放器
******************************/
INT32 CSyApplication::initDevice(){
INT32 iRet = SY_OK;
// 初始化
Key_Initial();


// I2C初始化
CSyI2C::init(SY_TRUE, SY_TRUE);





// 初始化图层驱动
#ifdef SY_DISPLAY_SUPPORT
if(SY_OK == iRet){
iRet = CSyDisplay::initHigoDev();
}
#endif


// 启动网卡
#if defined(POS_BOARD_TYPE_V10)
CSyNetIC::open(CSyNetIC::NET_PORT_UP);
#endif


// 初始化播放器
#ifdef SY_PLAYER_SUPPORT
if(SY_OK == iRet){
runPlayerInit();
}
#endif

return iRet;
}


/*****************************
同步定时事件.开始
******************************/
void CSyApplication::synchronizeTimeEventStart(){
CSyTimer * lpTimer = m_lpclContext->getTimer();
if(NULL != lpTimer){
lpTimer->synchronizeTimeEventStart();
}
}
/*****************************
同步定时事件.结束
******************************/
void CSyApplication::synchronizeTimeEventEnd(){
CSyTimer * lpTimer = m_lpclContext->getTimer();
if(NULL != lpTimer){
lpTimer->synchronizeTimeEventEnd();
}
}




/*****************************
运行
******************************/
INT32 CSyApplication::run(){
INT32 iRet = SY_OK;
// 运行程序
syDbgMsg("<KTV APPLICATION> RUN.\n");


//程序唯一实例
CSySingleProcessLock clSingleProcessLock;
clSingleProcessLock.init(NULL);
if(SY_OK != clSingleProcessLock.lock()){
syDbgMsg("SingleProcess Lock Fail..Exit Now!\n\n");
exitProcess();
return SY_OK;
}




// 初始化输出信号值
#if defined(POS_BOARD_TYPE_V10)
setDispAttachMode(CSyApplication::DISP_SEPARATE_CVBS_VGA);
#endif
  
// 初始化I2C, 图层,声音,播放器
initDevice();



// 创建实例
if(SY_OK == iRet){
iRet = createInstances();
}


// 创建视图实例
#ifdef SY_VIEW_SUPPORT
if(SY_OK == iRet){
iRet = createViewInstances();
// TV显示初始化
if(NULL != m_lpclTvViewCtx){
if(CSyApplication::DISP_SEPARATE_CVBS_VGA == getDispAttachMode()
||CSyApplication::DISP_SEPARATE_CVBS_HDMI == getDispAttachMode()
){
m_lpclTvViewCtx->getDisplay()->init();
}
}
// UI显示初始化
if(NULL != m_lpclUiViewCtx){
m_lpclUiViewCtx->getDisplay()->init();
}
}
#endif

//生成默认图片资源
#ifdef SY_IMG_RES_SUPPORT
if(SY_OK == iRet){
CSyImgRes * lpclImgRes = m_lpclContext->getImgRes();
lpclImgRes->initDefItems();
}
#endif


// 字体
#ifdef SY_FONT_MGR_SUPPORT
if(SY_OK == iRet){
CSyFontMgr * lpclFontMgr = m_lpclContext->getFontMgr();
lpclFontMgr->addDefaultFont(0);
}
#endif

// 默认皮肤
#ifdef SY_SKIN_SUPPORT
if(SY_OK == iRet){
CSySkin * lpclSkin = m_lpclContext->getSkin();
lpclSkin->generateDefaultRes();
}
#endif

// 启动定时器
#ifdef SY_TIMER_SUPPORT
if(SY_OK == iRet){
iRet = m_lpclContext->getTimer()->install();
}
#endif





{
// 开始同步定时器事件
synchronizeTimeEventStart();
// IR
#ifdef SY_IR_TIMER_PARSE_EVENT_SUPPORT
if(SY_OK == iRet){
CSyIR * lpclIR = m_lpclContext->getIR();
lpclIR->init();
lpclIR->createParseEventTimer();
}
#endif


//输入设备管理器
m_lpclInputDevMgr = new CSyInputDevMgr(m_lpclContext);
//设备管理类创建定时器
m_lpclInputDevMgr->createParseEventTimer();





#if 0
// MOUSE 打开鼠标,并创建事件分析定时器
#ifdef SY_MOUSE_TIMER_PARSE_EVENT_SUPPORT
if(SY_OK == iRet){
CSyMouse * lpclMouse = m_lpclContext->getMouse();
lpclMouse->openMouse(m_lpclInputDevMgr->getStrMouseHandler());
lpclMouse->createParseEventTimer();
}
#endif
//Keyboard打开键盘,并创建事件分析定时器
#ifdef SY_KEYBOARD_TIMER_PARSE_EVENT_SUPPORT
if(SY_OK == iRet){
CSyKeyboard * lpclKeyboard = m_lpclContext->getKeyboard();
lpclKeyboard->openKeyboard(m_lpclInputDevMgr->getStrKeyboardHandler());
lpclKeyboard->createParseEventTimer();
}
#endif
// UART TOUCH 打开触摸屏,并创建事件分析定时器
#if defined(SY_UART_TOUCH_TIMER_PARSE_EVENT_SUPPORT)&&defined(SY_UART_TOUCH_ENABLED)
if(SY_OK == iRet){
CSyUartTouch * lpclUartTouch = m_lpclContext->getUartTouch();
lpclUartTouch->createUart();
lpclUartTouch->createParseEventTimer();
}
#endif
#endif


// 请求数据
#ifdef SY_REQ_RT_TIMER_PARSE_EVENT_SUPPORT
if(SY_OK == iRet){
CSyReqRT * lpclReqRT = m_lpclContext->getReqRT();
lpclReqRT->createParseEventTimer();
}
#endif


// 打开鼠标显示
#ifdef POS_UI_POINTER_DLG_SUPPORT
CPosUiPointerDlg * lpclUiPointerDlg = NULL;
if(NULL != m_lpclUiViewCtx){
lpclUiPointerDlg = dynamic_cast<CPosUiPointerDlg *>(m_lpclUiViewCtx->getViewDlgMgr()->obtainDlgInstanceByID(CSyViewDlg::ID_UI_POINTER));
}
if(NULL != lpclUiPointerDlg){
lpclUiPointerDlg->openDlg();
}
#endif







// 添加syapp盘符
#ifdef SY_DISK_SUPPORT
if(SY_OK == iRet){
CSyDisk * lpclDisk = m_lpclContext->getDisk();
lpclDisk->srvAddSyappDiskLetter();
}
#endif




// 结束同步定时器事件
synchronizeTimeEventEnd();
}



{
// 开始同步定时器事件
synchronizeTimeEventStart();

// 加载外部语言
#ifdef SY_LANG_RES_SUPPORT
if(SY_OK == iRet){
CSyLangRes * lpclLangRes = m_lpclContext->getLangRes();
lpclLangRes->loadFile(0, m_lpclContext->getDisk()->getSysDiskLetter());
}
#endif

//加载 皮肤
#ifdef SY_SKIN_SUPPORT
if(SY_OK == iRet){
CSySkin * lpclSkin = m_lpclContext->getSkin();
lpclSkin->loadDefFile(m_lpclContext->getDisk()->getSysDiskLetter());
}
#endif

// UI界面
#ifdef SY_VIEW_DLG_SUPPORT
if(SY_OK == iRet){
if(NULL != m_lpclUiViewCtx){
// 打开墙纸
#ifdef POS_UI_WALLPAPER_DLG_SUPPORT
CPosUiWallPaperDlg * lpclUiWallPaperDlg = dynamic_cast<CPosUiWallPaperDlg *>(m_lpclUiViewCtx->getViewDlgMgr()->obtainDlgInstanceByID(CSyViewDlg::ID_UI_WALLPAPER));
if(NULL != lpclUiWallPaperDlg){
lpclUiWallPaperDlg->openDlg();
}
#endif

// 打开UI主页
#ifdef POS_UI_HOME_DLG_SUPPORT
CPosUiHomeDlg * lpclUiHomeDlg = dynamic_cast<CPosUiHomeDlg *>(m_lpclUiViewCtx->getViewDlgMgr()->obtainDlgInstanceByID(CSyViewDlg::ID_UI_HOME));
if(NULL != lpclUiHomeDlg){
lpclUiHomeDlg->openDlg();
}
#endif
}
}
#endif

// 初始化手写客户端
#ifdef ST_HANDWRITING_SUPPORT
{
CSyHandwritingCommunicateClient * lpclHandwritingCommumicateClient = m_lpclContext->getHandwritingCommunicateClient();
if(NULL !=  lpclHandwritingCommumicateClient){
lpclHandwritingCommumicateClient->initClient();
}
}
#endif




// 结束同步定时器事件
synchronizeTimeEventEnd();
}




while(1){
sySleep1Ms(100);
}


return iRet;
}


/*****************************
停止运行时执行
******************************/
void CSyApplication::parseAppStop(){
// 退出线程
#ifdef SY_PLAYER_SUPPORT
runPlayerDeinit();
#endif


// 删除PLAYER
#ifdef SY_PLAYER_SUPPORT
if(NULL != m_lpclPlayerCtx){
delete(m_lpclPlayerCtx);
m_lpclPlayerCtx = NULL;
}
#endif

// 删除VIEW
#ifdef SY_VIEW_SUPPORT
deleteViewInstances();
// 删除TV 
if(NULL != m_lpclTvViewCtx){
delete(m_lpclTvViewCtx);
m_lpclTvViewCtx = NULL;
}
// 删除UI
if(NULL != m_lpclUiViewCtx){
delete(m_lpclUiViewCtx);
m_lpclUiViewCtx = NULL;
}
#endif

// 删除实例
deleteInstances();
// 删除context
if(NULL != m_lpclContext){
delete(m_lpclContext);
}
#if 0
//删除输入设备管理器
if(NULL != m_lpclInputDevMgr){
delete(m_lpclInputDevMgr);
}
#endif
// 唯一实例
m_lpclApplication = NULL;

}
/*****************************
退出程序
******************************/
void CSyApplication::exitProcess(){
parseAppStop();
syExitProcess(0);
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值