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

📄 type.h

📁 手机开发环境BREW实例
💻 H
字号:
#ifndef TYPE_H
#define TYPE_H


#include "AEEModGen.h"          // Module interface definitions
#include "AEEAppGen.h"          // Applet interface definitions
#include "AEEShell.h"           // Shell interface definitions
#include "AEEFile.h"			// File interface definitions
#include "AEENet.h"				// Socket interface definitions
#include "AEEGraphics.h"		//Graphics接口类型定义s
#include "AEEError.h"			// Error Code Definitions 

#include "HandBeans.bid"		//Class ID
#include "assert.h"



typedef boolean BOOL;
typedef byte    BYTE;
typedef uint32  DWORD;


#define BLOCK_SIZE		12//基本块尺寸(正方形)
#define MAX_GRID		10//网格个数(10 x 10)

//服务器
#define SERVER_IP		("192.168.0.104")
#define SERVER_PORT		(0xD056)//是(WORD)22224的网络字节序


#define SHOW_ERROR_MEG(pvAppData, content)\
	IDISPLAY_DrawText(((SAppData*)pvAppData)->sApp.m_pIDisplay,\
		AEE_FONT_BOLD,\
		L##content,\
		-1,\
		0,\
		0,\
		NULL,\
		IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);\
	IDISPLAY_Update(((SAppData*)pvAppData)->sApp.m_pIDisplay)

//要发送的数据包
typedef struct
{
	BYTE pbtPack4Send[2];//pbtPack4Send[0]表示上下(1下,-1上,0不动), pbtPack4Send[1]表示左右(1右,-1左,0不动)
	BOOL bBomb;//是否布雷
}SSendPack;

typedef struct
{
	AEEApplet		sApp;
	BYTE			pbtGrid[MAX_GRID][MAX_GRID];

	IGraphics*		pIGraphics;		//Graphics控件

	INetMgr *		pINetMgr;		//NetManager控件
	ISocket *		pISocket;		//Socket控件
	AEECallback     psDNSCallBack;	//异步得到IP地址值的回调函数及其它数据
	AEEDNSResult	sDNSResult;		//得到IP地址值操作的结杲值
//发送数据包
	SSendPack		sSendPack;		//要发送给服务器的数据包。
	BYTE			btSendedLen;	//pbtPack4Send[2]已经发送了的长度(如果一次没有发完)
//接收数据包
	//...pbtGrid[MAX_GRID][MAX_GRID]//直接就是接收缓冲区
	DWORD			dwRecvedLen;	//已经接收了的长度(如果一次没有接收完整个pbtGrid[MAX_GRID][MAX_GRID])


//其它数据
	AEEPoint		ps5Point[5];	//五角星五个顶点



}SAppData;




//接口定义
//显示
extern void RefurbishScreen(SAppData* psApp);
//网络
extern void OnHostName(void *pvAppData);


#endif

⌨️ 快捷键说明

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