From 3022a60cc2c5958555743f9438b8cf7cd95987f0 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 11 Oct 2010 01:19:55 +0000 Subject: [PATCH] Rename {draw,fill}_viewport once more (to draw_border_viewport and fill_viewport) and remove the viewport parameter as suggested by Dave Chapman. The parameter wasn't used yet and it's not clear whether it should be a absolute or relative viewport. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28242 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/buttonbar.c | 2 +- apps/gui/splash.c | 4 ++-- apps/gui/statusbar.c | 2 +- apps/plugins/lib/pluginlib_touchscreen.c | 2 +- apps/screen_access.c | 8 ++++---- apps/screen_access.h | 4 ++-- firmware/drivers/lcd-bitmap-common.c | 18 ++++++------------ firmware/export/lcd-remote.h | 4 ++-- firmware/export/lcd.h | 4 ++-- 9 files changed, 21 insertions(+), 27 deletions(-) diff --git a/apps/gui/buttonbar.c b/apps/gui/buttonbar.c index 9abd851252..c7b36fa6e3 100644 --- a/apps/gui/buttonbar.c +++ b/apps/gui/buttonbar.c @@ -69,7 +69,7 @@ static void gui_buttonbar_draw_button(struct gui_buttonbar * buttonbar, int num) vp.width = button_width-1; vp.x = button_width * num; display->set_viewport(&vp); - display->fill_viewport_rect(NULL); + display->fill_viewport(); if(buttonbar->caption[num][0] != 0) { display->getstringsize(buttonbar->caption[num], &fw, &fh); diff --git a/apps/gui/splash.c b/apps/gui/splash.c index 5123e5d8f5..4ce751ca74 100644 --- a/apps/gui/splash.c +++ b/apps/gui/splash.c @@ -163,7 +163,7 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) #endif vp.drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); - screen->fill_viewport_rect(NULL); + screen->fill_viewport(); #if LCD_DEPTH > 1 if (screen->depth > 1) @@ -174,7 +174,7 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) #endif vp.drawmode = DRMODE_SOLID; - screen->draw_viewport_rect(NULL); + screen->draw_border_viewport(); /* prepare putting the text */ y = RECT_SPACING; diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index 467907c21a..d2b7f500b1 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c @@ -280,7 +280,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw, struct vi { display->set_viewport(vp); display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); - display->fill_viewport_rect(NULL); + display->fill_viewport(); display->set_drawmode(DRMODE_SOLID); if (bar->info.battery_state) diff --git a/apps/plugins/lib/pluginlib_touchscreen.c b/apps/plugins/lib/pluginlib_touchscreen.c index 8b559a4c48..e510856851 100644 --- a/apps/plugins/lib/pluginlib_touchscreen.c +++ b/apps/plugins/lib/pluginlib_touchscreen.c @@ -129,7 +129,7 @@ void touchbutton_draw(struct touchbutton *data, int num_buttons) { } /* Draw bounding box around the button location. */ - lcd->draw_viewport_rect(NULL); + lcd->draw_border_viewport(); } } lcd->set_viewport(NULL); /* Go back to the default viewport */ diff --git a/apps/screen_access.c b/apps/screen_access.c index d16a4415fa..b83e842de8 100644 --- a/apps/screen_access.c +++ b/apps/screen_access.c @@ -162,8 +162,8 @@ struct screen screens[NB_SCREENS] = .update_viewport_rect=&lcd_update_viewport_rect, .fillrect=&lcd_fillrect, .drawrect=&lcd_drawrect, - .draw_viewport_rect=&lcd_draw_viewport_rect, - .fill_viewport_rect=&lcd_fill_viewport_rect, + .draw_border_viewport=&lcd_draw_border_viewport, + .fill_viewport=&lcd_fill_viewport, .drawpixel=&lcd_drawpixel, .drawline=&lcd_drawline, .vline=&lcd_vline, @@ -255,8 +255,8 @@ struct screen screens[NB_SCREENS] = .update_viewport_rect=&lcd_remote_update_viewport_rect, .fillrect=&lcd_remote_fillrect, .drawrect=&lcd_remote_drawrect, - .draw_viewport_rect=&lcd_remote_draw_viewport_rect, - .fill_viewport_rect=&lcd_remote_fill_viewport_rect, + .draw_border_viewport=&lcd_remote_draw_border_viewport, + .fill_viewport=&lcd_remote_fill_viewport, .drawpixel=&lcd_remote_drawpixel, .drawline=&lcd_remote_drawline, .vline=&lcd_remote_vline, diff --git a/apps/screen_access.h b/apps/screen_access.h index 6a4750dbb0..efe232b50e 100644 --- a/apps/screen_access.h +++ b/apps/screen_access.h @@ -117,8 +117,8 @@ struct screen void (*update_viewport_rect)(int x, int y, int width, int height); void (*fillrect)(int x, int y, int width, int height); void (*drawrect)(int x, int y, int width, int height); - void (*fill_viewport_rect)(const struct viewport *vp); - void (*draw_viewport_rect)(const struct viewport *vp); + void (*fill_viewport)(void); + void (*draw_border_viewport)(void); void (*drawpixel)(int x, int y); void (*drawline)(int x1, int y1, int x2, int y2); void (*vline)(int x, int y1, int y2); diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index d09d293c26..8e3b52c246 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c @@ -82,25 +82,19 @@ static void lcd_gradient_rect(int x1, int x2, int y, unsigned h, #endif /* - * draws the borders of the viewport, or of current_vp if vp == NULL + * draws the borders of the current viewport **/ -void LCDFN(draw_viewport_rect)(const struct viewport *vp) +void LCDFN(draw_border_viewport)(void) { - if (vp == NULL) - LCDFN(drawrect)(0, 0, current_vp->width, current_vp->height); - else - LCDFN(drawrect)(vp->x, vp->y, vp->width, vp->height); + LCDFN(drawrect)(0, 0, current_vp->width, current_vp->height); } /* - * fills the rectangle formed by vp or by current_vp if vp == NULL + * fills the rectangle formed by current_vp **/ -void LCDFN(fill_viewport_rect)(const struct viewport *vp) +void LCDFN(fill_viewport)(void) { - if (vp == NULL) - LCDFN(fillrect)(0, 0, current_vp->width, current_vp->height); - else - LCDFN(fillrect)(vp->x, vp->y, vp->width, vp->height); + LCDFN(fillrect)(0, 0, current_vp->width, current_vp->height); } /* put a string at a given pixel position, skipping first ofs pixel columns */ diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h index 5a78fa2b07..9b5f397dff 100644 --- a/firmware/export/lcd-remote.h +++ b/firmware/export/lcd-remote.h @@ -178,8 +178,8 @@ extern void lcd_remote_hline(int x1, int x2, int y); extern void lcd_remote_vline(int x, int y1, int y2); extern void lcd_remote_drawrect(int x, int y, int width, int height); extern void lcd_remote_fillrect(int x, int y, int width, int height); -extern void lcd_remote_draw_viewport_rect(const struct viewport *vp); -extern void lcd_remote_fill_viewport_rect(const struct viewport *vp); +extern void lcd_remote_draw_border_viewport(const struct viewport *vp); +extern void lcd_remote_fill_viewport(const struct viewport *vp); extern void lcd_remote_bitmap_part(const fb_remote_data *src, int src_x, int src_y, int stride, int x, int y, int width, int height); diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 3a01cbca61..79231d198e 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h @@ -507,8 +507,8 @@ extern void lcd_hline(int x1, int x2, int y); extern void lcd_vline(int x, int y1, int y2); extern void lcd_drawrect(int x, int y, int width, int height); extern void lcd_fillrect(int x, int y, int width, int height); -extern void lcd_draw_viewport_rect(const struct viewport *vp); -extern void lcd_fill_viewport_rect(const struct viewport *vp); +extern void lcd_draw_border_viewport(void); +extern void lcd_fill_viewport(void); extern void lcd_bitmap_part(const fb_data *src, int src_x, int src_y, int stride, int x, int y, int width, int height); extern void lcd_bitmap(const fb_data *src, int x, int y, int width,