Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
pfly.c
Package: pfly523.rar [view]
Upload User: shyhai1508
Upload Date: 2007-06-11
Package Size: 48k
Code Size: 3k
Category:
BREW
Development Platform:
Visual C++
- #include "pfly.h"
- #include "AEEStdLib.h"
- #include "pfly.bid"
- #include "commondef.h"
- static boolean Pfly_HandleEvent(PflyApp * pme, AEEEvent eCode,uint16 wParam, uint32 dwParam);
- static boolean Pfly_Init(PflyApp *pMe);
- static void Pfly_Free(PflyApp *pMe);
- boolean Pfly_SetActiveWnd(PflyApp *pMe, int wnd)
- {
- switch(pMe->activeView) {
- case IDW_GAME:
- GameWnd_Close(&pMe->game);
- break;
- case IDW_GAMEEND:
- GameEndWnd_Close(&pMe->end);
- break;
- case IDW_MAINMENU:
- MainMenuWnd_Close(&pMe->mainMenu);
- break;
- case IDW_SCORELIST:
- ScoreListWnd_Close(&pMe->score);
- break;
- default:
- break;
- }
- pMe->activeView = wnd;
- switch(pMe->activeView) {
- case IDW_GAME:
- return GameWnd_Open(&pMe->game);
- case IDW_GAMEEND:
- return GameEndWnd_Open(&pMe->end);
- case IDW_MAINMENU:
- return MainMenuWnd_Open(&pMe->mainMenu);
- case IDW_SCORELIST:
- return ScoreListWnd_Open(&pMe->score);
- default:
- return FALSE;
- }
- }
- int AEEClsCreateInstance(AEECLSID ClsId,IShell * pIShell,IModule * pMod,void ** ppObj)
- {
- *ppObj = NULL;
- if (!AEEApplet_New(sizeof(PflyApp), // Size of our private class
- ClsId, // Our class ID
- pIShell, // Shell interface
- pMod, // Module instance
- (IApplet**)ppObj, // Return object
- (AEEHANDLER)Pfly_HandleEvent, // Our event handler
- (PFNFREEAPPDATA)Pfly_Free))
- return EFAILED;
- return SUCCESS;
- }
- static boolean Pfly_HandleEvent(PflyApp * pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
- {
- switch (eCode) {
- case EVT_APP_START:
- if (Pfly_Init(pMe) != TRUE) {
- return FALSE;
- }
- return Pfly_SetActiveWnd(pMe, IDW_MAINMENU);
- case EVT_APP_STOP:
- return TRUE;
- default:
- switch(pMe->activeView) {
- case IDW_GAME:
- return GameWnd_HandleEvent(&pMe->game, eCode, wParam, dwParam);
- case IDW_MAINMENU:
- return MainMenuWnd_HandleEvent(&pMe->mainMenu, eCode, wParam, dwParam);
- case IDW_GAMEEND:
- return GameEndWnd_HandleEvent(&pMe->end, eCode, wParam, dwParam);
- case IDW_SCORELIST:
- return ScoreListWnd_HandleEvent(&pMe->score, eCode, wParam, dwParam);
- default:
- break;
- }
- }
- return FALSE;
- }
- static boolean Pfly_Init(PflyApp *pMe)
- {
- pMe->activeView = IDW_NOWND;
- if (GameWnd_New(&pMe->game, pMe) != TRUE) {
- return FALSE;
- }
- if (MainMenuWnd_New(&pMe->mainMenu, pMe) != TRUE) {
- return FALSE;
- }
- if (GameEndWnd_New(&pMe->end, pMe) != TRUE) {
- return FALSE;
- }
- if (ScoreListWnd_New(&pMe->score, pMe) != TRUE) {
- return FALSE;
- }
- return TRUE;
- }
- static void Pfly_Free(PflyApp *pMe)
- {
- GameWnd_Free(&pMe->game);
- MainMenuWnd_Free(&pMe->mainMenu);
- GameEndWnd_Free(&pMe->end);
- ScoreListWnd_Free(&pMe->score);
- }