From a27f2b8683204e337b142124979592ee1cd0d6f9 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 11 Oct 2009 00:05:12 +0000 Subject: A bit of const correctness and 80-char limit correction. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23083 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/viewport.c | 19 ++++++++++++------- apps/gui/viewport.h | 15 +++++++++------ 2 files changed, 21 insertions(+), 13 deletions(-) (limited to 'apps') diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index d8e5d721e9..6f9abb74a0 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c @@ -102,7 +102,8 @@ static bool showing_bars(enum screen_type screen) return false; } -void viewport_set_fullscreen(struct viewport *vp, enum screen_type screen) +void viewport_set_fullscreen(struct viewport *vp, + const enum screen_type screen) { vp->x = 0; vp->width = screens[screen].lcdwidth; @@ -113,14 +114,16 @@ void viewport_set_fullscreen(struct viewport *vp, enum screen_type screen) vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */ vp->height = screens[screen].lcdheight; - if (statusbar_position(screen) != STATUSBAR_BOTTOM && showing_bars(screen)) + if (statusbar_position(screen) != STATUSBAR_BOTTOM + && showing_bars(screen)) vp->y = STATUSBAR_HEIGHT; else vp->y = 0; #else vp->y = 0; #endif - vp->height = screens[screen].lcdheight - (showing_bars(screen)?STATUSBAR_HEIGHT:0); + vp->height = screens[screen].lcdheight + - (showing_bars(screen)?STATUSBAR_HEIGHT:0); #if LCD_DEPTH > 1 #ifdef HAVE_REMOTE_LCD @@ -144,7 +147,8 @@ void viewport_set_fullscreen(struct viewport *vp, enum screen_type screen) } -void viewport_set_defaults(struct viewport *vp, enum screen_type screen) +void viewport_set_defaults(struct viewport *vp, + const enum screen_type screen) { #ifdef HAVE_LCD_BITMAP if (ui_vp_info.active[screen]) @@ -173,7 +177,7 @@ int viewportmanager_get_statusbar(void) return statusbar_enabled; } -int viewportmanager_set_statusbar(int enabled) +int viewportmanager_set_statusbar(const int enabled) { int old = statusbar_enabled; statusbar_enabled = enabled; @@ -214,7 +218,7 @@ static void statusbar_toggled(void* param) viewportmanager_theme_changed(THEME_STATUSBAR); } -void viewportmanager_theme_changed(int which) +void viewportmanager_theme_changed(const int which) { int i; #ifdef HAVE_BUTTONBAR @@ -341,7 +345,8 @@ static unsigned viewport_init_ui_vp(void) #ifdef HAVE_TOUCHSCREEN /* check if a point (x and y coordinates) are within a viewport */ -bool viewport_point_within_vp(const struct viewport *vp, int x, int y) +bool viewport_point_within_vp(const struct viewport *vp, + const int x, const int y) { bool is_x = (x >= vp->x && x < (vp->x + vp->width)); bool is_y = (y >= vp->y && y < (vp->y + vp->height)); diff --git a/apps/gui/viewport.h b/apps/gui/viewport.h index cedb27e01c..cffc7fbaef 100644 --- a/apps/gui/viewport.h +++ b/apps/gui/viewport.h @@ -31,7 +31,8 @@ /* return the number of text lines in the vp viewport */ int viewport_get_nb_lines(const struct viewport *vp); -void viewport_set_defaults(struct viewport *vp, enum screen_type screen); +void viewport_set_defaults(struct viewport *vp, + const enum screen_type screen); /* Used to specify which screens the statusbar (SB) should be displayed on. * @@ -73,19 +74,20 @@ void viewport_set_defaults(struct viewport *vp, enum screen_type screen); */ void viewportmanager_init(void); int viewportmanager_get_statusbar(void); -int viewportmanager_set_statusbar(int enabled); +int viewportmanager_set_statusbar(const int enabled); /* * Initializes the given viewport with maximum dimensions minus status- and * buttonbar */ -void viewport_set_fullscreen(struct viewport *vp, enum screen_type screen); +void viewport_set_fullscreen(struct viewport *vp, + const enum screen_type screen); #ifdef HAVE_LCD_BITMAP /* call this when a theme changed */ -void viewportmanager_theme_changed(int); +void viewportmanager_theme_changed(const int); /* * Returns a pointer to the current viewport @@ -103,9 +105,10 @@ void viewport_set_current_vp(struct viewport* vp); /* * returns true if the ui viewport is active on the screen */ -bool viewport_ui_vp_get_state(enum screen_type screen); +bool viewport_ui_vp_get_state(const enum screen_type screen); #ifdef HAVE_TOUCHSCREEN -bool viewport_point_within_vp(const struct viewport *vp, int x, int y); +bool viewport_point_within_vp(const struct viewport *vp, + const int x, const int y); #endif #else /* HAVE_LCD_CHARCELL */ -- cgit