void videotest(void) { drv_video_window_t *w = drv_video_window_create( WXS, WYS, 300, 300, COLOR_BLACK, "Test Window", WFLAG_WIN_DECORATED ); drv_video_winblt( w ); drv_win_screen_update(); getchar(); w_draw_line( w, 0, 0, WXS, WYS, COLOR_RED ); w_fill_ellipse( w, 30, 30, 15, 27, COLOR_BLUE ); w_font_draw_string( w, &drv_video_8x16san_font, "Test font", COLOR_BLACK, COLOR_GREEN, 0, 0 ); w_fill_box( w, 40, 32, 33, 10, COLOR_RED ); drv_video_winblt( w ); drv_win_screen_update(); getchar(); }
void phantom_init_console_window() { hal_mutex_init( &buf_mutex, "console" ); console_fg = COLOR_LIGHTGRAY; console_bg = COLOR_BLACK; int xsize = 620, ysize = 300; int cw_x = 50, cw_y = 450; if( scr_get_ysize() < 600 ) { cw_x = cw_y = 0; } drv_video_window_t *w = drv_video_window_create( xsize, ysize, cw_x, cw_y, console_bg, "Console", WFLAG_WIN_DECORATED|WFLAG_WIN_DOUBLEBUF ); phantom_console_window = w; w->owner = get_current_tid(); phantom_set_console_ops( &win_ops ); phantom_console_window_puts("Phantom console window\n"); phantom_debug_window = drv_video_window_create( DEBWIN_XS, DEBWIN_YS, DEBWIN_X, DEBWIN_Y, console_bg, "Threads", WFLAG_WIN_DECORATED|WFLAG_WIN_DOUBLEBUF|WFLAG_WIN_FULLPAINT ); //phantom_debug_window->flags |= WFLAG_WIN_DOUBLEBUF|WFLAG_WIN_FULLPAINT; //w_update( phantom_debug_window ); // For dbl buf flags to start working ok phantom_debug_window_puts("Phantom debug window\n\nt - threads\nw - windows\ns - stats\np - profiler\n"); w_update( phantom_debug_window ); //hal_sleep_msec(4000); hal_start_kernel_thread(phantom_debug_window_loop); // ------------------------------------------------------------------- // Launcher window // ------------------------------------------------------------------- color_t la_bg = { 0x19, 0x19, 0x19, 0xFF }; color_t la_b1 = { 68, 66, 62, 0xFF }; color_t la_b2 = { 88, 84, 79, 0xFF }; color_t la_txt = { 0x11, 0xd5, 0xff, 0xFF }; //#define BTEXT_COLOR COLOR_YELLOW #define BTEXT_COLOR la_txt phantom_launcher_window = drv_video_window_create( scr_get_xsize(), 32, 0, 0, console_bg, "Launcher", WFLAG_WIN_ONTOP ); phantom_launcher_window->inKernelEventProcess = phantom_launcher_event_process; w_fill( phantom_launcher_window, la_bg ); int lb_x = scr_get_xsize(); lb_x -= power_button_sm_bmp.xsize + 5; w_add_button( phantom_launcher_window, -1, lb_x, 2, &power_button_sm_bmp, &power_button_pressed_sm_bmp, BUTTON_FLAG_NOBORDER ); pool_handle_t bh; lb_x = 5; int nwin = 0; for( nwin = 0; nwin < MAX_LAUNCH_BUTTONS; nwin++ ) { char * wname = "win1"; // crashes in some configurations?? //wname[3] = '0' + nwin; bh = w_add_button( phantom_launcher_window, nwin, lb_x, 5, &task_button_bmp, &task_button_bmp, BUTTON_FLAG_NOBORDER ); w_button_set_text( phantom_launcher_window, bh, wname, BTEXT_COLOR ); lb_x += 5+task_button_bmp.xsize; taskbuttons[nwin] = bh; } w_draw_line( phantom_launcher_window, 0, 31, scr_get_xsize(), 31, la_b1 ); w_draw_line( phantom_launcher_window, 0, 30, scr_get_xsize(), 30, la_b2 ); w_update( phantom_launcher_window ); //hal_start_kernel_thread(phantom_launcher_window_loop); }