[4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.

Note:  I left behind lcd_bitmap in features.txt, because removing it
would require considerable work in the manual and the translations.

Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
This commit is contained in:
Solomon Peachy 2020-07-17 10:31:31 -04:00
parent 8cb555460f
commit 658026e626
240 changed files with 288 additions and 1759 deletions

View file

@ -13,7 +13,7 @@ display_text.c
strncpy.c
stdio_compat.c
#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4)
#if (LCD_DEPTH < 4)
grey_core.c
grey_draw.c
grey_parm.c
@ -23,7 +23,7 @@ grey_scroll.c
grey_coldfire.S
#endif
#endif /* HAVE_LCD_BITMAP && LCD_DEPTH < 4 */
#endif /* LCD_DEPTH < 4 */
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
overlay.c
@ -33,8 +33,6 @@ overlay.c
profile_plugin.c
#endif
#ifdef HAVE_LCD_BITMAP
#ifdef CPU_ARM
pluginlib_jpeg_idct_arm.S
#endif
@ -65,8 +63,6 @@ pluginlib_albumart.c
kbd_helper.c
#endif /* HAVE_LCD_BITMAP */
#ifdef HAVE_TOUCHSCREEN
pluginlib_touchscreen.c
#endif

View file

@ -21,11 +21,7 @@
#include "plugin.h"
#ifdef HAVE_LCD_BITMAP
/*
* Print a checkbox
*/
void checkbox(int x, int y, int width, int height, bool checked);
#endif

View file

@ -39,9 +39,7 @@ static bool wait_key_press(void)
bool display_text(unsigned short words, char** text, struct style_text* style,
struct viewport* vp_text, bool wait_key)
{
#ifdef HAVE_LCD_BITMAP
int prev_drawmode;
#endif
#ifdef HAVE_LCD_COLOR
int standard_fgcolor;
#endif
@ -55,10 +53,8 @@ bool display_text(unsigned short words, char** text, struct style_text* style,
vp_height = vp_text->height;
}
rb->screens[SCREEN_MAIN]->set_viewport(vp_text);
#ifdef HAVE_LCD_BITMAP
prev_drawmode = rb->lcd_get_drawmode();
rb->lcd_set_drawmode(DRMODE_SOLID);
#endif
#ifdef HAVE_LCD_COLOR
standard_fgcolor = rb->lcd_get_foreground();
#endif
@ -121,11 +117,9 @@ bool display_text(unsigned short words, char** text, struct style_text* style,
#endif
rb->lcd_putsxy(x, y, text[i]);
/* underline the word */
#ifdef HAVE_LCD_BITMAP
if (style[style_index].flags&TEXT_UNDERLINE) {
rb->lcd_hline(x, x+width, y+height-1);
}
#endif
#ifdef HAVE_LCD_COLOR
rb->lcd_set_foreground(standard_fgcolor);
#endif
@ -134,9 +128,7 @@ bool display_text(unsigned short words, char** text, struct style_text* style,
x += width + space_w;
}
rb->screens[SCREEN_MAIN]->update_viewport();
#ifdef HAVE_LCD_BITMAP
rb->lcd_set_drawmode(prev_drawmode);
#endif
if (wait_key)
{
if (wait_key_press())

View file

@ -29,7 +29,7 @@
#include "plugin.h"
#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4)
#if (LCD_DEPTH < 4)
/* The greyscale lib uses 8 bit brightness values natively on input. */
#define GREY_BRIGHTNESS(y) (y)
@ -201,5 +201,5 @@ struct _grey_info
/* Global variable, defined in the plugin */
extern struct _grey_info _grey_info;
#endif /* HAVE_LCD_BITMAP && (LCD_DEPTH < 4) */
#endif /* (LCD_DEPTH < 4) */
#endif /* __GREY_H__ */

View file

@ -119,7 +119,6 @@ bool highscore_would_update(int score, struct highscore *scores,
return (num_scores > 0) && (score > scores[num_scores-1].score);
}
#ifdef HAVE_LCD_BITMAP
#define MARGIN 5
void highscore_show(int position, struct highscore *scores, int num_scores,
bool show_level)
@ -179,37 +178,3 @@ void highscore_show(int position, struct highscore *scores, int num_scores,
rb->lcd_set_foreground(fgcolor);
#endif
}
#else
struct scoreinfo {
struct highscore *scores;
int position;
bool show_level;
};
static const char* get_score(int selected, void * data,
char * buffer, size_t buffer_len)
{
struct scoreinfo *scoreinfo = (struct scoreinfo *) data;
int len;
len = rb->snprintf(buffer, buffer_len, "%c%d) %4d",
(scoreinfo->position == selected?'*':' '),
selected+1, scoreinfo->scores[selected].score);
if (scoreinfo->show_level)
rb->snprintf(buffer + len, buffer_len - len, " %d",
scoreinfo->scores[selected].level);
return buffer;
}
void highscore_show(int position, struct highscore *scores, int num_scores,
bool show_level)
{
struct simplelist_info info;
struct scoreinfo scoreinfo = {scores, position, show_level};
rb->simplelist_info_init(&info, "High Scores", num_scores, &scoreinfo);
if (position >= 0)
info.selection = position;
info.hide_selection = true;
info.get_name = get_score;
rb->simplelist_show_list(&info);
}
#endif /* HAVE_LCD_BITMAP */

View file

@ -35,7 +35,7 @@
* lib/grey.h should be included before including this
* header. For bitmap LCD's, defaults to rb->lcd_XXXX otherwise.
*/
#if defined (HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) && defined(__GREY_H__)
#if (LCD_DEPTH < 4) && defined(__GREY_H__)
#define MYLCD_CFG_GREYLIB /* using greylib */
#define mylcd_(fn) grey_##fn
#define myxlcd_(fn) grey_##fn
@ -51,7 +51,8 @@
#define MYLCD_DEFAULT_FG GREY_BLACK
#define MYLCD_DEFAULT_BG GREY_WHITE
#elif defined (HAVE_LCD_BITMAP)
#else
#define MYLCD_CFG_RB_XLCD /* using standard (X)LCD routines */
#define mylcd_(fn) rb->lcd_##fn
#define myxlcd_(fn) xlcd_##fn
@ -67,18 +68,11 @@
#define MYLCD_DEFAULT_FG LCD_DEFAULT_FG
#define MYLCD_DEFAULT_BG LCD_DEFAULT_BG
#else
#error Configuration not supported! Did you forget to include the correct lib header?
#endif /* end LCD type selection */
/* Update functions */
#define mylcd_update mylcd_(update)
#ifdef HAVE_LCD_BITMAP
#define mylcd_update_rect mylcd_(update_rect)
#else
static inline void mylcd_update_rect(int x, int y, int w, int h)
{ (void)x; (void)y; (void)w; (void)h; pgfx_update(); }
#endif /* HAVE_LCD_BITMAP */
/* Update functions - unbuffered : special handling for these
* It is desirable to still evaluate arguments even if there will
@ -104,7 +98,6 @@ static inline void mylcd_ub_update_rect(int x, int y, int w, int h)
#define mylcd_set_drawmode mylcd_(set_drawmode)
#define mylcd_get_drawmode mylcd_(get_drawmode)
#ifdef HAVE_LCD_BITMAP
#define mylcd_set_foreground mylcd_(set_foreground)
#define mylcd_get_foreground mylcd_(get_foreground)
#define mylcd_set_background mylcd_(set_background)
@ -112,7 +105,6 @@ static inline void mylcd_ub_update_rect(int x, int y, int w, int h)
#define mylcd_set_drawinfo mylcd_(set_drawinfo)
#define mylcd_setfont mylcd_(setfont)
#define mylcd_getstringsize mylcd_(getstringsize)
#endif /* HAVE_LCD_BITMAP */
/* Whole display */
#define mylcd_clear_display mylcd_(clear_display)
@ -131,57 +123,43 @@ static inline void mylcd_ub_update_rect(int x, int y, int w, int h)
/* Filled Primitives */
#define mylcd_fillrect mylcd_(fillrect)
#ifdef HAVE_LCD_BITMAP
#define mylcd_filltriangle myxlcd_(filltriangle)
#endif /* HAVE_LCD_BITMAP */
/* Bitmaps */
#define mylcd_mono_bitmap_part mylcd_(mono_bitmap_part)
#define mylcd_mono_bitmap mylcd_(mono_bitmap)
#ifdef HAVE_LCD_BITMAP
#define mylcd_gray_bitmap_part myxlcd_(gray_bitmap_part)
#define mylcd_gray_bitmap myxlcd_(gray_bitmap)
#if 0 /* possible, but not implemented in greylib */
#define mylcd_color_bitmap_part myxlcd_(color_bitmap_part)
#define mylcd_color_bitmap myxlcd_(color_bitmap)
#endif
#endif /* HAVE_LCD_BITMAP */
/* Bitmaps - unbuffered */
#ifdef HAVE_LCD_BITMAP
#define mylcd_ub_gray_bitmap_part myxlcd_ub_(gray_bitmap_part)
#define mylcd_ub_gray_bitmap myxlcd_ub_(gray_bitmap)
#endif /* HAVE_LCD_BITMAP */
/* Text */
/* lcd_putsxyofs is static'ed in the core for now on color */
#ifdef HAVE_LCD_BITMAP
#define mylcd_putsxyofs mylcd_(putsxyofs)
#define mylcd_putsxy mylcd_(putsxy)
#endif /* HAVE_LCD_BITMAP */
/* Scrolling */
#ifdef HAVE_LCD_BITMAP
#define mylcd_scroll_left myxlcd_(scroll_left)
#define mylcd_scroll_right myxlcd_(scroll_right)
#define mylcd_scroll_up myxlcd_(scroll_up)
#define mylcd_scroll_down myxlcd_(scroll_down)
#endif /* HAVE_LCD_BITMAP */
/* Scrolling - unbuffered */
#ifdef HAVE_LCD_BITMAP
#define mylcd_ub_scroll_left myxlcd_ub_(scroll_left)
#define mylcd_ub_scroll_right myxlcd_ub_(scroll_right)
#define mylcd_ub_scroll_up myxlcd_ub_(scroll_up)
#define mylcd_ub_scroll_down myxlcd_ub_(scroll_down)
#endif /* HAVE_LCD_BITMAP */
/* Viewports */
#ifdef HAVE_LCD_BITMAP
#define mylcd_clear_viewport mylcd_(clear_viewport)
#define mylcd_set_viewport mylcd_(set_viewport)
#define mylcd_viewport_set_fullscreen mylcd_viewport_(set_fullscreen)
#endif /* HAVE_LCD_BITMAP */
#endif /* MYLCD_H */

View file

@ -37,7 +37,7 @@ int save_bmp_file( char* filename, struct bitmap *bm );
*/
void simple_resize_bitmap(struct bitmap *src, struct bitmap *dst);
#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4)
#if (LCD_DEPTH < 4)
/**
Same as simple_resize_bitmap except this is for use with greylib.
*/

View file

@ -27,10 +27,8 @@
struct view_info {
#ifdef HAVE_LCD_BITMAP
struct font* pf;
struct viewport scrollbar_vp; /* viewport for scrollbar */
#endif
struct viewport vp;
const char *title;
const char *text; /* displayed text */
@ -89,15 +87,12 @@ static void calc_line_count(struct view_info *info)
{
const char *ptr = info->text;
int i = 0;
#ifdef HAVE_LCD_BITMAP
bool scrollbar = false;
#endif
while (*ptr)
{
ptr = get_next_line(ptr, info);
i++;
#ifdef HAVE_LCD_BITMAP
if (!scrollbar && i > info->display_lines)
{
ptr = info->text;
@ -111,7 +106,6 @@ static void calc_line_count(struct view_info *info)
info->scrollbar_vp.x = info->vp.width;
scrollbar = true;
}
#endif
}
info->line_count = i;
}
@ -144,12 +138,8 @@ static int init_view(struct view_info *info,
const char *title, const char *text)
{
rb->viewport_set_defaults(&info->vp, SCREEN_MAIN);
#ifdef HAVE_LCD_BITMAP
info->pf = rb->font_get(FONT_UI);
info->display_lines = info->vp.height / info->pf->height;
#else
info->display_lines = info->vp.height;
#endif
info->title = title;
info->text = text;
@ -157,7 +147,6 @@ static int init_view(struct view_info *info,
info->line = 0;
info->start = 0;
#ifdef HAVE_LCD_BITMAP
/* no title for small screens. */
if (info->display_lines < 4)
{
@ -169,7 +158,6 @@ static int init_view(struct view_info *info,
info->vp.y += info->pf->height;
info->vp.height -= info->pf->height;
}
#endif
calc_line_count(info);
return 0;
@ -177,11 +165,7 @@ static int init_view(struct view_info *info,
static void draw_text(struct view_info *info)
{
#ifdef HAVE_LCD_BITMAP
#define OUTPUT_SIZE LCD_WIDTH+1
#else
#define OUTPUT_SIZE LCD_WIDTH*3+1
#endif
static char output[OUTPUT_SIZE];
const char *text, *ptr;
int max_show, line;
@ -190,14 +174,12 @@ static void draw_text(struct view_info *info)
/* clear screen */
display->clear_display();
#ifdef HAVE_LCD_BITMAP
/* display title. */
if(info->title)
{
display->set_viewport(NULL);
display->puts(0, 0, info->title);
}
#endif
max_show = MIN(info->line_count - info->line, info->display_lines);
text = info->text + info->start;
@ -215,7 +197,6 @@ static void draw_text(struct view_info *info)
display->puts(0, line, output);
text = ptr;
}
#ifdef HAVE_LCD_BITMAP
if (info->line_count > info->display_lines)
{
display->set_viewport(&info->scrollbar_vp);
@ -224,7 +205,6 @@ static void draw_text(struct view_info *info)
info->line_count, info->line, info->line + max_show,
VERTICAL);
}
#endif
display->set_viewport(NULL);
display->update();

View file

@ -26,8 +26,6 @@
#include "plugin.h"
#ifdef HAVE_LCD_BITMAP
void xlcd_filltriangle(int x1, int y1, int x2, int y2, int x3, int y3);
void xlcd_filltriangle_screen(struct screen* display,
int x1, int y1, int x2, int y2, int x3, int y3);
@ -54,6 +52,5 @@ void xlcd_scroll_right(int count);
void xlcd_scroll_up(int count);
void xlcd_scroll_down(int count);
#endif /* HAVE_LCD_BITMAP */
#endif /* __XLCD_H__ */

View file

@ -24,8 +24,5 @@
#include "plugin.h"
#ifdef HAVE_LCD_BITMAP
#include "xlcd.h"
#endif /* HAVE_LCD_BITMAP */

View file

@ -24,7 +24,6 @@
#include "plugin.h"
#ifdef HAVE_LCD_BITMAP
#include "xlcd.h"
/* sort the given coordinates by increasing x value */
@ -486,5 +485,3 @@ void xlcd_color_bitmap(const unsigned char *src, int x, int y, int width,
#endif /* HAVE_LCD_COLOR */
#endif /* LCD_DEPTH >= 8 */
#endif /* HAVE_LCD_BITMAP */