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

📄 plxbrow.c

📁 mtk wap和mms代码。。适应mtk 25。26平台
💻 C
📖 第 1 页 / 共 5 页
字号:
	{
		MMI_message_string = get_string((UI_string_ID_type)message_id);
		MMI_multiline_inputbox.text = (UI_buffer_type)MMI_message_string;
		RedrawCategory66Screen();
	}
}


/****************************************************************************
* Function	EntryExittingBrowserScreen
* Purpose	
* Params	
* Return	
* Remarks	
\****************************************************************************/
void EntryExittingBrowserScreen(void)
{
	U8* guiBuffer; 

	EntryNewScreen( SCR_ID_PLX_BROW_EXITTING, LeaveExittingBrowserScreen, EntryExittingBrowserScreen, NULL );
	guiBuffer = GetCurrGuiBuffer(SCR_ID_PLX_BROW_EXITTING);	

	ShowCategory66Screen(STR_ID_PLX_BROW, IMG_ID_PLX_BROW, 0,
			IMG_GLOBAL_OK,0,IMG_GLOBAL_BACK, (U8*)get_string((UI_string_ID_type)STR_ID_PLX_BROW_STATUS_STARTEXIT), IMG_GLOBAL_INFO, guiBuffer);
	ClearKeyHandler( KEY_END, KEY_EVENT_DOWN );
	ClearKeyHandler( KEY_END, KEY_LONG_PRESS );
//	StopTimer(POPUP_TIMER);
//	StartTimer(POPUP_TIMER,PLXBROW_EXITTING_TIMER_DELAY,ExittingBrowserTimerHandler);
	pixtel_UI_cancel_timer(ExittingBrowserTimerHandler);
	pixtel_UI_start_timer(PLXBROW_EXITTING_TIMER_DELAY,ExittingBrowserTimerHandler);

}


/****************************************************************************
* Function	LeaveExittingBrowserScreen
* Purpose	
* Params	
* Return	
* Remarks	
\****************************************************************************/
void LeaveExittingBrowserScreen(void)
{
	pixtel_UI_cancel_timer(ExittingBrowserTimerHandler);
}

#endif

/****************************************************************************
* Function	DeInitPlxBrowser
* Purpose	
* Params	
* Return	
* Remarks	
\****************************************************************************/
void DeInitPlxBrowser(void)
{
	DeInitPlxBrowserEngine();
	DeInitPlxBrowserUI();
	DeInitPlxBrowserUIData();
    TryDestroyPlxBrowMainMenu();
}


/****************************************************************************
* Function	DeInitPlxBrowserEngine
* Purpose	
* Params	
* Return	
* Remarks	
\****************************************************************************/
static void DeInitPlxBrowserEngine(void)
{
	if(NULL != plxBrowInfo.hBrow)
	{
		bInExittingStatus = TRUE;	
	//	PWBE_Stop(plxBrowInfo.hBrow);
	//	PWBE_Hangup(plxBrowInfo.hBrow);
		PWBE_Destroy(plxBrowInfo.hBrow);
		plxBrowInfo.hBrow = NULL;
#ifdef __PLXBROW_DEBUG_
		PlxTrace("[%d]  DeInitPlxBrowserEngine -----> Destroy the engine\n",__LINE__);
#endif
	}
}


/****************************************************************************
* Function	DeInitPlxBrowserUI
* Purpose	
* Params	
* Return	
* Remarks	
\****************************************************************************/
static void DeInitPlxBrowserUI(void)
{
	TryDestroyAllMenus();
	bIsLinkInput = FALSE;
	memset(&plxBrowInfo,0x0, sizeof(BROWINFO));
}


/****************************************************************************
* Function	DeInitPlxBrowserUIData
* Purpose	
* Params	
* Return	
* Remarks	
\****************************************************************************/
static void DeInitPlxBrowserUIData(void)
{
	DeInitPlxBrowHistory();
	DeInitPlxBrowBookMark();
	if(NULL != szOldLinkInput)
	{
		PlxAppFree(szOldLinkInput);
		szOldLinkInput = NULL;
	}
	if(NULL != szTempSavedUrl)
	{
		PlxAppFree(szTempSavedUrl);
		szTempSavedUrl = NULL;
		nTempSavedUrlLen = 0;
	}
}


