void screen_put_cursorxy(struct screen * display, int x, int y, bool on) { #ifdef HAVE_LCD_BITMAP screen_put_icon(display, x, y, on?Icon_Cursor:0); #else screen_put_icon(display, x, y, on?CURSOR_CHAR:-1); #endif }
/* Draw the list... internal screen layout: ----------------- |TI| title | TI is title icon ----------------- | | | | |S|I| | S - scrollbar | | | items | I - icons | | | | ------------------ Note: This image is flipped horizontally when the language is a right-to-left one (Hebrew, Arabic) */ static bool draw_title(struct screen *display, struct gui_synclist *list) { const int screen = display->screen_type; int style = STYLE_DEFAULT; struct viewport *title_text_vp = &title_text[screen]; if (sb_set_title_text(list->title, list->title_icon, screen)) return false; /* the sbs is handling the title */ display->scroll_stop(title_text_vp); if (!list_display_title(list, screen)) return false; *title_text_vp = *(list->parent[screen]); title_text_vp->height = font_get(title_text_vp->font)->height; if (list->title_icon != Icon_NOICON && global_settings.show_icons) { struct viewport title_icon = *title_text_vp; title_icon.width = get_icon_width(screen) + ICON_PADDING * 2; if (VP_IS_RTL(&title_icon)) { title_icon.x += title_text_vp->width - title_icon.width; } else { title_text_vp->x += title_icon.width; } title_text_vp->width -= title_icon.width; display->set_viewport(&title_icon); screen_put_icon(display, 0, 0, list->title_icon); } #ifdef HAVE_LCD_COLOR if (list->title_color >= 0) { style |= (STYLE_COLORED|list->title_color); } #endif display->set_viewport(title_text_vp); display->puts_scroll_style(0, 0, list->title, style); return true; }
void wps_display_images(struct gui_wps *gwps, struct viewport* vp) { if(!gwps || !gwps->data || !gwps->display) return; struct wps_data *data = gwps->data; struct screen *display = gwps->display; struct skin_token_list *list = data->images; while (list) { struct gui_img *img = (struct gui_img*)list->token->value.data; if (img->using_preloaded_icons && img->display >= 0) { screen_put_icon(display, img->x, img->y, img->display); } else if (img->loaded) { if (img->display >= 0) { wps_draw_image(gwps, img, img->display); } else if (img->always_display && img->vp == vp) { wps_draw_image(gwps, img, 0); } } list = list->next; } #ifdef HAVE_ALBUMART /* now draw the AA */ if (data->albumart && data->albumart->vp == vp && data->albumart->draw_handle >= 0) { draw_album_art(gwps, data->albumart->draw_handle, false); data->albumart->draw_handle = -1; } #endif display->set_drawmode(DRMODE_SOLID); }
void wps_display_images(struct gui_wps *gwps, struct viewport* vp) { if(!gwps || !gwps->data || !gwps->display) return; (void)vp; struct wps_data *data = gwps->data; struct screen *display = gwps->display; struct skin_token_list *list = SKINOFFSETTOPTR(get_skin_buffer(data), data->images); while (list) { struct wps_token *token = SKINOFFSETTOPTR(get_skin_buffer(data), list->token); struct gui_img *img = (struct gui_img*)SKINOFFSETTOPTR(get_skin_buffer(data), token->value.data); if (img->using_preloaded_icons && img->display >= 0) { screen_put_icon(display, img->x, img->y, img->display); } else if (img->loaded) { if (img->display >= 0) { wps_draw_image(gwps, img, img->display); } } list = SKINOFFSETTOPTR(get_skin_buffer(data), list->next); } #ifdef HAVE_ALBUMART /* now draw the AA */ struct skin_albumart *aa = SKINOFFSETTOPTR(get_skin_buffer(data), data->albumart); if (aa && SKINOFFSETTOPTR(get_skin_buffer(data), aa->vp) == vp && aa->draw_handle >= 0) { draw_album_art(gwps, aa->draw_handle, false); aa->draw_handle = -1; } #endif display->set_drawmode(DRMODE_SOLID); }
void list_draw(struct screen *display, struct gui_synclist *gui_list) { int text_pos; bool draw_icons = (gui_list->callback_get_item_icon != NULL && global_settings.show_icons); bool draw_cursor; int i; int lines; int start, end; display->set_viewport(NULL); lines = display->getnblines(); display->clear_display(); start = 0; end = display->getnblines(); gui_list->last_displayed_start_item[display->screen_type] = gui_list->start_item[display->screen_type]; gui_list->last_displayed_selected_item = gui_list->selected_item; /* Adjust the position of icon, cursor, text for the list */ draw_cursor = true; if(draw_icons) text_pos = 2; /* here it's in chars */ else text_pos = 1; for (i = start; i < end; i++) { unsigned const char *s; char entry_buffer[MAX_PATH]; unsigned char *entry_name; int current_item = gui_list->start_item[display->screen_type] + i; /* When there are less items to display than the * current available space on the screen, we stop*/ if(current_item >= gui_list->nb_items) break; s = gui_list->callback_get_item_name(current_item, gui_list->data, entry_buffer, sizeof(entry_buffer)); entry_name = P2STR(s); if(gui_list->show_selection_marker && current_item >= gui_list->selected_item && current_item < gui_list->selected_item + gui_list->selected_size) {/* The selected item must be displayed scrolling */ display->puts_scroll(text_pos, i, entry_name); if (draw_cursor) { screen_put_icon_with_offset(display, 0, i, (draw_scrollbar || SHOW_LIST_TITLE)? SCROLLBAR_WIDTH: 0, 0, Icon_Cursor); } } else {/* normal item */ if(gui_list->scroll_all) { display->puts_scroll(text_pos, i, entry_name); } else { display->puts(text_pos, i, entry_name); } } /* Icons display */ if(draw_icons) { enum themable_icons icon; icon = gui_list->callback_get_item_icon(current_item, gui_list->data); if(icon > Icon_NOICON) { screen_put_icon(display, 1, i, icon); } } } display->update_viewport(); display->update(); }