1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2008 by Jonathan Gordon
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
25 #include "lcd-remote.h"
34 #include "statusbar.h"
35 #include "screen_access.h"
37 int viewport_get_nb_lines(struct viewport
*vp
)
39 #ifdef HAVE_LCD_BITMAP
40 return vp
->height
/font_get(vp
->font
)->height
;
48 void viewport_set_defaults(struct viewport
*vp
, enum screen_type screen
)
51 vp
->width
= screens
[screen
].lcdwidth
;
53 vp
->y
= gui_statusbar_height();
54 vp
->height
= screens
[screen
].lcdheight
- vp
->y
;
55 #ifdef HAVE_LCD_BITMAP
56 vp
->drawmode
= DRMODE_SOLID
;
57 vp
->font
= FONT_UI
; /* default to UI to discourage SYSFONT use */
60 #ifdef HAVE_REMOTE_LCD
61 /* We only need this test if there is a remote LCD */
62 if (screen
== SCREEN_MAIN
)
66 vp
->fg_pattern
= global_settings
.fg_color
;
67 vp
->bg_pattern
= global_settings
.bg_color
;
68 vp
->lss_pattern
= global_settings
.lss_color
;
69 vp
->lse_pattern
= global_settings
.lse_color
;
70 vp
->lst_pattern
= global_settings
.lst_color
;
72 vp
->fg_pattern
= LCD_DEFAULT_FG
;
73 vp
->bg_pattern
= LCD_DEFAULT_BG
;
77 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
78 if (screen
== SCREEN_REMOTE
)
80 vp
->fg_pattern
= LCD_REMOTE_DEFAULT_FG
;
81 vp
->bg_pattern
= LCD_REMOTE_DEFAULT_BG
;