📄 mmimmstomobilesoft.c
字号:
/*ps: this function is must be channge,ti is a dummy function to enable aoturecv talcon*/
P_MMS mms =getMMS();
if(mms ->manager == 0)
return 0;
if(mms ->manager ->receivefolder ==0)
return;
TRACE_FUNCTION("MMS_Get_Free_Space");
MMS_TRACE_EVENT(("MMS_Get_Free_Space:%d", 128000 - mms ->manager ->receivefolder->size));
return 128000 - mms ->manager ->receivefolder->size;
}
MMS_U8 ECC_MidiStop(MMS_S8 *filename)
{
#ifndef _INNOVATION_EMULATOR_
MMS_TRACE_EVENT(("MMS_MidiStop(%s)",filename));
MI_PlayMusic_Stop();
return 0;
#endif
}
MMS_U8 ECC_MidiPlay(MMS_S8 *filename, MMS_U8 loop)
{
#ifndef _INNOVATION_EMULATOR_
MMS_TRACE_EVENT(("MMS_MidiPlay(%s,%d)",filename, loop));
MI_PlayFile_Start((const char*)filename, 0xff, loop);
return 0;
#endif
}
MMS_VOID ECC_Sleep(MMS_U32 ms)
{
#ifndef MMI_MMSTASK_ENABLED
MMS_TRACE_EVENT(("ECC_Sleep"));
rvf_delay((ms+4)/5);
#endif
}
/*
#define LINE_HEIGHT 16
#define LINE_HEIGHT_CHINESE 16
#define SCREEN_SIZE_X 128
#define SCREEN_SIZE_Y 160
#define TITLE_HEIGHT 18
#define SOFTKEY_HEIGHT 18
#define MENU_PER_HEIGHT 18 */
MMS_VOID MMSDrawTitleBar(MMS_U8 curSlide, MMS_U8 slideNum, MMS_U8 audioFlag)
{
char title[10];
sprintf(title,"%d/%d",curSlide,slideNum);
dspl_colorTextOut(28, 0, DSPL_TXTATTR_TRANSPARENT,title, 0x0);
}
#define BarWidth 3
#define BarHeight (SCREEN_SIZE_Y-SOFTKEY_HEIGHT-TITLE_HEIGHT)
#define BarPosX (SCREEN_SIZE_X -BarWidth)
#define BarPosY TITLE_HEIGHT
MMS_VOID MMSDrawScrollBar(MMS_U8 curPage, MMS_U8 pageNum)
{
U8 uMode = 0;
int height;
MMS_U32 oldfgcolor;
int xPos1,xPos2,yPos1,yPos2;
float lenPerPage;
// uMode = dspl_Enable(0);
// dspl_ClearAll();
oldfgcolor = dspl_SetFrgColor(0x80ecf0);
dspl_DrawFillRect(BarPosX, BarPosY, BarPosX+BarWidth-1, BarPosY+BarHeight-1 );
dspl_SetFrgColor(oldfgcolor);
// dspl_BitBlt(BarPosX, BarPosY, BarWidth, BarHeight, 0, (void *)vScrollBar, DSPL_BMPCOPY);
if(curPage>0 && pageNum>1 && curPage<= pageNum)
{
lenPerPage = (float)BarHeight/pageNum;
xPos1 = BarPosX;
yPos1 = (int)((curPage-1)*lenPerPage)+ BarPosY;
xPos2 = xPos1+BarWidth-1;
yPos2 = yPos1 +(int)lenPerPage-1;
oldfgcolor = dspl_SetFrgColor(0x000080);
dspl_DrawFillRect(xPos1,yPos1,xPos2,yPos2);
dspl_SetFrgColor(oldfgcolor);
}
// dspl_Enable(uMode );
}
MMS_VOID sys_drawpoint(MMS_S32 x, MMS_S32 y, MMS_COLOR color)
{
MMS_TRACE_EVENT(("sys_drawpoint()"));
#ifdef MMI_MMSTASK_ENABLED
{
T_MMS_MMI_DRAWPOINT_IND parameter;
parameter.x = x;
parameter.y = y;
parameter.color = color;
/*请求mmi task处理*/
S_MMS_MMI_DRAWPOINT_IND(¶meter);
}
#else
{
MMS_U32 oldfgcolor;
oldfgcolor = dspl_SetFrgColor(color);
dspl_DrawPoint (x, y);
dspl_SetFrgColor(oldfgcolor);
}
#endif
}
MMS_S32 sys_drawtext(MMS_S32 x, MMS_S32 y, MMS_S8* string, MMS_U8 font, MMS_COLOR color)
{
MMS_TRACE_EVENT(("sys_drawtext()"));
#ifdef MMI_MMSTASK_ENABLED
{
T_MMS_MMI_DRAWTEXT_IND parameter;
parameter.x = x;
parameter.y = y;
//parameter.string = string;
MMS_new(parameter.string ,wstrlen(string) + 2);
wstrcpy(parameter.string,string);
parameter.font = font;
parameter.color = color;
/*请求mmi task处理*/
S_MMS_MMI_DRAWTEXT_IND(¶meter);
}
#else
switch(font)
{
case 12:
set_font_type(UNI12X12_FONT);
break;
case 16:
set_font_type(UNI24X24_FONT);
break;
case 20:
set_font_type(UNI24X24_FONT);
break;
default:
set_font_type(NORMAL_FONT);
break;
}
dspl_colorTextOut(x, y, DSPL_TXTATTR_NORMAL,string,color);
#endif
}
MMS_VOID sys_drawfillrect(MMS_S32 x, MMS_S32 y, MMS_S32 width, MMS_S32 height, MMS_COLOR color)
{
MMS_TRACE_EVENT(("sys_drawfillrect()"));
#ifdef MMI_MMSTASK_ENABLED
{
T_MMS_MMI_DRAWFILLRECT_IND parameter;
parameter.x = x;
parameter.y = y;
parameter.width = width;
parameter.height = height;
parameter.color = color;
/*请求mmi task处理*/
S_MMS_MMI_DRAWFILLRECT_IND(¶meter);
}
#else
{
MMS_U32 oldfgcolor;
oldfgcolor = dspl_SetFrgColor(color);
dspl_DrawFillRect (x, y, x+width, y+height);
dspl_SetFrgColor(oldfgcolor);
}
#endif
}
MMS_VOID sys_refreshwindow()
{
MMS_TRACE_EVENT(("sys_refreshwindow()"));
#ifdef MMI_MMSTASK_ENABLED
{
T_MMS_MMI_REFRESHWINDOW_IND parameter;
/*请求mmi task处理*/
S_MMS_MMI_REFRESHWINDOW_IND(¶meter);
}
#else
dspl_ClearAll();
#endif
}
#ifdef MMI_MMSTASK_ENABLED
MMS_VOID mmisys_drawpoint(MMS_S32 x, MMS_S32 y, MMS_COLOR color)
{
MMS_U32 oldfgcolor;
if(!IsWinFocus_MMSTask())
return ;
oldfgcolor = dspl_SetFrgColor(color);
dspl_DrawPoint (x, y);
dspl_SetFrgColor(oldfgcolor);
}
MMS_S32 mmisys_drawtext(MMS_S32 x, MMS_S32 y, MMS_S8* string, MMS_U8 font, MMS_COLOR color)
{
if(IsWinFocus_MMSTask())
{
switch(font)
{
case 12:
set_font_type(UNI12X12_FONT);
break;
case 16:
set_font_type(UNI24X24_FONT);
break;
case 20:
set_font_type(UNI24X24_FONT);
break;
default:
set_font_type(NORMAL_FONT);
break;
}
dspl_colorTextOut(x, y, DSPL_TXTATTR_NORMAL,string,color);
}
MMS_free(string,wstrlen(string) + 2);
}
MMS_VOID mmisys_drawfillrect(MMS_S32 x, MMS_S32 y, MMS_S32 width, MMS_S32 height, MMS_COLOR color)
{
MMS_U32 oldfgcolor;
if(!IsWinFocus_MMSTask())
return ;
oldfgcolor = dspl_SetFrgColor(color);
dspl_DrawFillRect (x, y, x+width, y+height);
dspl_SetFrgColor(oldfgcolor);
}
MMS_VOID mmisys_refreshwindow()
{
MMS_TRACE_EVENT(("sys_refreshwindow()"));
if(!IsWinFocus_MMSTask())
return ;
dspl_ClearAll();
}
#endif
MMS_S8 Eastcom_Jpeg_Delay(MMS_U32 pos, MMS_U32 line, MMS_U32 saved_line, MMS_U32 width)
{
char *pbmp=NULL;
int count=saved_line+1;
MMS_TRACE_EVENT(("Eastcom_Jpeg_Delay:%d,%d,%d,%d",pos, line,saved_line,width));
if((line %80) == 0)
rvf_delay(2);
if((count%10) == 0 )
{
rvf_delay(2);
MMSBitBlt((PLAYER_W - width)/2, pos, width , count, image_buf);
}
return 1;
}
#ifndef MMS_WAP_ENABLED/*dummy*/
/***************************************************************************/
/**************************WAP Interface************************************/
/***************************************************************************/
static char FORCERECV = 0;
/*****************************************
$Description:
encapsulate WAP_MMS_EVENT and call MMS_NET_EVENT_HANDLE
$Argument
@type: MMS_WAP_EVENT_TYPE
@status:MMI_MMS_EVENT_STATUS
@filename
*********************************************/
void wap_mms_evt_cb(
UBYTE type,
UBYTE status,
char * filename
)
{
pWAP_MMS_EVENT evt;
TRACE_FUNCTION("wap_mms_evt_cb()");
/*initialize manager and codec*/
MI_manager_on_initialize(MANAGER_MASK_MMSAGT);
/*{
extern T_MMS_NET_SETTINGS mmsSettings;
manager_set_autorecv(mmsSettings.allSettings[mmsSettings.curSettingsIndex].recvSettings.stateAutoRecv);
}*/
WAP_TRACE_EVENT(("type:%d, status:%d",type,status));
WAP_DELAY(30);
MMS_new(evt, sizeof(WAP_MMS_EVENT));
if(!evt)
{
TRACE_FUNCTION("memory alloc error");
return;
}
#if 0
MmsBusy = TRUE;
#endif
evt->type = type;
switch(type)
{
case NET_ERROR:
TRACE_FUNCTION("NET_ERROR");
MMS_NET_EVENT_HANDLE(evt);
break;
case NET_CONFIGURE_CNF:
TRACE_EVENT("NET_CONFIGURE_CNF");
MMS_new(evt->data.pconfiguredata, sizeof(CONFIGURE_CNF_DATA));
evt->data.pconfiguredata->status = status;
MMS_NET_EVENT_HANDLE(evt);
MMS_free(evt->data.pconfiguredata, sizeof(CONFIGURE_CNF_DATA));
break;
case NET_CLOSE_CNF:
TRACE_EVENT("NET_CLOSE_CNF");
MMS_new(evt->data.pclosedata,sizeof(CLOSE_CNF_DATA));
evt->data.pclosedata->status = status;
MMS_NET_EVENT_HANDLE(evt);
MMS_free(evt->data.pclosedata, sizeof(CLOSE_CNF_DATA));
#if 0
RcvFromMenu = FALSE;
#endif
break;
case NET_CANCEL_CNF:
TRACE_EVENT("NET_CANCEL_CNF");
MMS_new(evt->data.pcanceldata,sizeof(CANCEL_CNF_DATA));
evt->data.pcanceldata->status = status;
MMS_NET_EVENT_HANDLE(evt);
MMS_free(evt->data.pcanceldata, sizeof(CANCEL_CNF_DATA));
#if 0
RcvFromMenu = FALSE;
#endif
break;
case NET_POST_CNF:
TRACE_EVENT("NET_POST_CNF");
if(filename ==0)
{
WAP_TRACE_EVENT(("NET_POST_CNF-notiresp.mms"));
break;
}
MMS_new(evt->data.ppostdata,sizeof(POST_CNF_DATA));
evt->data.ppostdata->status = status;
evt->data.ppostdata->filename = filename;
MMS_NET_EVENT_HANDLE(evt);
MMS_free(evt->data.ppostdata, sizeof(POST_CNF_DATA));
break;
case NET_GET_CONTENT_IND:
TRACE_EVENT("NET_GET_CONTENT_IND");
MMS_new(evt->data.pgetdata,sizeof(GET_CONTENT_IND_DATA));
evt->data.pgetdata->status = status;
evt->data.pgetdata->filename = filename;
MMS_NET_EVENT_HANDLE(evt);
MMS_free(evt->data.pgetdata,sizeof(GET_CONTENT_IND_DATA));
break;
case NET_PUSH_IND:
TRACE_EVENT("NET_PUSH_IND");
MMS_new(evt->data.ppushdata,sizeof(PUSH_IND_DATA));
evt->data.ppushdata->status = status;
evt->data.ppushdata->filename= filename;
evt->data.ppushdata->forcerecv = FORCERECV;
MMS_NET_EVENT_HANDLE(evt);
MMS_free(evt->data.ppushdata, sizeof(PUSH_IND_DATA));
break;
default:
TRACE_FUNCTION("default");
break;
}
MMS_free(evt, sizeof(WAP_MMS_EVENT));
WAP_TRACE_EVENT(("end wap_mms_evt_cb"));
WAP_DELAY(30);
}
int MMS_WAP_Open(void)
{
MMS_TRACE_EVENT(("MMS_WAP_Open"));
wap_mms_evt_cb(
NET_CONFIGURE_CNF,
MMI_MMS_SUCCESS,
NULL);
}
int MMS_WAP_Close(void)
{
MMS_TRACE_EVENT(("MMS_WAP_Close"));
}
int MMS_WAP_Cancel()
{
pWAP_MMS_EVENT evt;
MMS_TRACE_EVENT(("MMS_WAP_Cancel"));
MMS_new(evt, sizeof(WAP_MMS_EVENT));
if(!evt)
{
TRACE_FUNCTION("memory alloc error");
return;
}
evt->type = NET_CANCEL_CNF;
MMS_new(evt->data.pcanceldata,sizeof(CANCEL_CNF_DATA));
evt->data.pcanceldata->status = MMI_MMS_SUCCESS;
MMS_NET_EVENT_HANDLE(evt);
MMS_free(evt->data.pcanceldata, sizeof(CANCEL_CNF_DATA));
MMS_free(evt, sizeof(WAP_MMS_EVENT));
}
int MMS_WAP_Send(char *filename, char *mmscaddr)
{
MMS_TRACE_EVENT(("MMS_WAP_Send"));
wap_mms_evt_cb(
NET_POST_CNF,
MMI_MMS_SUCCESS,
"sendconf.mms"
);
}
int MMS_WAP_Recv(char *filename, char *url)
{
MMS_TRACE_EVENT(("MMS_WAP_Recv"));
}
#ifdef NEW_MMI_MMS_INTERFACE
void MMS_MMI_NewMMS_notification(pMMI_MMS_EVENT event)
{
#if 0
extern void MMS_Sending_End(void ); //add by xie 04-07-22
P_MMS mms;
info_screen(NULL, TxtMMS, TxtMMSSendSuccess, NULL, REMIND_SUCCEED);
MMS_Sending_End();
// 需要销毁编辑窗口,将消息从草稿箱删除
// 或者销毁播放窗口。
//Destroy_editor();
mms = getMMS();
if(mms->manager && mms->manager->unsendfolder && mms->manager->unsendfolder->currentmessage)
{
pMessage pMsg;
pMsg = (pMessage)manager_on_pickout(mms->manager->unsendfolder);
pMsg->state = MMS_MSG_TYPE_SEND;
manager_on_addmsg(mms->manager->sendfolder, pMsg);
manager_on_store();
}
// info_screen(NULL, TxtNull, TxtMMSSendFaild, NULL, REMIND_FAILURE);
// info_screen(NULL, TxtMMS, TxtMMSSendCancelled, NULL, REMIND_COMPLETE);
// info_screen(NULL, TxtMMS, TxtMMSSendFaild, NULL, REMIND_FAILURE);
//#else
void MMS_Retrieving_End(void);
MMS_Retrieving_End();
info_screen(NULL, TxtMMS, TxtMMSRecvSuccess, NULL, REMIND_COMPLETE);
// info_screen(NULL, TxtMMS, TxtMMSRecvCancelled, NULL, REMIND_COMPLETE);
// info_screen(NULL, TxtNull, TxtMMSRecvFailed, NULL, REMIND_FAILURE);
// info_screen(NULL, TxtNull, TxtMMSDataError, NULL, REMIND_FAILURE);
#endif
}
#else
void MMS_MMI_NewMMS_notification(T_NEW_MMS_TYPE type)
{
MMS_TRACE_EVENT(("void MMS_MMI_NewMMS_notification(T_NEW_MMS_TYPE type)"));
}
#endif
void MMS_Close_All(void)
{
MMS_TRACE_EVENT(("MMS_Close_All"));
}
#endif
#ifdef MMI_MMSTASK_ENABLED
/***********************************************
$Description:
***********************************************/
BOOL IsWinFocus_MMSTask()
{
extern BYTE get_mmstask_proc();
if(!get_mmstask_proc())
return TRUE;
if(winIsFocussed(mmsui_data->current_win))
return TRUE;
MMS_TRACE_EVENT(("hyl,not is IsWinFocus_MMSTask!!!"));
return FALSE;
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -