Пример #1
0
static int clear_20(struct pvm_object me , struct data_area_4_thread *tc )
{
    struct data_area_4_tty      *da = pvm_data_area( me, tty );

    DEBUG_INFO;

    da->x = da->y = 0;

    w_fill( &(da->w), da->bg );
    drv_video_window_update( &(da->w) );

    SYSCALL_RETURN_NOTHING;
}
Пример #2
0
void win_make_decorations(drv_video_window_t *w)
{
    if(!(w->flags & WFLAG_WIN_DECORATED) ) return;

    w_assert_lock();

    int zless = (w->z == 0) ? 0 : (w->z - 1);

    if( 0 == w->w_decor)
    {
#if VIDEO_T_IN_D
        int dysize = w->ysize+bordr_size*3+title_size;
#else
        int dysize = w->ysize+bordr_size*2;
#endif
        drv_video_window_t *w2 = private_drv_video_window_create(w->xsize+bordr_size*2, dysize );

        w2->flags |= WFLAG_WIN_NOTINALL; // On destroy don't try to remove from allwindows
        w2->w_owner = w;
        w->w_decor = w2;

#if VIDEO_T_IN_D
        int bmp_y = w->ysize + bordr_size*2 + 2;
        // close button with id=1
        w_add_button( w->w_decor, 1, 5, bmp_y, &close_bmp, &close_pressed_bmp, 0 );
#endif
    }

    w->w_decor->x = w->x-bordr_size;
    w->w_decor->y = w->y-bordr_size;
    w->w_decor->z = zless;

    w->w_decor->bg = w->bg;

    w_fill( w->w_decor, w->w_decor->bg );


#if !VIDEO_T_IN_D

    if(w->w_title == 0)
    {
        drv_video_window_t *w3 =
            private_drv_video_window_create(
                                            w->xsize+bordr_size*2,
                                            title_size+bordr_size*2
                                           );

        //w3->flags |= WFLAG_WIN_NOTINALL; // On destroy don't try to remove from allwindows
        drv_video_window_enter_allwq(w3);


        w3->inKernelEventProcess = w_titleWindowEventProcessor;

        w3->w_owner = w;
        w->w_title = w3;

        int bwidth = close_bmp.xsize;
        int bxp = w->w_title->xsize - bwidth - 5;
        // close button with id=1
        w_add_button( w->w_title, WBUTTON_SYS_CLOSE, bxp, 5, &close_bmp, &close_pressed_bmp, 0 );
        bxp -= bwidth + 2;
        // roll up button
        w_add_button( w->w_title, WBUTTON_SYS_ROLLUP, bxp, 5, &rollup_bmp, &rollup_pressed_bmp, 0 );
    }

    w->w_title->x = w->x-bordr_size;
    w->w_title->y = w->y+w->ysize; //+bordr_size;
    w->w_title->z = zless;

    int focused = w->state & WSTATE_WIN_FOCUSED;
    if( w->w_title && w->w_title->state & WSTATE_WIN_FOCUSED) focused = 1;

    w->w_title->bg = focused ? title_back_color_focus : title_back_color_nofocus;

    //w_fill( w->w_title, w->w_title->bg );

    //drv_video_bitmap_t *tbmp = focused ?  &title_brown_bmp : &title_green_bmp;
    drv_video_bitmap_t *tbmp = focused ?  &title_violet_bmp : &title_green_bmp;
    w_replicate_hor( w->w_title, 3, 3, w->w_title->xsize, tbmp->pixel, tbmp->ysize );

    window_basic_border( w->w_title, brdr, bordr_size );

    // BUG! It must be +3, not -1 on Y coord!
    w_font_draw_string( w->w_title, &drv_video_8x16cou_font,
                                w->title, COLOR_BLACK, COLOR_TRANSPARENT,
                                bordr_size+3, bordr_size-1 );

    //drv_video_window_draw_bitmap( w->w_title, w->w_title->xsize - close_bmp.xsize - 5, 5, &close_bmp );
    //drv_video_window_draw_bitmap( w->w_title, w->w_title->xsize - pin_bmp.xsize - 2 - close_bmp.xsize - 5, 5, &pin_bmp );

    if( w->state & WSTATE_WIN_VISIBLE )
        _drv_video_winblt_locked(w->w_title);
    //drv_video_window_free(w3);
#else
    w->w_decor->inKernelEventProcess = titleWindowEventProcessor;

    int focused = w->state & WSTATE_WIN_FOCUSED;
    if( w->w_decor && w->w_decor->state & WSTATE_WIN_FOCUSED) focused = 1;

    color_t bg = focused ? title_back_color_focus : title_back_color_nofocus;

    rect_t r;
    r.x = bordr_size;
    r.y = w->ysize + bordr_size*2;
    r.xsize = w->xsize;
    r.ysize = title_size;

    w_fill_rect( w->w_decor, bg, r );


    int bmp_y = w->ysize + bordr_size*2 + 2;

    w_font_draw_string( w->w_decor, &drv_video_8x16cou_font,
                                w->title, COLOR_BLACK, COLOR_TRANSPARENT,
                                bordr_size+3, bmp_y-4 );

    drv_video_window_draw_bitmap( w->w_decor, w->w_decor->xsize - close_bmp.xsize - 5, bmp_y, &close_bmp );
    drv_video_window_draw_bitmap( w->w_decor, w->w_decor->xsize - pin_bmp.xsize - 2 - close_bmp.xsize - 5, bmp_y, &pin_bmp );


    // nSteps is x size, srcSize is y size
    w_replicate_hor( w->w_decor, 0, w->ysize + bordr_size,
                           w->w_decor->xsize, brdr, bordr_size );

#endif

    w_repaint_buttons(w->w_decor);
    w_repaint_buttons(w->w_title);

    //drv_video_window_draw_bitmap( w->w_decor, 5, bmp_y, &close_bmp );


    window_basic_border( w->w_decor, brdr, bordr_size );

    if( (!(w->state & WSTATE_WIN_ROLLEDUP)) && (w->state & WSTATE_WIN_VISIBLE) )
        _drv_video_winblt_locked(w->w_decor);


    // replace setting pos here with
    //win_move_decorations(w);

}
Пример #3
0
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);
}
Пример #4
0
void
w_clear( window_handle_t win )
{
    w_fill( win, COLOR_BLACK );
}