Beispiel #1
0
/*
 * 功能:用于对LCUI进行初始化操作
 * 说明:每个使用LCUI实现图形界面的程序,都需要先调用此函数进行LCUI的初始化
 * */
int LCUI_Init(void)
{
	if( System.is_inited ) {
		return -1;
	}
	System.is_inited = TRUE;
	System.func_atexit = NULL;
	System.exit_code = 0;
	System.state = STATE_ACTIVE;
	System.main_tid = LCUIThread_SelfID();
	LCUI_ShowCopyrightText();
	LCUIApp_Init();
	/* 初始化各个模块 */
	LCUI_InitEvent();
	LCUI_InitFont();
	LCUI_InitTimer();
	LCUI_InitDevice();
	LCUI_InitKeyboard();
	LCUI_InitMouse();
	LCUI_InitCursor();
	LCUI_InitWidget();
	LCUI_InitDisplay();
	{
		LCUI_Pos pos;
		pos.x = LCUIDisplay_GetWidth()/2;
		pos.y = LCUIDisplay_GetHeight()/2;
		/* 让鼠标游标居中显示 */
		LCUICursor_SetPos( pos );
		LCUICursor_Show();
	}
	return 0;
}
Beispiel #2
0
/* 
 * 功能:创建一个LCUI程序
 * 说明:此函数会将程序信息添加至程序列表
 * 返回值:成功则返回程序的ID,失败则返回-1
 **/
static int LCUIAppList_Add( void )
{
	LCUI_App app;
	
	LCUIApp_Init (&app); /* 初始化程序数据结构体 */
	app.id	= LCUIThread_SelfID(); /* 保存ID */ 
	Queue_Add(&LCUI_Sys.app_list, &app); /* 添加至队列 */
	LCUIApp_RegisterMainThread( app.id ); /* 注册程序主线程 */
	return 0;
}