/****************************************************************************
* Function	InitPollexBrowser
* Purpose	initial browser
* Params	
* Return	
* Remarks	
\****************************************************************************/
#if 0
static void InitPollexBrowser(){
	if(FALSE == PlxBrowIsBrowserNeedRestart())
	{
		InitPlxBrowserUI();
		InitPlxBrowserUIData();
	}
	InitPlxBrowserEngine();
	InitPlxBrowserEngineOption();
}
#endif
/****************************************************************************
* Function	static void InitPlxBrowserEngine(void)
* Purpose	initial browser engine
* Params	
* Return	
* Remarks	
\****************************************************************************/
#ifdef __PLXBROW_SUPPORT_HOTPLUG_
extern WB_MEDIADOWNLOAD PWBCBIsMediaDownload(int DownloadType, unsigned char ContType, const char *szMIMEName);
#endif

static void InitPlxBrowserEngine(void)
{
	char*			pszGateway;
	int				nPort;
	int				nProtocol;
	
	//initial browser engine
	if(NULL != plxBrowInfo.hBrow)
		return;
	pszGateway = (char*)PlxBrowGetGateway();
	nPort = PlxBrowGetPort();
	nProtocol = PlxBrowGetProtocolType();

#ifdef MMI_ON_WIN32
    plxBrowInfo.hBrow = PWBE_Create(0, &plxBrowInfo.rcInScreen, nProtocol, NULL, nPort, 0, 0, (LIBLIST_GUI *)&guiFuncList);
#else
	plxBrowInfo.hBrow = PWBE_Create(0, &plxBrowInfo.rcInScreen, nProtocol, pszGateway, nPort, 0, 0, (LIBLIST_GUI *)&guiFuncList);
#endif
 //set ui callback funcs
	plxBrowInfo.wbCallBack.AddPbEntryProc = PWBCBPubAddPBEntry;
	plxBrowInfo.wbCallBack.AssertProc = PWBCBAssertProc;
	plxBrowInfo.wbCallBack.DealJavaAppProc = PWBCBDealJavaAppProc;
	plxBrowInfo.wbCallBack.DownloadProc = PWBCBDownloadProc;
	plxBrowInfo.wbCallBack.GetAuthProc = PWBCBGetAuthProc;
	plxBrowInfo.wbCallBack.MailToProc = PWBCBBrsMailTo;
	plxBrowInfo.wbCallBack.MakeCallProc = PWBCBPubMakeCall;
	plxBrowInfo.wbCallBack.PermitProc = PWBCBPermitProc;
	plxBrowInfo.wbCallBack.PromptProc = PWBCBPromptProc;
	plxBrowInfo.wbCallBack.SendDtmfProc = NULL; //PWBCBPubSendDTMF;
	plxBrowInfo.wbCallBack.SetSrollPosProc = PWBCBSetScrollPosProc;
	plxBrowInfo.wbCallBack.UINotifyProc = PWBCBUINotifyProc;
#ifdef __PLXBROW_SUPPORT_HOTPLUG_
	plxBrowInfo.wbCallBack.IsMediaDownload = PWBCBIsMediaDownload;
#endif
	PWBE_RegisterCallbackProcs(plxBrowInfo.hBrow, &plxBrowInfo.wbCallBack);
	InitPlxBrowNotifyInfo();

}


