spectra
1.0.0
具有图形用户界面的64位操作系统内核。


托多
这是一个使用控制面板创建500 x 500 GUI窗口的演示,并展示如何处理用户事件。
#include "stdio.h"
#include "unistd.h"
#include "stdlib.h"
#include "string.h"
#include "gui/gui.h"
#include "gui/label.h"
#include "window/window.h"
#include "messages.h"
#include "assets/color.h"
int main ( int argc , char * * argv )
{
uint32_t width = 500 ;
uint32_t height = 500 ;
int32_t x = 150 ;
int32_t y = 100 ;
int id = 1 ;
const char * title = "demo" ;
demo_win = create_gui_window ( 0 , width , height , x , y , 0 , id , title , 0 , 0 );
if (! demo_win )
{
printf ( "create window fail!n" );
return 0 ;
}
create_window_control_panel ( demo_win , 2 );
struct message * msg = ( struct message * ) malloc ( sizeof ( struct message ));
char ch ;
while ( 1 )
{
window_get_message ( shell_win , msg );
switch ( msg -> event )
{
case MESSAGE_KEY_PRESS :
ch = ( char ) msg -> key ;
// handle keyboard
default :
window_consume ( shell_win , msg );
break ;
}
if ( demo_win -> state == WINDOW_CLOSE ) break ;
}
// ...
return 0 ;
}[✔]文件系统
[✔] ext2读取/stat/close/seek
[✔]过程/多任务处理
[✔] PS2键盘
[✔]鼠标驱动程序
[✔]消息队列处理事件
[✔]图形用户界面
[✔] TGA图像文件支持
[✔]精灵加载器
程序