Subversion Repositories HelenOS-historic

Rev

Rev 1610 | Rev 1647 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1610 Rev 1646
Line 68... Line 68...
68
 
68
 
69
static int fbphone;
69
static int fbphone;
70
 
70
 
71
/** List of pixmaps identifying these icons */
71
/** List of pixmaps identifying these icons */
72
static int ic_pixmaps[CONS_LAST] = {-1,-1,-1,-1,-1,-1};
72
static int ic_pixmaps[CONS_LAST] = {-1,-1,-1,-1,-1,-1};
-
 
73
static int animation = -1;
73
 
74
 
74
static int active_console = 0;
75
static int active_console = 0;
75
 
76
 
76
static void vp_switch(int vp)
77
static void vp_switch(int vp)
77
{
78
{
Line 317... Line 318...
317
    munmap(shm, size);
318
    munmap(shm, size);
318
 
319
 
319
    return pxid;
320
    return pxid;
320
}
321
}
321
 
322
 
-
 
323
extern char _binary_anim_1_ppm_start[0];
-
 
324
extern int _binary_anim_1_ppm_size;
-
 
325
extern char _binary_anim_2_ppm_start[0];
-
 
326
extern int _binary_anim_2_ppm_size;
-
 
327
extern char _binary_anim_3_ppm_start[0];
-
 
328
extern int _binary_anim_3_ppm_size;
-
 
329
extern char _binary_anim_4_ppm_start[0];
-
 
330
extern int _binary_anim_4_ppm_size;
-
 
331
static void make_anim(void)
-
 
332
{
-
 
333
    int an;
-
 
334
    int pm;
-
 
335
 
-
 
336
    an = async_req(fbphone, FB_ANIM_CREATE, cstatus_vp[KERNEL_CONSOLE], NULL);
-
 
337
    if (an < 0)
-
 
338
        return;
-
 
339
 
-
 
340
    pm = make_pixmap(_binary_anim_1_ppm_start, (int)&_binary_anim_1_ppm_size);
-
 
341
    async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
-
 
342
 
-
 
343
    pm = make_pixmap(_binary_anim_2_ppm_start, (int)&_binary_anim_2_ppm_size);
-
 
344
    async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
-
 
345
 
-
 
346
    pm = make_pixmap(_binary_anim_3_ppm_start, (int)&_binary_anim_3_ppm_size);
-
 
347
    async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
-
 
348
 
-
 
349
    pm = make_pixmap(_binary_anim_4_ppm_start, (int)&_binary_anim_4_ppm_size);
-
 
350
    async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
-
 
351
 
-
 
352
    async_msg(fbphone, FB_ANIM_START, an);
-
 
353
 
-
 
354
    animation = an;
-
 
355
}
-
 
356
 
322
extern char _binary_cons_selected_ppm_start[0];
357
extern char _binary_cons_selected_ppm_start[0];
323
extern int _binary_cons_selected_ppm_size;
358
extern int _binary_cons_selected_ppm_size;
324
extern char _binary_cons_idle_ppm_start[0];
359
extern char _binary_cons_idle_ppm_start[0];
325
extern int _binary_cons_idle_ppm_size;
360
extern int _binary_cons_idle_ppm_size;
326
extern char _binary_cons_has_data_ppm_start[0];
361
extern char _binary_cons_has_data_ppm_start[0];
Line 330... Line 365...
330
/** Initialize nice graphical console environment */
365
/** Initialize nice graphical console environment */
331
void gcons_init(int phone)
366
void gcons_init(int phone)
332
{
367
{
333
    int rc;
368
    int rc;
334
    int i;
369
    int i;
-
 
370
    int status_start = STATUS_START;
335
 
371
 
336
    fbphone = phone;
372
    fbphone = phone;
337
 
373
 
338
    rc = ipc_call_sync_2(phone, FB_GET_RESOLUTION, 0, 0, &xres, &yres);
374
    rc = ipc_call_sync_2(phone, FB_GET_RESOLUTION, 0, 0, &xres, &yres);
339
    if (rc)
375
    if (rc)
Line 349... Line 385...
349
                   ALIGN_DOWN(yres-(CONSOLE_TOP+CONSOLE_MARGIN),16));
385
                   ALIGN_DOWN(yres-(CONSOLE_TOP+CONSOLE_MARGIN),16));
350
    if (console_vp < 0)
386
    if (console_vp < 0)
351
        return;
387
        return;
352
   
388
   
353
    /* Create status buttons */
389
    /* Create status buttons */
-
 
390
    status_start += (xres-800) / 2;
354
    for (i=0; i < CONSOLE_COUNT; i++) {
391
    for (i=0; i < CONSOLE_COUNT; i++) {
355
        cstatus_vp[i] = vp_create(STATUS_START+CONSOLE_MARGIN+i*(STATUS_WIDTH+STATUS_SPACE),
392
        cstatus_vp[i] = vp_create(status_start+CONSOLE_MARGIN+i*(STATUS_WIDTH+STATUS_SPACE),
356
                      STATUS_TOP, STATUS_WIDTH, STATUS_HEIGHT);
393
                      STATUS_TOP, STATUS_WIDTH, STATUS_HEIGHT);
357
        if (cstatus_vp[i] < 0)
394
        if (cstatus_vp[i] < 0)
358
            return;
395
            return;
359
        vp_switch(cstatus_vp[i]);
396
        vp_switch(cstatus_vp[i]);
360
        set_style(0x202020, 0xffffff);
397
        set_style(0x202020, 0xffffff);
Line 370... Line 407...
370
    ic_pixmaps[CONS_DISCONNECTED] = make_pixmap(_binary_cons_idle_ppm_start,
407
    ic_pixmaps[CONS_DISCONNECTED] = make_pixmap(_binary_cons_idle_ppm_start,
371
                          (int)&_binary_cons_idle_ppm_size);
408
                          (int)&_binary_cons_idle_ppm_size);
372
    ic_pixmaps[CONS_KERNEL] = make_pixmap(_binary_cons_kernel_ppm_start,
409
    ic_pixmaps[CONS_KERNEL] = make_pixmap(_binary_cons_kernel_ppm_start,
373
                          (int)&_binary_cons_kernel_ppm_size);
410
                          (int)&_binary_cons_kernel_ppm_size);
374
    ic_pixmaps[CONS_DISCONNECTED_SEL] = ic_pixmaps[CONS_SELECTED];
411
    ic_pixmaps[CONS_DISCONNECTED_SEL] = ic_pixmaps[CONS_SELECTED];
-
 
412
   
-
 
413
    make_anim();
375
 
414
 
376
    use_gcons = 1;
415
    use_gcons = 1;
377
    console_state[0] = CONS_DISCONNECTED_SEL;
416
    console_state[0] = CONS_DISCONNECTED_SEL;
378
    console_state[KERNEL_CONSOLE] = CONS_KERNEL;
417
    console_state[KERNEL_CONSOLE] = CONS_KERNEL;
379
    gcons_redraw_console();
418
    gcons_redraw_console();