/****************************************************************************
* Function	static void InitPlxBrowserEngineOption(void)
* Purpose	initial browser engine options
* Params	
* Return	
* Remarks	
\****************************************************************************/
static void InitPlxBrowserEngineOption(void)
{
	int				nRetInfo;
	BOOL			bRetCACOOInfo;
	const color		*RetColorStruct;
	unsigned long	lgColor;
	
	//register user agent and uaprofileurl
	PWBE_SetUserAgent(plxBrowInfo.hBrow, PLXBROW_USERAGENT);
//	PWBE_SetUAProfileUrl(plxBrowInfo.hBrow, PLXBROW_UAPROFILEURL);

	//set color info
	RetColorStruct =PlxBrowGetNormalTextColor();
	lgColor = (unsigned long)PLXRGB(RetColorStruct->r,RetColorStruct->g,RetColorStruct->b);
	plxBrowInfo.colorTheme.text_color = lgColor; //PLXRGB(0,0,0);

	RetColorStruct =PlxBrowGetLinkTextColor();
	lgColor = (unsigned long) PLXRGB(RetColorStruct->r,RetColorStruct->g , RetColorStruct ->b);
	plxBrowInfo.colorTheme.link_textcolor = lgColor;//PLXRGB(0,0,188);
	
	RetColorStruct =PlxBrowGetLinkBackgroudColor();
	if(RetColorStruct->alpha == 100)
		lgColor = COLOR_INVALID;
	else
		lgColor = (unsigned long) PLXRGB(RetColorStruct->r,RetColorStruct->g , RetColorStruct ->b );
	plxBrowInfo.colorTheme.link_bgcolor = lgColor;//-1;

	RetColorStruct =PlxBrowGetActiveTextColor();
	lgColor = (unsigned long)PLXRGB (RetColorStruct->r ,RetColorStruct->g , RetColorStruct ->b);
	plxBrowInfo.colorTheme.link_Focustextcolor = lgColor; //PLXRGB(55, 55, 55);

	RetColorStruct =PlxBrowGetActiveBackgroundColor();
	if(RetColorStruct->alpha == 100)
		lgColor = COLOR_INVALID;
	else
		lgColor = (unsigned long) PLXRGB(RetColorStruct->r, RetColorStruct->g, RetColorStruct ->b);
	plxBrowInfo.colorTheme.link_Focusbgcolor = lgColor;//PLXRGB(128,128,0);

	PWBE_SetDisplayOption(plxBrowInfo.hBrow, WBDOP_COLOR, &plxBrowInfo.colorTheme, sizeof(Color_Scheme));

	//set default font size
	if(DIALER_FONT  == UI_font->size)
		 nRetInfo = 27;
	else if(LARGE_FONT == UI_font->size)
		nRetInfo = 16;
	else if (MEDIUM_FONT == UI_font->size)
		nRetInfo = 14;
	else if(SMALL_FONT == UI_font->size)
		nRetInfo = 9;
	else
		nRetInfo = 14;
	PWBE_SetDisplayOption(plxBrowInfo.hBrow, WBDOP_FONTSIZE, (void *)&nRetInfo, sizeof(int));

	//set default max page size
	nRetInfo = PLXBROW_DEFAULT_MAX_PAGESIZE;
	PWBE_SetDisplayOption(plxBrowInfo.hBrow, WBDOP_MAXPAGESIZE, (void *)&nRetInfo, sizeof(long));

	//set the size of the horizonal scrollbar 
#if defined( __PLXBROW_DYNCSHOW_HSCROLL_) /*||defined(__PLXBROW_DYNCSHOW_VSCROLL_)*/ 
	nRetInfo = current_MMI_theme->scrollbar_size;
#else
	nRetInfo = 0;
#endif
	PWBE_SetDisplayOption(plxBrowInfo.hBrow, WBDOP_SCROLLBARSIZE, (void *)&nRetInfo, sizeof(int));

	
	//set imge info
	nRetInfo = PlxBrowIsImageAllowed();
	PWBE_SetDisplayOption(plxBrowInfo.hBrow, WBDOP_IMGDISPLAY, (void *) &nRetInfo, sizeof(int));
	//set music info
	nRetInfo = PlxBrowIsMusicAllowed() ;
	PWBE_SetDisplayOption(plxBrowInfo.hBrow,WBDOP_BGSOUND, (void *)&nRetInfo,sizeof(int));

	//set cache
	bRetCACOOInfo = PlxBrowIsCacheEnable();
	if(TRUE == bRetCACOOInfo)
		
	{	nRetInfo = WBCACHE_OK;
		PWBE_SetCACOOption( plxBrowInfo.hBrow, WBCACHE_MODE, (void *)&nRetInfo,sizeof(int));
		nRetInfo = PlxBrowGetCacheSize();
		PWBE_SetCACOOption( plxBrowInfo.hBrow, WBCACHE_SIZE, (void *)&nRetInfo,sizeof(int));
		PWBE_SetCACOOption( plxBrowInfo.hBrow, WBCACHE_FILE, (void *)GetPBUICacheFilePath(),sizeof(GetPBUICacheFilePath()));
	}
	else
	{
		nRetInfo = WBCACHE_FLUSH;
		PWBE_SetCACOOption( plxBrowInfo.hBrow, WBCACHE_MODE, (void *)&nRetInfo,sizeof(int));
	}
	
	//set cookie
	bRetCACOOInfo = PlxBrowIsCookieEnable();
	if(TRUE == bRetCACOOInfo)
	{	
		nRetInfo = WBCOOKIE_ENABLE;
		PWBE_SetCACOOption( plxBrowInfo.hBrow, WBCOOKIE_MODE, (void *)&nRetInfo,sizeof(int));
		nRetInfo = PlxBrowGetCookieSize();
		PWBE_SetCACOOption( plxBrowInfo.hBrow, WBCOOKIE_SIZE, (void *)&nRetInfo,sizeof(int));
		nRetInfo = PlxBrowGetCookieNumber();
		PWBE_SetCACOOption( plxBrowInfo.hBrow, WBCOOKIE_COUNT, (void *)&nRetInfo,sizeof(int));
		PWBE_SetCACOOption( plxBrowInfo.hBrow, WBCOOKIE_FILE, (void *)GetPBUICookieFilePath(),sizeof(GetPBUICookieFilePath()));
	}
	else
	{
		nRetInfo = WBCOOKIE_DISABLE ;
		PWBE_SetCACOOption( plxBrowInfo.hBrow, WBCOOKIE_MODE, (void *)&nRetInfo,sizeof(int));
	}
	//register dial id
	nRetInfo = PlxBrowGetDialAccountIndex();
	PWBE_SetCACOOption( plxBrowInfo.hBrow, WBDIAL_CFGID, (void *)&nRetInfo,sizeof(int));

	//set push info
	PWBE_EnablePUSH((WB_BOOL)PlxBrowIsPushMessageAllowed());
}


