mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 10:07:38 -04:00
screen_access add set_drawinfo
Change-Id: I32e4932eb3a6f06d45aff2cd767484d254a1c9ff
This commit is contained in:
parent
b94b0d3bf4
commit
e09b466554
4 changed files with 15 additions and 24 deletions
|
@ -119,18 +119,6 @@ static inline unsigned get_black_or_white(const struct rgb_pick *rgb)
|
|||
#define SELECTOR_WIDTH get_icon_width(display->screen_type)
|
||||
#define SELECTOR_HEIGHT 8 /* Height of > and < bitmaps */
|
||||
|
||||
/* dunno why lcd_set_drawinfo should be left out of struct screen */
|
||||
static void set_drawinfo(struct screen *display, int mode,
|
||||
unsigned foreground, unsigned background)
|
||||
{
|
||||
display->set_drawmode(mode);
|
||||
if (display->depth > 1)
|
||||
{
|
||||
display->set_foreground(foreground);
|
||||
display->set_background(background);
|
||||
}
|
||||
}
|
||||
|
||||
/* Figure out widest label character in case they vary -
|
||||
this function assumes labels are one character */
|
||||
static int label_get_max_width(struct screen *display)
|
||||
|
@ -174,7 +162,7 @@ static void draw_screen(struct screen *display, char *title,
|
|||
}
|
||||
|
||||
/* Draw title string */
|
||||
set_drawinfo(display, DRMODE_SOLID, text_color, background_color);
|
||||
display->set_drawinfo(DRMODE_SOLID, text_color, background_color);
|
||||
vp.flags |= VP_FLAG_ALIGN_CENTER;
|
||||
display->putsxy(0, MARGIN_TOP, title);
|
||||
|
||||
|
@ -212,7 +200,7 @@ static void draw_screen(struct screen *display, char *title,
|
|||
|
||||
if (i == row)
|
||||
{
|
||||
set_drawinfo(display, DRMODE_SOLID, text_color, background_color);
|
||||
display->set_drawinfo(DRMODE_SOLID, text_color, background_color);
|
||||
|
||||
if (global_settings.cursor_style != 0)
|
||||
{
|
||||
|
@ -249,7 +237,7 @@ static void draw_screen(struct screen *display, char *title,
|
|||
else if (!display_three_rows)
|
||||
continue;
|
||||
|
||||
set_drawinfo(display, mode, fg, bg);
|
||||
display->set_drawinfo(mode, fg, bg);
|
||||
|
||||
/* Draw label */
|
||||
vp.flags &= ~VP_FLAG_ALIGNMENT_MASK;
|
||||
|
@ -294,14 +282,14 @@ static void draw_screen(struct screen *display, char *title,
|
|||
display->fillrect(text_x, top, width, height);
|
||||
|
||||
/* Draw RGB: #rrggbb in middle of swatch */
|
||||
set_drawinfo(display, DRMODE_FG, get_black_or_white(rgb),
|
||||
display->set_drawinfo(DRMODE_FG, get_black_or_white(rgb),
|
||||
background_color);
|
||||
/* Format RGB: #rrggbb */
|
||||
display->putsxyf(0, top + (height - char_height) / 2,
|
||||
str(LANG_COLOR_RGB_VALUE), rgb->red, rgb->green, rgb->blue);
|
||||
|
||||
/* Draw border around the rect */
|
||||
set_drawinfo(display, DRMODE_SOLID, text_color, background_color);
|
||||
display->set_drawinfo(DRMODE_SOLID, text_color, background_color);
|
||||
display->drawrect(text_x, top, width, height);
|
||||
}
|
||||
}
|
||||
|
@ -313,7 +301,7 @@ static void draw_screen(struct screen *display, char *title,
|
|||
|
||||
if (height >= char_height)
|
||||
{
|
||||
set_drawinfo(display, DRMODE_SOLID, text_color, background_color);
|
||||
display->set_drawinfo(DRMODE_SOLID, text_color, background_color);
|
||||
/* Format RGB: #rrggbb */
|
||||
display->putsxyf(0, top + (height - char_height) / 2,
|
||||
str(LANG_COLOR_RGB_VALUE), rgb->red, rgb->green, rgb->blue);
|
||||
|
|
|
@ -345,10 +345,10 @@ static void style_line(struct screen *display,
|
|||
height*line->line);
|
||||
break;
|
||||
case STYLE_COLORBAR:
|
||||
display->set_drawmode(DRMODE_FG);
|
||||
/*display->set_drawmode(DRMODE_FG);*/
|
||||
display->set_foreground(line->line_color);
|
||||
display->fillrect(x, y, width - x, bar_height);
|
||||
break;
|
||||
/*display->fillrect(x, y, width - x, bar_height);*/
|
||||
/* Fall through */
|
||||
#endif
|
||||
case STYLE_INVERT:
|
||||
display->set_drawmode(DRMODE_FG);
|
||||
|
@ -396,10 +396,10 @@ void vput_line(struct screen *display,
|
|||
print_line(display, x, y, line, fmt, ap);
|
||||
#if (LCD_DEPTH > 1 || (defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1))
|
||||
if (display->depth > 1 && line->style > STYLE_INVERT)
|
||||
{
|
||||
display->set_foreground(fg);
|
||||
display->set_background(bg);
|
||||
{
|
||||
display->set_drawinfo(DRMODE_SOLID, fg, bg);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
display->set_drawmode(DRMODE_SOLID);
|
||||
}
|
||||
|
|
|
@ -201,6 +201,7 @@ struct screen screens[NB_SCREENS] =
|
|||
.get_foreground=&lcd_get_foreground,
|
||||
.set_background=&lcd_set_background,
|
||||
.set_foreground=&lcd_set_foreground,
|
||||
.set_drawinfo = &lcd_set_drawinfo,
|
||||
#endif /* LCD_DEPTH > 1 */
|
||||
.update_rect=&lcd_update_rect,
|
||||
.update_viewport_rect=&lcd_update_viewport_rect,
|
||||
|
@ -289,6 +290,7 @@ struct screen screens[NB_SCREENS] =
|
|||
.get_foreground=&lcd_remote_get_foreground,
|
||||
.set_background=&lcd_remote_set_background,
|
||||
.set_foreground=&lcd_remote_set_foreground,
|
||||
.set_drawinfo = &lcd_remote_set_drawinfo,
|
||||
#endif /* LCD_REMOTE_DEPTH > 1 */
|
||||
.update_rect=&lcd_remote_update_rect,
|
||||
.update_viewport_rect=&lcd_remote_update_viewport_rect,
|
||||
|
|
|
@ -94,6 +94,7 @@ struct screen
|
|||
unsigned (*get_foreground)(void);
|
||||
void (*set_background)(unsigned background);
|
||||
void (*set_foreground)(unsigned foreground);
|
||||
void (*set_drawinfo)(int mode, unsigned foreground, unsigned background);
|
||||
#endif /* (LCD_DEPTH > 1) || (LCD_REMOTE_DEPTH > 1) */
|
||||
void (*update_rect)(int x, int y, int width, int height);
|
||||
void (*update_viewport_rect)(int x, int y, int width, int height);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue