uiprg_mgr.h.bak

来自「一个PDA GUI系统的源码」· BAK 代码 · 共 240 行

BAK
240
字号
#ifndef PR2K_PRG_MGR_H
#define PR2K_PRG_MGR_H


/**************************************************************
	INLCUDE FILE
**************************************************************/
#include <uiwnd.h>
#include <sys/syscall.h>
#include <sys/loadap.h>
#include <uiCallback.h>

/*
	"个人资料",
	"网络通讯",
	"常用工具",
	"系统设置",
	"休闲娱乐",
	"电子书",
*/                    
            
// AppID/100 为AP的类型号

// 个人资料
#define  VCARD_APPID            1
#define  SCHE_APPID             2
#define  MEMO_APPID             3
#define  TODO_APPID             5
#define  FINANC_APPID           7

// 网络通讯
#define  DOWNLOAD_APPID         101
#define  SYNC_APPID             102
#define  MAILBOX_APPID          103
#define  SHELL_APPID            104

#define  NETCOM_TYPE            1         //   used for refresh icon after download

// 常用工具

#define  CALC_APPID             201
#define  UNIT_APPID             202
#define  CLOCK_APPID            203
#define  EXRATE_APPID           204
#define  PAINTER_APPID          205
#define  MKWORD_APPID           206
#define  METER_APPID            207
#define  TESTAPP_APPID          208

// 系统设置
#define  SYSTEMSET_APPID        301
#define  LOCKSET_APPID          302
#define  VERSION_APPID          303
#define  NETSET_APPID           304
#define  AUTOOFF_APPID          305
#define  HWSET_APPID            306
#define  FILEMGR_APPID          307
#define  LANGSET_APPID          308

// 休闲娱乐
#define  GOBANG_APPID           401
#define  SNAKE_APPID            402

// 电子书
#define  EBOOK1_APPID           501
#define  EBOOK2_APPID           502

//"多媒体" 
#define  PLAYER_APPID           601
#define  RECORDER_APPID         602

//词典
#define  ECDICT_APPID           701
#define  CEDICT_APPID           702
 

/**************************************************************
	CONSTANT
**************************************************************/
#define CLEANUP_BY_PM

#define MAX_APP_NAME_LENGTH     20

#define PRG_MGR_INTERNAL_APP    0
#define PRG_MGR_EXTERNAL_APP    1

#define GUI_DEFAULT_STACK_SIZE (10*1024)

// App-Icon的长宽
#define PM_ICON_WIDTH 			28
#define PM_ICON_HEIGHT 			28             

#define MAX_SHORTCUT_NUMBER     8

//#define FNAME_LOADEDAP "NF:LoadedAp.sys"
#define FNAME_LOADEDAP "A:\\LoadedAp.sys"

/**************************************************************
	External Variable
**************************************************************/
// program manager's window handle (defined in win_thd.c )
extern unsigned long PgrMgrWinHandle ;

// program manager's thread id
extern int PgrMgrThreadID ;

// 指到current application之data structure的指标
extern struct tagPM_APP * CurrentApp ;

// 纪录所有application的串列  
extern struct dLinkList ApplicationList ;


/**************************************************************
	DATA STRUCTURE
**************************************************************/

/*
typedef struct tagLoadApp
{
	unsigned char name[DL_FNAME_MAX_LEN];	    // FILENAME
	unsigned char * memSpace ;              // memory space occupied
	unsigned int size ;                 	// memory size  occupied
	unsigned char * entry ;                 // app entry point
}TLoadApp;
*/

// program manager会记录目前所有的application的细部资料   
typedef struct tagPM_APP 
{
	DWORD handle;			// app handle
	char appName[LANGUAGE_NUM][MAX_APP_NAME_LENGTH];
	int mainThreadID ;		// 一个app中负责处理application loop的thread id 
	DWORD currentWinHandle ;// 这个app目前最上层的windows handle 
	BYTE * iconBitmap ;	
	WORD type ;				// internal app or external app
	WORD classs;  			// app的种类(e.g. game, PIM...)
	TLoadApp runtimeInfo;	// 纪录application的系统资讯, 包含执行档名称, entry point...   
	DWORD stackSize ;
	PF_VOID keyFun[GUI_MAX_KEY_NUMBER] ;
	int (*action)(TGuiMessage *msg); // action function for APP
//	PGM_AP_CMD	apCmd;		// app command
}TPM_APP;


//记录AP的各种语言名称

typedef struct tagAppName 
{
	//char szName_GB[MAX_APP_NAME_LENGTH];
	char szName[LANGUAGE_NUM][MAX_APP_NAME_LENGTH];
} TAppName;



/**************************************************************
	FUNCTION DECLARATION
**************************************************************/
//
//  初始化application list
//
DLL_EXP(int) guiInitPrgMgr(void);

//
// 加入一个新的internal application到program managet的menu中        
// (会和kernel连结在一起的称作internal application)    
//
//  return -1 if something error
//
DLL_EXP(int) guiAddInternalApp(BYTE * iconBuffer,PF_VOID entryPoint, TAppName App_Name, int classs,DWORD stackSize) ;

//
// 加入一个新的external application到program managet的menu中  
// (动态载入的应用程式称作external application)    
//
//  return -1 if something error
//
DLL_EXP(STATUS) guiAddExternalApp(const char *szFileName);


DLL_EXP(int) guiRegisterExApp(char * szFileName);

//
// 自program manager中注销一个application
// (系统会回收其所占据的系统资源   )     
//
DLL_EXP(int) guiUnRegisterExApp(char *szFileName);

//
// 停止应用程式 并回收其所占据的系统资源
//
//
DLL_EXP(int) guiKillApp(DWORD handle);

//
// 执行应用程式
//
DLL_EXP(int) guiLaunchApp(DWORD handle);


//
// 通知程式管理员 目前应用程式需要返回程式管理员
//
DLL_EXP(void) guiBack2PrgMgr(void) ;

DLL_EXP(userThread) guiProgramManager(void) ;

//
// callback function of default paogram manager 
//
#ifdef GUI_USE_DEFAULT_PRG_MGR

#ifdef __WIN32__
	extern void (*guiCreateDefaultAppsEmu)(void) ;
  #else
	extern void guiCreateDefaultApps(void) ;
  #endif

#endif

	extern userThread VcardsThreadApp(void);

DLL_EXP(void) guiSetPrgMgrWinHandle(DWORD);
DLL_EXP(DWORD) guiGetPrgMgrWinHandle(void);

DLL_EXP(int) guiGetPrgMgrThreadID(void);
DLL_EXP(struct dLinkList*) guiGetAppList(void);
// Emulator 才需要
#ifdef __WIN32__
  DLL_EXP(void) SetPgrMgrThreadID(int PgrMgrTID);
#endif

int guiCreateExternalApps(void) ;     

//DLL_EXP(int) registerAppShortcut(int n, PF_VOID entryPoint);    // by zhang xue ping
DLL_EXP(int) registerAppShortcut(int n, int AppID);    // by zhang xue ping
DLL_EXP(int) guiRegistergaKeyAppID(int keyType, int appID) ;

#endif

⌨️ 快捷键说明

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