Subversion Repositories HelenOS

Rev

Rev 3675 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3675 Rev 4377
Line 95... Line 95...
95
static void clear(void)
95
static void clear(void)
96
{
96
{
97
    async_msg_0(fbphone, FB_CLEAR);
97
    async_msg_0(fbphone, FB_CLEAR);
98
}
98
}
99
 
99
 
100
static void set_style(int fgcolor, int bgcolor)
100
static void set_rgb_color(int fgcolor, int bgcolor)
101
{
101
{
102
    async_msg_2(fbphone, FB_SET_STYLE, fgcolor, bgcolor);
102
    async_msg_2(fbphone, FB_SET_RGB_COLOR, fgcolor, bgcolor);
103
}
103
}
104
 
104
 
105
/** Transparent putchar */
105
/** Transparent putchar */
106
static void tran_putch(char c, int row, int col)
106
static void tran_putch(char c, int row, int col)
107
{
107
{
108
    async_msg_3(fbphone, FB_TRANS_PUTCHAR, c, row, col);
108
    async_msg_3(fbphone, FB_PUTCHAR, c, row, col);
109
}
109
}
110
 
110
 
111
/** Redraw the button showing state of a given console */
111
/** Redraw the button showing state of a given console */
112
static void redraw_state(int consnum)
112
static void redraw_state(int consnum)
113
{
113
{
Line 215... Line 215...
215
}
215
}
216
 
216
 
217
/** Change to kernel console */
217
/** Change to kernel console */
218
void gcons_in_kernel(void)
218
void gcons_in_kernel(void)
219
{
219
{
220
    if (console_state[active_console] == CONS_DISCONNECTED_SEL)
-
 
221
        console_state[active_console] = CONS_DISCONNECTED;
-
 
222
    else
-
 
223
        console_state[active_console] = CONS_IDLE;
-
 
224
    redraw_state(active_console);
-
 
225
 
-
 
226
    if (animation != -1)
220
    if (animation != -1)
227
        async_msg_1(fbphone, FB_ANIM_STOP, animation);
221
        async_msg_1(fbphone, FB_ANIM_STOP, animation);
228
 
222
   
229
    active_console = KERNEL_CONSOLE; /* Set to kernel console */
223
    active_console = KERNEL_CONSOLE;
230
    vp_switch(0);
224
    vp_switch(0);
231
}
225
}
232
 
226
 
233
/** Return x, where left <= x <= right && |a-x|==min(|a-x|) is smallest */
227
/** Return x, where left <= x <= right && |a-x|==min(|a-x|) is smallest */
234
static inline int limit(int a,int left, int right)
228
static inline int limit(int a,int left, int right)
Line 340... Line 334...
340
 
334
 
341
extern char _binary_helenos_ppm_start[0];
335
extern char _binary_helenos_ppm_start[0];
342
extern int _binary_helenos_ppm_size;
336
extern int _binary_helenos_ppm_size;
343
extern char _binary_nameic_ppm_start[0];
337
extern char _binary_nameic_ppm_start[0];
344
extern int _binary_nameic_ppm_size;
338
extern int _binary_nameic_ppm_size;
-
 
339
 
345
/** Redraws console graphics  */
340
/** Redraws console graphics */
346
static void gcons_redraw_console(void)
341
void gcons_redraw_console(void)
347
{
342
{
348
    int i;
343
    int i;
349
 
344
   
350
    if (!use_gcons)
345
    if (!use_gcons)
351
        return;
346
        return;
352
   
347
   
353
    vp_switch(0);
348
    vp_switch(0);
354
    set_style(MAIN_COLOR, MAIN_COLOR);
349
    set_rgb_color(MAIN_COLOR, MAIN_COLOR);
355
    clear();
350
    clear();
356
    draw_pixmap(_binary_helenos_ppm_start,
351
    draw_pixmap(_binary_helenos_ppm_start,
357
        (size_t) &_binary_helenos_ppm_size, xres - 66, 2);
352
        (size_t) &_binary_helenos_ppm_size, xres - 66, 2);
358
    draw_pixmap(_binary_nameic_ppm_start,
353
    draw_pixmap(_binary_nameic_ppm_start,
359
        (size_t) &_binary_nameic_ppm_size, 5, 17);
354
        (size_t) &_binary_nameic_ppm_size, 5, 17);
Line 464... Line 459...
464
 
459
   
465
    rc = async_req_0_2(phone, FB_GET_RESOLUTION, &xres, &yres);
460
    rc = async_req_0_2(phone, FB_GET_RESOLUTION, &xres, &yres);
466
    if (rc)
461
    if (rc)
467
        return;
462
        return;
468
   
463
   
469
    if (xres < 800 || yres < 600)
464
    if ((xres < 800) || (yres < 600))
470
        return;
465
        return;
471
 
466
   
472
    /* create console viewport */
467
    /* create console viewport */
473
    /* Align width & height to character size */
468
    /* Align width & height to character size */
474
    console_vp = vp_create(CONSOLE_MARGIN, CONSOLE_TOP,
469
    console_vp = vp_create(CONSOLE_MARGIN, CONSOLE_TOP,
Line 484... Line 479...
484
            i * (STATUS_WIDTH + STATUS_SPACE), STATUS_TOP,
479
            i * (STATUS_WIDTH + STATUS_SPACE), STATUS_TOP,
485
            STATUS_WIDTH, STATUS_HEIGHT);
480
            STATUS_WIDTH, STATUS_HEIGHT);
486
        if (cstatus_vp[i] < 0)
481
        if (cstatus_vp[i] < 0)
487
            return;
482
            return;
488
        vp_switch(cstatus_vp[i]);
483
        vp_switch(cstatus_vp[i]);
489
        set_style(0x202020, 0xffffff);
484
        set_rgb_color(0x202020, 0xffffff);
490
    }
485
    }
491
   
486
   
492
    /* Initialize icons */
487
    /* Initialize icons */
493
    ic_pixmaps[CONS_SELECTED] =
488
    ic_pixmaps[CONS_SELECTED] =
494
        make_pixmap(_binary_cons_selected_ppm_start,
489
        make_pixmap(_binary_cons_selected_ppm_start,
Line 513... Line 508...
513
    gcons_redraw_console();
508
    gcons_redraw_console();
514
}
509
}
515
 
510
 
516
/** @}
511
/** @}
517
 */
512
 */
518
 
-