/****************************************************************************
* Function	
* Purpose	
* Params	
* Return	
* Remarks	
\****************************************************************************/
static void InitPlxBrowserUI(void)
{
	int		bar_height;
	int		nHScrollWidth;
	int		nVScrollWidth;
	int		nVerAdjSpace = 0;
	int		nHorAdjSpace = 0;

#if defined(__MMI_MAINLCD_128X128__)
	nVerAdjSpace = 0;
#elif defined(__MMI_MAINLCD_128X160__)
	nVerAdjSpace = 0;
#elif defined(__MMI_MAINLCD_176X220__)
	nVerAdjSpace = 1;
#endif

#if defined (__PLXBROW_DISABLE_HSCROLL_) || defined (__PLXBROW_DYNCSHOW_HSCROLL_)
	nHorAdjSpace = 1;
#else
	nHorAdjSpace = 0;
#endif

	bar_height = GetBrowserStatusBarHeight();
	nHScrollWidth = GetBrowserHScrollWidth();
	nVScrollWidth = GetBrowserVScrollWidth();
	
//	PlxAppMemcpy(pWebPageTitle, "\x00\x00", 2);
	pfnUnicodeStrcpy((S8*)pWebPageTitle,(const S8*)get_string(STR_ID_PLX_BROW));
	
	plxBrowInfo.rcInScreen.left = 1;
	plxBrowInfo.rcInScreen.top = MMI_title_y + MMI_title_height + 1;
	plxBrowInfo.rcInScreen.right = MMI_content_width - (nVScrollWidth + 1);
#ifndef  __PLXBROW_DYNCSHOW_HSCROLL_
	plxBrowInfo.rcInScreen.bottom = MMI_content_height + MMI_title_height + MMI_title_y - (nHScrollWidth + 1) - bar_height  - nVerAdjSpace - nHorAdjSpace;
#else
	plxBrowInfo.rcInScreen.bottom = MMI_content_height + MMI_title_height + MMI_title_y -bar_height  -1 - nVerAdjSpace - nHorAdjSpace;
#endif
	plxBrowInfo.rcStatusBar.left = 1;
	plxBrowInfo.rcStatusBar.top = MMI_title_y + MMI_title_height + MMI_content_height - bar_height - nHorAdjSpace;
	plxBrowInfo.rcStatusBar.right = MMI_content_width -2;
	plxBrowInfo.rcStatusBar.bottom = plxBrowInfo.rcStatusBar.top + bar_height - 1;

#ifndef __PLXBROW_DISABLE_VSCROLL_
	pixtel_UI_create_vertical_scrollbar(&plxBrowInfo.verScroll, 
		MMI_content_width - (nVScrollWidth ), MMI_title_y + MMI_title_height,
		nVScrollWidth, MMI_content_height - nHScrollWidth  - bar_height);
	pixtel_UI_set_vertical_scrollbar_current_theme(&plxBrowInfo.verScroll);
#endif

#ifndef __PLXBROW_DISABLE_HSCROLL_
	pixtel_UI_create_horizontal_scrollbar(&plxBrowInfo.horScroll, 
		1, MMI_content_height + MMI_title_height + MMI_title_y - (nHScrollWidth) - bar_height + 1,
		MMI_content_width - nVScrollWidth , nHScrollWidth);
	pixtel_UI_set_horizontal_scrollbar_current_theme(&plxBrowInfo.horScroll);
#endif

	plxBrowInfo.bShowLogo = TRUE;
}


