forked from len0rd/rockbox
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
This commit is contained in:
parent
30d664bbbc
commit
a27f2b8683
2 changed files with 21 additions and 13 deletions
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue