亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? myiweb.step4

?? BREW程序:BREW手機上的Web訪問程序
?? STEP4
?? 第 1 頁 / 共 2 頁
字號:
/*===========================================================================

FILE: myiweb.c
===========================================================================*/


/*===============================================================================
INCLUDES AND VARIABLE DEFINITIONS
=============================================================================== */
#include "AEEModGen.h"          // Module interface definitions
#include "AEEAppGen.h"          // Applet interface definitions
#include "AEEShell.h"           // Shell interface definitions

#include "myiweb.bid"
#include "myiweb_res.h"
#include "AEEFile.h"			// File interface definitions
#include "AEEStdLib.h"
#include "AEEMenu.h" 
// lab 1
#include "AEENet.h"				// Socket interface definitions
#include "AEEHtmlViewer.h"
#define TEST_HOST  "http://192.168.84.40/" //"http://10.10.10.84/"
#define TEST_URL  "http://192.168.84.40/brewtest.htm" //"http://10.10.10.84/brewtest.htm"
// end of lab 1
//lab 4
#define FIND_STRING(a, b) if (STRISTR(a, b) != NULL)
// end of lab 4
/*-------------------------------------------------------------------
Applet structure. All variables in here are reference via "pMe->"
-------------------------------------------------------------------*/
// create an applet structure that's passed around. All variables in
// here will be able to be referenced as static.
typedef struct _myiweb {
	AEEApplet      a ;	       // First element of this structure must be AEEApplet
    AEEDeviceInfo  DeviceInfo; // always have access to the hardware device information
    IDisplay      *pIDisplay;  // give a standard way to access the Display interface
    IShell        *pIShell;    // give a standard way to access the Shell interface
	AEERect              m_rc; 
    // add your own variables here...

	IMenuCtl *        m_pIMenu;
	
	//lab 1
	IWeb*	m_pIWeb;
	IHtmlViewer *        m_pHTMLViewer;  
	// end of lab 1
	// lab 2
		IStatic *		m_pIStatic;
		// end of lab 2
		
	//lab 5

	// end of lab 5
	//lab 6

	// end of lab 6
	// lab 4
	IFileMgr * m_pIFileMgr;
	char	* m_pszFileName;
	// end of lab 4
	
	// lab 1
	IPeek                *pipPostData;  // POST stream, if any
	char                 *pszPostData;  // POST string
	AEECallback          cb;            // how to call me back	
	IWebResp *           piWResp;       // the answer I get from IWeb
	
	byte *		m_BodyBuffer;		// Buffer to hold HTML data
	int			m_BodySize;			// Size of HTML data in buffer
	int			m_BodyAllocSize;	// Allocated size of HTML data buffer
// end of lab 1
	int					m_iAppStatus;
	
	//lab 4
	int m_iMediaType;
	char targetUrl[128];
	// end of lab 4
} myiweb;

/*-------------------------------------------------------------------
Function Prototypes
-------------------------------------------------------------------*/
static  boolean myiweb_HandleEvent(myiweb* pMe, AEEEvent eCode, 
                                             uint16 wParam, uint32 dwParam);
boolean myiweb_InitAppData(myiweb* pMe);
void    myiweb_FreeAppData(myiweb* pMe);

/*===============================================================================
FUNCTION DEFINITIONS
=============================================================================== */

static void  myiweb_ShowMenu(myiweb* pMe);

//lab 1
static void myiweb_Start(myiweb *pMe, char *pszUrl,int iPage);
// end of lab 1
// lab 2
static void	 myiweb_DisplayInfo(myiweb* pMe,AECHAR* pInfo);
static void    myiweb_Header(void *p, const char *cpszName, GetLine *pglVal);
static void    myiweb_Status(void *p, WebStatus ws, void *pVal);
// end of lab 2
//lab 3
static void    myiweb_Stop(myiweb *pwa);
// end of lab 3
//lab 1
static void    myiweb_GotResp(void *p);
static void myiwebhtml_NotifyCB( void* pvUser, HViewNotify* pNotify );
// end of lab 1
// lab 4
static void myiweb_DownloadFile(void *p);
// end of lab 4
//lab 5

