/* Display custom text near logo */ void gui_show_msg(struct gui_t *gui, const char *text) { if (!gui) return; draw_background(gui, text); fb_render(gui->fb); }
void gui_show_text(struct gui_t *gui, kx_text *text) { if (!gui) return; int i, y; int max_x, max_y; draw_background(gui, "KEXECBOOT"); /* No text to show */ if ((!text) || (text->rows->fill <= 1)) return; /* Size constraints */ max_x = gui->x + LYT_MENU_AREA_LEFT + LYT_MENU_AREA_WIDTH; max_y = gui->y + LYT_MENU_AREA_TOP + LYT_MENU_AREA_HEIGHT; for (i = text->current_line_no, y = gui->y + LYT_MENU_AREA_TOP; ( (i < text->rows->fill) && (y < max_y) ); i++ ) { y += fb_draw_constrained_text(gui->fb, gui->x + LYT_MENU_AREA_LEFT, y, max_x, max_y, CLR_MNI_TEXT, DEFAULT_FONT, text->rows->list[i]); } fb_render(gui->fb); }
/* Display bootlist menu with selection */ void gui_show_menu(struct gui_t *gui, kx_menu *menu) { if (!gui) return; int i,j; int slotheight = LYT_MNI_HEIGHT; int slots = gui->height/slotheight -1; kx_menu_level *ml; // struct boot that is in fist slot static int firstslot=0; int cur_no; ml = menu->current; /* active menu level */ cur_no = ml->current_no; /* active menu item index */ /* FIXME: shouldn't be done here */ if (1 == ml->count) { /* Only system menu in list */ draw_background(gui, "No boot devices found.\nR: Reboot S: Rescan"); } else { draw_background(gui, "KEXECBOOT"); } if(cur_no < firstslot) firstslot = cur_no; if(cur_no > firstslot + slots -1) firstslot = cur_no - (slots -1); for(i=1, j=firstslot; i <= slots && j< ml->count; i++, j++) { draw_slot(gui, ml->list[j], i, slotheight, j == cur_no); } fb_render(gui->fb); }
/* Clear screen */ void gui_clear(struct gui_t *gui) { fb_draw_rect(gui->fb, 0, 0, gui->fb->width, gui->fb->height, CLR_BG); fb_render(gui->fb); }
void fbterm_redraw(struct fbterm_ctx *ctx) { /* Draw cursor */ fbterm_cursor_draw(ctx, ctx->cr, ctx->cc); fb_render(ctx); }