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

📄 uiprg_mgr.h

📁 嵌入工linux开发的源码
💻 H
字号:
#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>

#ifdef __WIN32__
//#define CHIPMOS 
#endif 

/*
	"个人资料",
	"网络通讯",
	"常用工具",
	"系统设置",
	"休闲娱乐",
	"电子书",
*/                    
            
// AppID/100 为AP的类型号
#define  NETCOM_TYPE            1         //   used for refresh icon after download

/*
#ifdef CHIPMOS
//行动学习
#define  YLDICAPP_APPID			1
#define  MEREADER_APPID         2
#define  EBOOK1_APPID           3
#define  EBOOK2_APPID           4
#define  EMDICT_APPID           5
#define  MEDICT_APPID           6

//行动音乐
#define  PLAYER_APPID           101
#define  RECORDER_APPID         102

// 个人资料
#define  VCARD_APPID            201
#define  SCHE_APPID             202
#define  MEMO_APPID             203
#define  TODO_APPID             204
#define  FINANC_APPID           205
// 文件管理器
#define  FILEMGR_APPID          206
// 常用工具
#define  SYNC_APPID             207
// 休闲娱乐
#define  GOBANG_APPID           208
#define  SNAKE_APPID            209

#define  PAINTER_APPID          210
#define  ALARM_APPID            211
#define  CALC_APPID             212
#define  UNIT_APPID             213
#define  CLOCK_APPID            214
#define  EXRATE_APPID           215
#define  MKWORD_APPID           216
#define  METER_APPID            217
#define  DOWNLOAD_APPID         218
#define  SHELL_APPID            219
#define  TESTAPP_APPID          220

// 个性化设置
#define  SYSTEMSET_APPID        301
#define  LOCKSET_APPID          302
#define  VERSION_APPID          303
#define  AUTOOFF_APPID          304
#define  HWSET_APPID            305
#define  LANGSET_APPID          306
#define  DBMGR_APPID            307
#define  NETSET_APPID           308

#else           // no chipmos
*/
// 个人资料
#define  VCARD_APPID            1
#define  SCHE_APPID             2
#define  MEMO_APPID             3
#define  TODO_APPID             5
#define  FINANC_APPID           7
         
// 网络通讯

//"多媒体" 
#define  MEREADER_APPID         101
#define  PLAYER_APPID           102
#define  RECORDER_APPID         103

// 常用工具
#define  SYNC_APPID             201
#define  SHELL_APPID            202
#define  PAINTER_APPID          203
#define  ALARM_APPID            204
#define  CALC_APPID             205
#define  UNIT_APPID             206
#define  CLOCK_APPID            207
#define  EXRATE_APPID           208

#define  DOWNLOAD_APPID           209

#define  MKWORD_APPID           209
#define  METER_APPID            210

#define  TESTAPP_APPID          211

#define  PAINTER1_APPID         212
#define  PAINTER2_APPID         213

//#define  DOWNLOAD_APPID         214
#define  MAILBOX_APPID          215

//词典
#define  EMDICT_APPID           301
#define  MEDICT_APPID           302
#define  YLDICAPP_APPID			303
#define  EBOOK1_APPID           304
#define  EBOOK2_APPID           305

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

// 系统设置
#define  SYSTEMSET_APPID        501
#define  LOCKSET_APPID          502
#define  VERSION_APPID          503
#define  NETSET_APPID           504
#define  AUTOOFF_APPID          505
#define  HWSET_APPID            506
#define  FILEMGR_APPID          507
#define  LANGSET_APPID          508
#define  DBMGR_APPID            509


//#endif

/**************************************************************
	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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -