blob: fe5e943ccace0cd9a38ac248d3aaa517d45b5e76 [file] [log] [blame]
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
Kevin Ferrarea3ed62b2005-10-30 01:24:35 +000010 * Copyright (C) 2005 by Kevin Ferrare
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +000011 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * 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.
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
Thomas Martitz50a6ca32010-05-06 21:04:40 +000022#include <stdio.h>
23#include "config.h"
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +000024#include <lcd.h>
Rafaël Carréb6122632012-01-07 19:35:46 +000025#ifdef HAVE_REMOTE_LCD
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +000026#include <lcd-remote.h>
Rafaël Carréb6122632012-01-07 19:35:46 +000027#endif
Thomas Martitz66309582013-12-20 23:34:28 +010028#include "scroll_engine.h"
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +000029#include <font.h>
30#include <button.h>
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +000031#include <settings.h>
32#include <kernel.h>
33#include <icons.h>
34
Thomas Martitz50a6ca32010-05-06 21:04:40 +000035#include "backlight.h"
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +000036#include "screen_access.h"
Thomas Martitz4764ee02009-08-06 00:14:40 +000037#include "backdrop.h"
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +000038
Peter D'Hoye3c1e9ca2008-09-07 20:09:11 +000039/* some helper functions to calculate metrics on the fly */
40static int screen_helper_getcharwidth(void)
41{
42#ifdef HAVE_LCD_BITMAP
43 return font_get(lcd_getfont())->maxwidth;
44#else
45 return 1;
46#endif
47}
48
49static int screen_helper_getcharheight(void)
50{
51#ifdef HAVE_LCD_BITMAP
52 return font_get(lcd_getfont())->height;
53#else
54 return 1;
55#endif
56}
57
58static int screen_helper_getnblines(void)
59{
60 int height=screens[0].lcdheight;
61#ifdef HAVE_LCD_BITMAP
Thomas Martitz2eb1cb62009-09-07 17:37:06 +000062 if(global_settings.statusbar != STATUSBAR_OFF)
Peter D'Hoye3c1e9ca2008-09-07 20:09:11 +000063 height -= STATUSBAR_HEIGHT;
64#ifdef HAVE_BUTTONBAR
65 if(global_settings.buttonbar && screens[0].has_buttonbar)
66 height -= BUTTONBAR_HEIGHT;
67#endif
68#endif
69 return height / screens[0].getcharheight();
70}
71
Jonathan Gordonaa0f4a42011-09-24 13:19:34 +000072void screen_helper_setfont(int font)
73{
Jonathan Gordon0c521cf2011-09-24 13:34:23 +000074 (void)font;
Jonathan Gordonaa0f4a42011-09-24 13:19:34 +000075#ifdef HAVE_LCD_BITMAP
76 if (font == FONT_UI)
77 font = global_status.font_id[SCREEN_MAIN];
78 lcd_setfont(font);
79#endif
80}
81
Bertrik Sikken67eefad2011-12-20 20:57:16 +000082#ifdef HAVE_LCD_BITMAP
Bertrik Sikkencb972ab2011-12-20 20:35:28 +000083static int screen_helper_getuifont(void)
Jonathan Gordonf19f3ef2011-11-08 10:09:33 +000084{
Jonathan Gordonf19f3ef2011-11-08 10:09:33 +000085 return global_status.font_id[SCREEN_MAIN];
Jonathan Gordonf19f3ef2011-11-08 10:09:33 +000086}
87
Bertrik Sikkencb972ab2011-12-20 20:35:28 +000088static void screen_helper_setuifont(int font)
Jonathan Gordonf19f3ef2011-11-08 10:09:33 +000089{
Jonathan Gordonf19f3ef2011-11-08 10:09:33 +000090 global_status.font_id[SCREEN_MAIN] = font;
Jonathan Gordonf19f3ef2011-11-08 10:09:33 +000091}
Bertrik Sikken67eefad2011-12-20 20:57:16 +000092#endif
Jonathan Gordonf19f3ef2011-11-08 10:09:33 +000093
Thomas Martitzacee6752013-12-20 23:34:28 +010094static void screen_helper_set_drawmode(int mode)
95{
96#ifdef HAVE_LCD_BITMAP
97 lcd_set_drawmode(mode);
98#else
99 (void) mode;
100#endif
101}
102
Thomas Martitz5d697462013-12-20 23:34:28 +0100103static void screen_helper_put_line(int x, int y, struct line_desc *line,
104 const char *fmt, ...)
105{
106 va_list ap;
107 va_start(ap, fmt);
Thomas Martitz124e9c12014-01-08 10:45:00 +0100108 vput_line(&screens[SCREEN_MAIN], x, y, line, fmt, ap);
Thomas Martitz5d697462013-12-20 23:34:28 +0100109 va_end(ap);
110}
111
Peter D'Hoye3c1e9ca2008-09-07 20:09:11 +0000112#if NB_SCREENS == 2
113static int screen_helper_remote_getcharwidth(void)
114{
115#ifdef HAVE_LCD_BITMAP
116 return font_get(lcd_remote_getfont())->maxwidth;
117#else
118 return 1;
119#endif
120}
121
122static int screen_helper_remote_getcharheight(void)
123{
124#ifdef HAVE_LCD_BITMAP
125 return font_get(lcd_remote_getfont())->height;
126#else
127 return 1;
128#endif
129}
130
131static int screen_helper_remote_getnblines(void)
132{
133 int height=screens[1].lcdheight;
134#ifdef HAVE_LCD_BITMAP
Thomas Martitz2eb1cb62009-09-07 17:37:06 +0000135 if(global_settings.statusbar != STATUSBAR_OFF)
Peter D'Hoye3c1e9ca2008-09-07 20:09:11 +0000136 height -= STATUSBAR_HEIGHT;
137#ifdef HAVE_BUTTONBAR
Thomas Martitz2eb1cb62009-09-07 17:37:06 +0000138 if(global_settings.buttonbar && screens[1].has_buttonbar)
Peter D'Hoye3c1e9ca2008-09-07 20:09:11 +0000139 height -= BUTTONBAR_HEIGHT;
140#endif
141#endif
142 return height / screens[1].getcharheight();
143}
Jonathan Gordonaa0f4a42011-09-24 13:19:34 +0000144
145void screen_helper_remote_setfont(int font)
146{
147 if (font == FONT_UI)
148 font = global_status.font_id[SCREEN_REMOTE];
149 lcd_remote_setfont(font);
150}
Jonathan Gordonf19f3ef2011-11-08 10:09:33 +0000151
Boris Gjenero14c2e672011-12-21 17:36:18 +0000152static int screen_helper_remote_getuifont(void)
Jonathan Gordonf19f3ef2011-11-08 10:09:33 +0000153{
154#ifdef HAVE_LCD_BITMAP
155 return global_status.font_id[SCREEN_REMOTE];
156#else
157 return FONT_SYSFIXED;
158#endif
159}
160
Boris Gjenero14c2e672011-12-21 17:36:18 +0000161static void screen_helper_remote_setuifont(int font)
Jonathan Gordonf19f3ef2011-11-08 10:09:33 +0000162{
163#ifdef HAVE_LCD_BITMAP
164 global_status.font_id[SCREEN_REMOTE] = font;
165#endif
166}
167
Thomas Martitz5d697462013-12-20 23:34:28 +0100168static void screen_helper_remote_put_line(int x, int y, struct line_desc *line,
169 const char *fmt, ...)
170{
171 va_list ap;
172 va_start(ap, fmt);
Thomas Martitz124e9c12014-01-08 10:45:00 +0100173 vput_line(&screens[SCREEN_REMOTE], x, y, line, fmt, ap);
Thomas Martitz5d697462013-12-20 23:34:28 +0100174 va_end(ap);
175}
176
Peter D'Hoye3c1e9ca2008-09-07 20:09:11 +0000177#endif
178
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000179struct screen screens[NB_SCREENS] =
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +0000180{
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +0000181 {
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000182 .screen_type=SCREEN_MAIN,
Peter D'Hoye205f3df2008-06-28 20:45:21 +0000183 .lcdwidth=LCD_WIDTH,
184 .lcdheight=LCD_HEIGHT,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000185 .depth=LCD_DEPTH,
Peter D'Hoye3c1e9ca2008-09-07 20:09:11 +0000186 .getnblines=&screen_helper_getnblines,
Michael Sevakis6aa12c12006-10-14 01:32:58 +0000187#if defined(HAVE_LCD_COLOR)
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000188 .is_color=true,
Kevin Ferraref074b462007-07-18 11:18:52 +0000189#else
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000190 .is_color=false,
Kevin Ferraref074b462007-07-18 11:18:52 +0000191#endif
Kevin Ferrare93b2f9f2007-08-04 03:01:46 +0000192#ifdef HAVE_LCD_BITMAP
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000193 .pixel_format=LCD_PIXELFORMAT,
Kevin Ferrare93b2f9f2007-08-04 03:01:46 +0000194#endif
Peter D'Hoye3c1e9ca2008-09-07 20:09:11 +0000195 .getcharwidth=screen_helper_getcharwidth,
196 .getcharheight=screen_helper_getcharheight,
Jonathan Gordonbd47d482007-02-18 05:07:19 +0000197#if (CONFIG_LED == LED_VIRTUAL)
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000198 .has_disk_led=false,
Jens Arnold548755a2005-11-24 00:10:14 +0000199#elif defined(HAVE_REMOTE_LCD)
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000200 .has_disk_led=true,
Kevin Ferrare1a1abf22005-11-20 01:02:14 +0000201#endif
Thomas Martitzacee6752013-12-20 23:34:28 +0100202 .set_drawmode=&screen_helper_set_drawmode,
Dave Chapman3646c312008-01-08 01:22:14 +0000203 .set_viewport=&lcd_set_viewport,
Dave Chapman3646c312008-01-08 01:22:14 +0000204 .getwidth=&lcd_getwidth,
205 .getheight=&lcd_getheight,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000206 .getstringsize=&lcd_getstringsize,
Jens Arnoldad4e3d62007-03-26 07:52:13 +0000207#ifdef HAVE_LCD_BITMAP
Jonathan Gordonaa0f4a42011-09-24 13:19:34 +0000208 .setfont=screen_helper_setfont,
Jonathan Gordonf19f3ef2011-11-08 10:09:33 +0000209 .getuifont=screen_helper_getuifont,
210 .setuifont=screen_helper_setuifont,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000211 .mono_bitmap=&lcd_mono_bitmap,
212 .mono_bitmap_part=&lcd_mono_bitmap_part,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000213 .bitmap=(screen_bitmap_func*)&lcd_bitmap,
214 .bitmap_part=(screen_bitmap_part_func*)&lcd_bitmap_part,
Jens Arnold539c5132007-04-16 23:55:19 +0000215#if LCD_DEPTH <= 2
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000216 /* No transparency yet for grayscale and mono lcd */
217 .transparent_bitmap=(screen_bitmap_func*)&lcd_bitmap,
218 .transparent_bitmap_part=(screen_bitmap_part_func*)&lcd_bitmap_part,
Linus Nielsen Feltzing281403a2006-01-28 23:12:20 +0000219#else
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000220 .transparent_bitmap=(screen_bitmap_func*)&lcd_bitmap_transparent,
221 .transparent_bitmap_part=(screen_bitmap_part_func*)&lcd_bitmap_transparent_part,
Linus Nielsen Feltzing281403a2006-01-28 23:12:20 +0000222#endif
Thomas Martitz13209602011-11-08 21:34:46 +0000223 .bmp = &lcd_bmp,
224 .bmp_part = &lcd_bmp_part,
Jonathan Gordon685cf592012-12-03 20:43:58 +1100225 .nine_segment_bmp = &lcd_nine_segment_bmp,
Jens Arnold539c5132007-04-16 23:55:19 +0000226#if LCD_DEPTH > 1
Daniel Stenberg20a59262007-02-17 21:54:17 +0000227#if defined(HAVE_LCD_COLOR) && defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000228 .color_to_native=&lcd_color_to_native,
Michael Sevakis6aa12c12006-10-14 01:32:58 +0000229#endif
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000230 .get_background=&lcd_get_background,
231 .get_foreground=&lcd_get_foreground,
232 .set_background=&lcd_set_background,
233 .set_foreground=&lcd_set_foreground,
Jens Arnoldad4e3d62007-03-26 07:52:13 +0000234#endif /* LCD_DEPTH > 1 */
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000235 .update_rect=&lcd_update_rect,
Dave Chapman3646c312008-01-08 01:22:14 +0000236 .update_viewport_rect=&lcd_update_viewport_rect,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000237 .fillrect=&lcd_fillrect,
238 .drawrect=&lcd_drawrect,
Thomas Martitz3022a602010-10-11 01:19:55 +0000239 .draw_border_viewport=&lcd_draw_border_viewport,
240 .fill_viewport=&lcd_fill_viewport,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000241 .drawpixel=&lcd_drawpixel,
242 .drawline=&lcd_drawline,
243 .vline=&lcd_vline,
244 .hline=&lcd_hline,
245 .scroll_step=&lcd_scroll_step,
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +0000246#endif /* HAVE_LCD_BITMAP */
247
248#ifdef HAVE_LCD_CHARCELLS
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000249 .double_height=&lcd_double_height,
Thomas Martitz0246f0c2010-05-14 13:21:40 +0000250 .putchar=&lcd_putc,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000251 .get_locked_pattern=&lcd_get_locked_pattern,
252 .define_pattern=&lcd_define_pattern,
253 .unlock_pattern=&lcd_unlock_pattern,
254 .icon=&lcd_icon,
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +0000255#endif /* HAVE_LCD_CHARCELLS */
Jens Arnoldb85cdbb2005-11-19 11:45:08 +0000256
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000257 .putsxy=&lcd_putsxy,
258 .puts=&lcd_puts,
Nils Wallméniusf34a8412009-10-17 18:02:48 +0000259 .putsf=&lcd_putsf,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000260 .puts_scroll=&lcd_puts_scroll,
Thomas Martitz66309582013-12-20 23:34:28 +0100261 .putsxy_scroll_func=&lcd_putsxy_scroll_func,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000262 .scroll_speed=&lcd_scroll_speed,
263 .scroll_delay=&lcd_scroll_delay,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000264 .clear_display=&lcd_clear_display,
Dave Chapman3646c312008-01-08 01:22:14 +0000265 .clear_viewport=&lcd_clear_viewport,
Thomas Martitz50eb5282013-01-31 07:24:19 +0100266 .scroll_stop_viewport_rect=&lcd_scroll_stop_viewport_rect,
Dave Chapman3646c312008-01-08 01:22:14 +0000267 .scroll_stop=&lcd_scroll_stop,
Thomas Martitz1c5d0b42013-04-03 16:33:23 +0200268 .scroll_stop_viewport=&lcd_scroll_stop_viewport,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000269 .update=&lcd_update,
Dave Chapman3646c312008-01-08 01:22:14 +0000270 .update_viewport=&lcd_update_viewport,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000271 .backlight_on=&backlight_on,
272 .backlight_off=&backlight_off,
273 .is_backlight_on=&is_backlight_on,
Miika Pekkarinen47cdc892007-10-21 11:02:51 +0000274 .backlight_set_timeout=&backlight_set_timeout,
Jonathan Gordon25653892010-01-27 06:47:56 +0000275#if LCD_DEPTH > 1
Thomas Martitz4764ee02009-08-06 00:14:40 +0000276 .backdrop_load=&backdrop_load,
Thomas Martitz4764ee02009-08-06 00:14:40 +0000277 .backdrop_show=&backdrop_show,
Jonathan Gordon25653892010-01-27 06:47:56 +0000278#endif
Peter D'Hoyef76122f2008-05-29 20:32:39 +0000279#ifdef HAVE_BUTTONBAR
Thomas Martitz4764ee02009-08-06 00:14:40 +0000280 .has_buttonbar=false,
Kevin Ferraredb8415c2005-10-30 22:34:51 +0000281#endif
Jonathan Gordon2c71aa92012-02-28 22:26:32 +1100282#if defined(HAVE_LCD_BITMAP)
283 .set_framebuffer = (void*)lcd_set_framebuffer,
Jonathan Gordon014a08c2012-03-15 22:50:17 +1100284#if defined(HAVE_LCD_COLOR)
285 .gradient_fillrect = lcd_gradient_fillrect,
Thomas Martitz77836e52013-12-20 23:34:28 +0100286 .gradient_fillrect_part = lcd_gradient_fillrect_part,
Jonathan Gordon014a08c2012-03-15 22:50:17 +1100287#endif
Jonathan Gordon2c71aa92012-02-28 22:26:32 +1100288#endif
Thomas Martitz5d697462013-12-20 23:34:28 +0100289 .put_line = screen_helper_put_line,
Miika Pekkarinen47cdc892007-10-21 11:02:51 +0000290 },
291#if NB_SCREENS == 2
292 {
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000293 .screen_type=SCREEN_REMOTE,
Peter D'Hoye205f3df2008-06-28 20:45:21 +0000294 .lcdwidth=LCD_REMOTE_WIDTH,
295 .lcdheight=LCD_REMOTE_HEIGHT,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000296 .depth=LCD_REMOTE_DEPTH,
Peter D'Hoye3c1e9ca2008-09-07 20:09:11 +0000297 .getnblines=&screen_helper_remote_getnblines,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000298 .is_color=false,/* No color remotes yet */
299 .pixel_format=LCD_REMOTE_PIXELFORMAT,
Peter D'Hoye3c1e9ca2008-09-07 20:09:11 +0000300 .getcharwidth=screen_helper_remote_getcharwidth,
301 .getcharheight=screen_helper_remote_getcharheight,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000302 .has_disk_led=false,
Thomas Martitzacee6752013-12-20 23:34:28 +0100303 .set_drawmode=&lcd_remote_set_drawmode,
Dave Chapman3646c312008-01-08 01:22:14 +0000304 .set_viewport=&lcd_remote_set_viewport,
Dave Chapman3646c312008-01-08 01:22:14 +0000305 .getwidth=&lcd_remote_getwidth,
306 .getheight=&lcd_remote_getheight,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000307 .getstringsize=&lcd_remote_getstringsize,
308#if 1 /* all remote LCDs are bitmapped so far */
Jonathan Gordonf19f3ef2011-11-08 10:09:33 +0000309 .setfont=screen_helper_remote_setfont,
310 .getuifont=screen_helper_remote_getuifont,
311 .setuifont=screen_helper_remote_setuifont,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000312 .mono_bitmap=&lcd_remote_mono_bitmap,
313 .mono_bitmap_part=&lcd_remote_mono_bitmap_part,
314 .bitmap=(screen_bitmap_func*)&lcd_remote_bitmap,
315 .bitmap_part=(screen_bitmap_part_func*)&lcd_remote_bitmap_part,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000316#if LCD_REMOTE_DEPTH <= 2
317 /* No transparency yet for grayscale and mono lcd */
318 .transparent_bitmap=(screen_bitmap_func*)&lcd_remote_bitmap,
319 .transparent_bitmap_part=(screen_bitmap_part_func*)&lcd_remote_bitmap_part,
320 /* No colour remotes yet */
321#endif
Thomas Martitz13209602011-11-08 21:34:46 +0000322 .bmp = &lcd_remote_bmp,
323 .bmp_part = &lcd_remote_bmp_part,
Jonathan Gordonb0263be2012-12-09 17:27:11 +1100324 .nine_segment_bmp = &lcd_remote_nine_segment_bmp,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000325#if LCD_REMOTE_DEPTH > 1
326#if defined(HAVE_LCD_COLOR)
327 .color_to_native=&lcd_remote_color_to_native,
328#endif
329 .get_background=&lcd_remote_get_background,
330 .get_foreground=&lcd_remote_get_foreground,
331 .set_background=&lcd_remote_set_background,
332 .set_foreground=&lcd_remote_set_foreground,
333#endif /* LCD_REMOTE_DEPTH > 1 */
334 .update_rect=&lcd_remote_update_rect,
Dave Chapman3646c312008-01-08 01:22:14 +0000335 .update_viewport_rect=&lcd_remote_update_viewport_rect,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000336 .fillrect=&lcd_remote_fillrect,
337 .drawrect=&lcd_remote_drawrect,
Thomas Martitz3022a602010-10-11 01:19:55 +0000338 .draw_border_viewport=&lcd_remote_draw_border_viewport,
339 .fill_viewport=&lcd_remote_fill_viewport,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000340 .drawpixel=&lcd_remote_drawpixel,
341 .drawline=&lcd_remote_drawline,
342 .vline=&lcd_remote_vline,
343 .hline=&lcd_remote_hline,
344 .scroll_step=&lcd_remote_scroll_step,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000345#endif /* 1 */
346
347#if 0 /* no charcell remote LCDs so far */
348 .double_height=&lcd_remote_double_height,
349 .putc=&lcd_remote_putc,
350 .get_locked_pattern=&lcd_remote_get_locked_pattern,
351 .define_pattern=&lcd_remote_define_pattern,
352 .icon=&lcd_remote_icon,
353#endif /* 0 */
354 .putsxy=&lcd_remote_putsxy,
355 .puts=&lcd_remote_puts,
Nils Wallméniusf34a8412009-10-17 18:02:48 +0000356 .putsf=&lcd_remote_putsf,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000357 .puts_scroll=&lcd_remote_puts_scroll,
Thomas Martitz66309582013-12-20 23:34:28 +0100358 .putsxy_scroll_func=&lcd_remote_putsxy_scroll_func,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000359 .scroll_speed=&lcd_remote_scroll_speed,
360 .scroll_delay=&lcd_remote_scroll_delay,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000361 .clear_display=&lcd_remote_clear_display,
Dave Chapman3646c312008-01-08 01:22:14 +0000362 .clear_viewport=&lcd_remote_clear_viewport,
Thomas Martitz50eb5282013-01-31 07:24:19 +0100363 .scroll_stop_viewport_rect=&lcd_remote_scroll_stop_viewport_rect,
Dave Chapman3646c312008-01-08 01:22:14 +0000364 .scroll_stop=&lcd_remote_scroll_stop,
Thomas Martitz1c5d0b42013-04-03 16:33:23 +0200365 .scroll_stop_viewport=&lcd_remote_scroll_stop_viewport,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000366 .update=&lcd_remote_update,
Dave Chapman3646c312008-01-08 01:22:14 +0000367 .update_viewport=&lcd_remote_update_viewport,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000368 .backlight_on=&remote_backlight_on,
369 .backlight_off=&remote_backlight_off,
370 .is_backlight_on=&is_remote_backlight_on,
Thomas Martitz4764ee02009-08-06 00:14:40 +0000371 .backlight_set_timeout=&remote_backlight_set_timeout,
Jonathan Gordon6f0f98d2010-01-28 06:54:37 +0000372
Jonathan Gordon8efec132010-01-28 07:02:35 +0000373#if LCD_DEPTH > 1
Thomas Martitz4764ee02009-08-06 00:14:40 +0000374 .backdrop_load=&remote_backdrop_load,
Thomas Martitz4764ee02009-08-06 00:14:40 +0000375 .backdrop_show=&remote_backdrop_show,
Jonathan Gordon8efec132010-01-28 07:02:35 +0000376#endif
Thomas Martitz2eb1cb62009-09-07 17:37:06 +0000377#ifdef HAVE_BUTTONBAR
378 .has_buttonbar=false,
379#endif
Jonathan Gordon2c71aa92012-02-28 22:26:32 +1100380#if defined(HAVE_LCD_BITMAP)
381 .set_framebuffer = (void*)lcd_remote_set_framebuffer,
382#endif
Thomas Martitz5d697462013-12-20 23:34:28 +0100383 .put_line = screen_helper_remote_put_line,
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000384 }
Rafaël Carréb6122632012-01-07 19:35:46 +0000385#endif /* NB_SCREENS == 2 */
Nils Wallméniusa896f3d2007-09-18 19:05:35 +0000386};
Linus Nielsen Feltzing530ff7d2005-10-28 00:17:15 +0000387
Kevin Ferraref7c97522005-11-09 01:17:57 +0000388#ifdef HAVE_LCD_BITMAP
389void screen_clear_area(struct screen * display, int xstart, int ystart,
390 int width, int height)
391{
392 display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
393 display->fillrect(xstart, ystart, width, height);
394 display->set_drawmode(DRMODE_SOLID);
395}
396#endif