// end of lab 5
//lab 6
// end of lab 6
/*===========================================================================
FUNCTION: AEEClsCreateInstance

DESCRIPTION
	This function is invoked while the app is being loaded. All Modules must provide this 
	function. Ensure to retain the same name and parameters for this function.
	In here, the module must verify the ClassID and then invoke the AEEApplet_New() function
	that has been provided in AEEAppGen.c. 

   After invoking AEEApplet_New(), this function can do app specific initialization. In this
   example, a generic structure is provided so that app developers need not change app specific
   initialization section every time except for a call to IDisplay_InitAppData(). 
   This is done as follows: InitAppData() is called to initialize AppletData 
   instance. It is app developers responsibility to fill-in app data initialization 
   code of InitAppData(). App developer is also responsible to release memory 
   allocated for data contained in AppletData -- this can be done in 
   IDisplay_FreeAppData().

PROTOTYPE:
   int AEEClsCreateInstance(AEECLSID ClsId,IShell * pIShell,IModule * po,void ** ppObj)

PARAMETERS:
	clsID: [in]: Specifies the ClassID of the applet which is being loaded

	pIShell: [in]: Contains pointer to the IShell object. 

	pIModule: pin]: Contains pointer to the IModule object to the current module to which
	this app belongs

	ppObj: [out]: On return, *ppObj must point to a valid IApplet structure. Allocation
	of memory for this structure and initializing the base data members is done by AEEApplet_New().

DEPENDENCIES
  none

RETURN VALUE
  AEE_SUCCESS: If the app needs to be loaded and if AEEApplet_New() invocation was
     successful
  EFAILED: If the app does not need to be loaded or if errors occurred in 
     AEEApplet_New(). If this function returns FALSE, the app will not be loaded.

SIDE EFFECTS
  none
===========================================================================*/
int AEEClsCreateInstance(AEECLSID ClsId, IShell *pIShell, IModule *po, void **ppObj)
{
	*ppObj = NULL;

	if( ClsId == AEECLSID_MYIWEB )
	{
		// Create the applet and make room for the applet structure
		if( AEEApplet_New(sizeof(myiweb),
                          ClsId,
                          pIShell,
                          po,
                          (IApplet**)ppObj,
                          (AEEHANDLER)myiweb_HandleEvent,
                          (PFNFREEAPPDATA)myiweb_FreeAppData) ) // the FreeAppData function is called after sending EVT_APP_STOP to the HandleEvent function
                          
		{
			//Initialize applet data, this is called before sending EVT_APP_START
            // to the HandleEvent function
			if(myiweb_InitAppData((myiweb*)*ppObj))
			{
				//Data initialized successfully
				return(AEE_SUCCESS);
			}
			else
			{
				//Release the applet. This will free the memory allocated for the applet when
				// AEEApplet_New was called.
				IAPPLET_Release((IApplet*)*ppObj);
				return EFAILED;
			}

        } // end AEEApplet_New

    }

	return(EFAILED);
}


