From c6ee9dc8833814bf628ea5ce53e91c60067c5a06 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sun, 2 Oct 2022 18:02:27 +0100 Subject: Limit exposure of skin engine internals Drop wps_internals.h from skin_engine.h. The WPS and to a lesser extent the radio screen are too tightly integrated to drop their dependency on wps_internals.h, unfortunately. Skinned lists, for obvious reasons, also need access to the internals. Change-Id: I00a55aa423900f9ad22edccbe2fc1910af380e38 --- apps/recorder/albumart.c | 70 ------------------------------------------------ apps/recorder/albumart.h | 6 ----- 2 files changed, 76 deletions(-) (limited to 'apps/recorder') diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c index 9ff9c72f80..e94ffcfb80 100644 --- a/apps/recorder/albumart.c +++ b/apps/recorder/albumart.c @@ -297,74 +297,4 @@ bool find_albumart(const struct mp3entry *id3, char *buf, int buflen, return search_albumart_files(id3, size_string, buf, buflen); } -/* Draw the album art bitmap from the given handle ID onto the given WPS. - Call with clear = true to clear the bitmap instead of drawing it. */ -void draw_album_art(struct gui_wps *gwps, int handle_id, bool clear) -{ - if (!gwps || !gwps->data || !gwps->display || handle_id < 0) - return; - - struct wps_data *data = gwps->data; - struct skin_albumart *aa = SKINOFFSETTOPTR(get_skin_buffer(data), data->albumart); - - if (!aa) - return; - - struct bitmap *bmp; - if (bufgetdata(handle_id, 0, (void *)&bmp) <= 0) - return; - - short x = aa->x; - short y = aa->y; - short width = bmp->width; - short height = bmp->height; - - if (aa->width > 0) - { - /* Crop if the bitmap is too wide */ - width = MIN(bmp->width, aa->width); - - /* Align */ - if (aa->xalign & WPS_ALBUMART_ALIGN_RIGHT) - x += aa->width - width; - else if (aa->xalign & WPS_ALBUMART_ALIGN_CENTER) - x += (aa->width - width) / 2; - } - - if (aa->height > 0) - { - /* Crop if the bitmap is too high */ - height = MIN(bmp->height, aa->height); - - /* Align */ - if (aa->yalign & WPS_ALBUMART_ALIGN_BOTTOM) - y += aa->height - height; - else if (aa->yalign & WPS_ALBUMART_ALIGN_CENTER) - y += (aa->height - height) / 2; - } - - if (!clear) - { - /* Draw the bitmap */ - gwps->display->bitmap_part((fb_data*)bmp->data, 0, 0, - STRIDE(gwps->display->screen_type, - bmp->width, bmp->height), - x, y, width, height); -#ifdef HAVE_LCD_INVERT - if (global_settings.invert) { - gwps->display->set_drawmode(DRMODE_COMPLEMENT); - gwps->display->fillrect(x, y, width, height); - gwps->display->set_drawmode(DRMODE_SOLID); - } -#endif - } - else - { - /* Clear the bitmap */ - gwps->display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); - gwps->display->fillrect(x, y, width, height); - gwps->display->set_drawmode(DRMODE_SOLID); - } -} - #endif /* PLUGIN */ diff --git a/apps/recorder/albumart.h b/apps/recorder/albumart.h index 80cacaf5f0..0d663d3d92 100644 --- a/apps/recorder/albumart.h +++ b/apps/recorder/albumart.h @@ -35,12 +35,6 @@ bool find_albumart(const struct mp3entry *id3, char *buf, int buflen, const struct dim *dim); -#ifndef PLUGIN -/* Draw the album art bitmap from the given handle ID onto the given Skin. - Call with clear = true to clear the bitmap instead of drawing it. */ -void draw_album_art(struct gui_wps *gwps, int handle_id, bool clear); -#endif - bool search_albumart_files(const struct mp3entry *id3, const char *size_string, char *buf, int buflen); -- cgit v1.2.3