/****************************************************************************
* Function	InitPlxBrowserUIData
* Purpose	
* Params	
* Return	
* Remarks	
\****************************************************************************/
static void InitPlxBrowserUIData(void)
{
	 InitPlxBrowHistory();
	InitPlxBrowBookMark();
}


/****************************************************************************
* Function	PlxBrowResetProtocol
* Purpose	
* Params	
* Return	
* Remarks	
\****************************************************************************/
#ifdef __PLXBROW_SWITCH_PROTOCOL_
static void PlxBrowResetProtocol(void)
{
	char*			pszGateway;
	int				nPort;
	int				nProtocol;
	int				nDialId;
	
	if(NULL == plxBrowInfo.hBrow)
		return;
	pszGateway = (char*)PlxBrowGetGateway();
	nPort = PlxBrowGetPort();
	nProtocol = PlxBrowGetProtocolType();

	PWBE_SetProtocol(plxBrowInfo.hBrow, nProtocol, (const char *) pszGateway, nPort, (const char *)NULL,(const char * )NULL);
	//register dial id
	nDialId = PlxBrowGetDialAccountIndex();
	PWBE_SetCACOOption( plxBrowInfo.hBrow, WBDIAL_CFGID, (void *)&nDialId,sizeof(int));

}
#endif // __PLXBROW_SWITCH_PROTOCOL_


/****************************************************************************
* Function	OpenHomePage
* Purpose	open homepage
* Params	
* Return	
* Remarks	
\****************************************************************************/
/*
static void OpenHomePage(void){
	PWBE_NewPage(plxBrowInfo.hBrow, (char*)PlxBrowGetHomepage(), WBTRANS_GET, 0, 0); 
	plxBrowAddOneHistory((char*)PlxBrowGetHomepage());
}
*/


⌨️ 快捷键说明

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