/*===========================================================================
FUNCTION SampleAppWizard_HandleEvent

DESCRIPTION
	This is the EventHandler for this app. All events to this app are handled in this
	function. All APPs must supply an Event Handler.

PROTOTYPE:
	boolean SampleAppWizard_HandleEvent(IApplet * pi, AEEEvent eCode, uint16 wParam, uint32 dwParam)

PARAMETERS:
	pi: Pointer to the AEEApplet structure. This structure contains information specific
	to this applet. It was initialized during the AEEClsCreateInstance() function.

	ecode: Specifies the Event sent to this applet

   wParam, dwParam: Event specific data.

DEPENDENCIES
  none

RETURN VALUE
  TRUE: If the app has processed the event
  FALSE: If the app did not process the event

SIDE EFFECTS
  none
===========================================================================*/
static boolean myiweb_HandleEvent(myiweb* pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{  
//lab 1
	if (pMe->m_pHTMLViewer && IHTMLVIEWER_HandleEvent(pMe->m_pHTMLViewer, eCode, wParam, dwParam)&&(pMe->m_iAppStatus==1))
       return TRUE;
       // end of lab 1
       
	if(pMe->m_pIMenu && IMENUCTL_HandleEvent(pMe->m_pIMenu, eCode, wParam, dwParam) && pMe->m_iAppStatus ==0 )
					return TRUE;
	// lab 5					

					// end of lab 5
	// lab 6					

					// end of lab 6					
    switch (eCode) 
	{
        // App is told it is starting up
        case EVT_APP_START:                        
		    // Add your code here...
			myiweb_ShowMenu(pMe);
            return(TRUE);


        // App is told it is exiting
        case EVT_APP_STOP:
            // Add your code here...
            // lab 3
			myiweb_Stop(pMe);
			// end of lab 3
      		return(TRUE);


        // App is being suspended 
        case EVT_APP_SUSPEND:
		    // Add your code here...

      		return(TRUE);


        // App is being resumed
        case EVT_APP_RESUME:
		    // Add your code here...
			
      		return(TRUE);


        // An SMS message has arrived for this app. Message is in the dwParam above as (char *)
        // sender simply uses this format "//BREW:ClassId:Message", example //BREW:0x00000001:Hello World
        case EVT_APP_MESSAGE:
			// Add your code here...
			
			return(TRUE);
			
			// A key was pressed. Look at the wParam above to see which key was pressed. The key
		case EVT_KEY:
			// Add your code here...			
			if(wParam ==AVK_CLR)
			{
			//lab 2
				if(pMe->m_pIStatic)
				{
					ISTATIC_Release(pMe->m_pIStatic);
					pMe->m_pIStatic = NULL;
				}
				//end of lab 2
				//lab 6

				//end of lab 6
				//lab 1
				if(pMe->m_iAppStatus >0)
				{
					IHTMLVIEWER_SetNotifyFn(pMe->m_pHTMLViewer, NULL, pMe);
					
				}else // end of lab 1
				if(pMe->m_iAppStatus ==0)
				{
					ISHELL_CloseApplet(pMe->pIShell,FALSE);
					return TRUE;
				}
				// lab 5

				// end of lab 5
				myiweb_ShowMenu(pMe);
				return TRUE;
			}
			
			
		case EVT_COMMAND:
			if( pMe->m_pIMenu )
			{
				switch(IMENUCTL_GetSel(pMe->m_pIMenu))
				{
				case IDS_WCONNECT:
				//lab 1
					myiweb_Start(pMe,TEST_URL,0);
					// end of lab 1
					break;
				case IDS_FILE_MGR:
				// lab 5

					// end of lab 5
					break;
				case IDS_FAVOURITE:
					break;
				case IDS_ABOUT:
					break;
				}
				IMENUCTL_Release(pMe->m_pIMenu);
				pMe->m_pIMenu = NULL;
				
			}
			//lab 6
	
			// end of lab 6
			return(TRUE);
			// If nothing fits up to this point then we'll just break out
        default:
            break;
	}
	
	return FALSE;
}


// this function is called when your application is starting up
boolean myiweb_InitAppData(myiweb* pMe)
{
    // Get the device information for this handset.
    // Reference all the data by looking at the pMe->DeviceInfo structure
    // Check the API reference guide for all the handy device info you can get
    pMe->DeviceInfo.wStructSize = sizeof(pMe->DeviceInfo);
    ISHELL_GetDeviceInfo(pMe->a.m_pIShell,&pMe->DeviceInfo);

    // The display and shell interfaces are always created by
    // default, so we'll asign them so that you can access
    // them via the standard "pMe->" without the "a."
    pMe->pIDisplay = pMe->a.m_pIDisplay;
    pMe->pIShell   = pMe->a.m_pIShell;

    // Insert your code here for initializing or allocating resources...
 // Create each of the controls used by the application.
 // lab 1
   if( (ISHELL_CreateInstance(pMe->pIShell, AEECLSID_HTML, (void**)(&pMe->m_pHTMLViewer)) != SUCCESS) ||
        (ISHELL_CreateInstance(pMe->pIShell, AEECLSID_WEB, (void **)(&pMe->m_pIWeb)) != SUCCESS))
   {
      IAPPLET_Release((IApplet*)pMe);
      return FALSE;
   }
   IHTMLVIEWER_SetNotifyFn(pMe->m_pHTMLViewer, (PFNHVIEWNOTIFY)myiwebhtml_NotifyCB, pMe);
   IHTMLVIEWER_SetProperties(pMe->m_pHTMLViewer, HVP_SCROLLBAR);

   // Get device screen rect
   SETAEERECT(&pMe->m_rc, 0, 0, pMe->DeviceInfo.cxScreen, pMe->DeviceInfo.cyScreen);

    // Initialize the IWeb with a few options
   {
      int    i = 0;
      WebOpt awo[10]; 

      // set the IWeb connect timeout to 10 seconds.  this also sets the 
      // failover timeout, if unset, or set to 0, IWeb uses the system 
      // default (30 seconds unless an OEM changes it)
      awo[i].nId  = WEBOPT_CONNECTTIMEOUT;
      awo[i].pVal = (void *)10000;
      i++;

      // test user-agent, uncomment this section to ship your own user-agent 
      // string. if unset, IWeb will send a default.  If set to NULL, no 
      // user agent header will be sent */

      // Set TEST_USER_AGENT in the NetDiagnostics project settings to all
      // shipping of your own user agent.

#ifdef TEST_USER_AGENT
      awo[i].nId  = WEBOPT_USERAGENT;
      awo[i].pVal = (void *)WEBBER_USERAGENT;
      i++;
#endif 

      // test nowaitconn, this only comes into effect if you build webber 
      // with multiple myiwebs (see the definition of struct Webber)
      awo[i].nId  = WEBOPT_FLAGS;
      awo[i].pVal = (void *)WEBREQUEST_NOWAITCONN;
      i++;
      

      // test forcenew, uncomment this section to try multiple simultaneous
      // "forced" new connections. Forced new connections are not kept alive
      // unless they are the first forced new connection to a host
#ifdef TEST_FORCENEWCONN
      awo[i].nId  = WEBOPT_FLAGS;
      awo[i].pVal = (void *)WEBREQUEST_FORCENEWCONN;
      i++;
#endif 

#ifdef TEST_USER_AGENT
      // turn off HTTP over HTTP proxying
      awo[i].nId  = WEBOPT_PROXYSPEC;
      awo[i].pVal = (void *)"http:///";
      i++;

      // turn on ALL proxying.  Proxyspecs are examined in WebOpt
      // order, so in this list, with the above and below PROXYSPECs,
      // everything except HTTP will be proxied through
      // http://webproxy.yourdomain.com:8080, (which you'll have to
      // set up to test, sorry
      awo[i].nId  = WEBOPT_PROXYSPEC;
      awo[i].pVal = (void *)"*:///http://webproxy.yourdomain.com:8080";
      i++;
#endif

      // Marks the end of the array of WebOpts
      awo[i].nId  = WEBOPT_END;
      
      // Add Options
      IWEB_AddOpt(pMe->m_pIWeb,awo);
   }

   	pMe->m_BodyBuffer = NULL;
	pMe->m_BodySize = 0;
	pMe->m_BodyAllocSize = 0;
    // if there have been no failures up to this point then return success
    // end of lab 1
    return TRUE;
}

// this function is called when your application is exiting
void myiweb_FreeAppData(myiweb* pMe)
{
    // insert your code here for freeing any resources you have allocated...
	
	if( pMe->m_pIMenu )
	{
		IMENUCTL_Release(pMe->m_pIMenu);
		pMe->m_pIMenu = NULL;
	}
	// lab 2
	if(pMe->m_pIStatic)
	{
		ISTATIC_Release(pMe->m_pIStatic);
		pMe->m_pIStatic = NULL;
	}
	// end of lab 2
//lab 1
	if(pMe->m_pHTMLViewer)
	{
		IHTMLVIEWER_SetNotifyFn(pMe->m_pHTMLViewer, NULL, pMe);
		IHTMLVIEWER_Release(pMe->m_pHTMLViewer);
		pMe->m_pHTMLViewer = NULL;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品福利一二区| 丝袜亚洲精品中文字幕一区| 精品国产一区二区三区久久久蜜月 | 91成人在线精品| av男人天堂一区| 91婷婷韩国欧美一区二区| 成人久久视频在线观看| 成人亚洲一区二区一| 成人亚洲一区二区一| 盗摄精品av一区二区三区| 成人h动漫精品一区二区| 不卡一区二区三区四区| 波多野结衣一区二区三区| 不卡一卡二卡三乱码免费网站| 成人av网站在线观看免费| 成人久久18免费网站麻豆 | 精品日韩欧美一区二区| 日韩精品一区二区三区视频在线观看 | 国产一区二区久久| 国产在线精品国自产拍免费| 国产麻豆9l精品三级站| av在线不卡免费看| 91黄色免费版| 欧美一级免费观看| 久久人人超碰精品| 国产精品人妖ts系列视频 | 不卡视频一二三四| 色综合久久中文综合久久牛| 欧美影院午夜播放| 日韩三级免费观看| 欧美高清一级片在线观看| 中文字幕一区二区三区在线播放| 亚洲精品欧美专区| 蜜臀av亚洲一区中文字幕| 国产一区二区剧情av在线| 91看片淫黄大片一级| 欧美日韩国产片| 26uuu另类欧美亚洲曰本| 国产精品色噜噜| 亚洲一区日韩精品中文字幕| 久久国产免费看| av中文字幕不卡| 91超碰这里只有精品国产| 欧美精品一区二区三区在线播放 | 国产在线国偷精品产拍免费yy| www.亚洲激情.com| 欧美日韩黄色一区二区| 久久免费视频一区| 亚洲综合视频在线观看| 老司机精品视频在线| 99精品视频在线观看| 91精品麻豆日日躁夜夜躁| 中文字幕第一区二区| 午夜激情一区二区三区| 国产91精品一区二区麻豆网站| 在线观看一区日韩| 精品国产凹凸成av人网站| 一区二区三区四区精品在线视频| 精品亚洲国产成人av制服丝袜| 色综合天天综合网天天看片| 精品久久久久99| 亚洲午夜一区二区三区| 粉嫩高潮美女一区二区三区 | 欧美激情一区不卡| 日韩av成人高清| 一本大道av伊人久久综合| 精品久久久久久无| 香蕉久久一区二区不卡无毒影院| 成人高清av在线| 精品国产亚洲在线| 日韩经典一区二区| 91福利在线导航| 国产精品天美传媒沈樵| 精品一区二区三区影院在线午夜 | 欧美性受xxxx| 国产精品成人在线观看| 精彩视频一区二区| 777久久久精品| 一区二区视频在线| 成人av网站在线| 久久久蜜桃精品| 日日夜夜精品视频免费| 91福利区一区二区三区| 麻豆免费精品视频| 91精品综合久久久久久| 亚洲精品中文字幕在线观看| 成人美女在线观看| 久久精品免视看| 精品一区二区三区在线视频| 91精品国产91综合久久蜜臀| 亚洲综合久久av| 色婷婷香蕉在线一区二区| 国产精品免费视频网站| 国产在线麻豆精品观看| 精品国产精品一区二区夜夜嗨| 偷窥国产亚洲免费视频| 欧美亚洲国产一卡| 亚洲精品一二三区| 欧洲亚洲精品在线| 亚洲自拍偷拍图区| 欧美在线制服丝袜| 一区二区三区免费观看| 色综合欧美在线视频区| 亚洲日本va午夜在线电影| av一区二区三区四区| 中文字幕成人av| 成人一区二区三区视频在线观看| 久久精品人人做人人爽97| 精品综合免费视频观看| 精品日产卡一卡二卡麻豆| 免费成人美女在线观看| 日韩精品一区二区三区在线 | 黑人精品欧美一区二区蜜桃| 欧美一区二区三区免费大片 | 激情六月婷婷综合| 国产调教视频一区| 成人免费高清视频| 综合欧美亚洲日本| 色一区在线观看| 午夜视频在线观看一区二区 | 一区二区三区中文免费| 欧美亚洲国产怡红院影院| 亚洲高清免费在线| 欧美一卡2卡三卡4卡5免费| 久久激情综合网| 国产欧美一区二区精品性色超碰 | 3d动漫精品啪啪一区二区竹菊| 日本va欧美va精品发布| 久久这里都是精品| 成人免费看黄yyy456| 亚洲五月六月丁香激情| 午夜精品福利视频网站| 26uuu亚洲综合色| 成人av免费在线播放| 一区二区三区四区高清精品免费观看| 欧美日韩国产首页在线观看| 精品写真视频在线观看| 1000部国产精品成人观看| 欧美亚洲国产一区二区三区va| 麻豆久久久久久| 亚洲欧美福利一区二区| 欧美一区中文字幕| 国产不卡在线一区| 午夜欧美2019年伦理| 久久久综合视频| 色欧美片视频在线观看在线视频| 日韩福利电影在线观看| 中文字幕高清不卡| 欧美日韩免费一区二区三区| 国产久卡久卡久卡久卡视频精品| 日韩美女视频19| 精品国产欧美一区二区| 色综合色狠狠天天综合色| 蜜桃久久久久久久| 1区2区3区国产精品| 日韩视频免费直播| 99国产一区二区三精品乱码| 麻豆视频观看网址久久| 亚洲精品乱码久久久久| 精品不卡在线视频| 欧美伊人久久久久久久久影院 | 青青草国产成人99久久| 国产精品欧美极品| 日韩一区二区三区在线| 色综合天天综合网国产成人综合天| 国产亚洲污的网站| 六月丁香婷婷久久| 欧美日韩在线不卡| 亚洲午夜激情网站| 99国产精品久久| 国产精品视频第一区| 亚洲综合丁香婷婷六月香| 国产99久久久久| 日韩一二三四区| 爽好多水快深点欧美视频| 国产精品系列在线观看| 久久久三级国产网站| 国内精品伊人久久久久av一坑 | 国产精品国产精品国产专区不蜜 | 久久精品国产999大香线蕉| 欧美日韩国产片| 国产不卡视频在线观看| 精品粉嫩aⅴ一区二区三区四区 | 欧美电影精品一区二区| 亚洲猫色日本管| 97久久精品人人爽人人爽蜜臀| 日本高清视频一区二区| 国产一区二区电影| 日本人妖一区二区| 一区二区三区四区亚洲| 国产精品丝袜黑色高跟| 欧美成人精品3d动漫h| 欧美日产国产精品| 色噜噜夜夜夜综合网| heyzo一本久久综合| 国产69精品久久99不卡| 国产一区二区主播在线| 另类小说一区二区三区| 日韩不卡免费视频| 亚洲二区视频在线|