1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2005 by Kevin Ferrare
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
23 void gui_textarea_clear(struct screen
* display
)
25 #ifdef HAVE_LCD_BITMAP
26 int y_start
= gui_textarea_get_ystart(display
);
27 int y_end
= gui_textarea_get_yend(display
);
28 screen_clear_area(display
, 0, y_start
, display
->width
, y_end
- y_start
);
29 display
->stop_scroll();
30 screen_set_ymargin(display
, y_start
);
32 display
->clear_display();
36 void gui_textarea_update(struct screen
* display
)
38 #ifdef HAVE_LCD_BITMAP
39 int y_start
= gui_textarea_get_ystart(display
);
40 int y_end
= gui_textarea_get_yend(display
);
41 display
->update_rect(0, y_start
, display
->width
, y_end
- y_start
);
47 int gui_textarea_put_message(struct screen
* display
,
48 struct text_message
* message
,
52 gui_textarea_clear(display
);
53 for(i
=0;i
<message
->nb_lines
&& i
+ystart
<display
->nb_lines
;i
++)
54 display
->puts_scroll(0, i
+ystart
, (unsigned char *)message
->message_lines
[i
]);
55 gui_textarea_update(display
);
59 void gui_textarea_update_nblines(struct screen
* display
)
61 int height
=display
->height
;
62 #ifdef HAVE_LCD_BITMAP
63 if(global_settings
.statusbar
)
64 height
-= STATUSBAR_HEIGHT
;
66 if(global_settings
.buttonbar
&& display
->has_buttonbar
)
67 height
-= BUTTONBAR_HEIGHT
;
69 display
->getstringsize((unsigned char *)"A", &display
->char_width
,
70 &display
->char_height
);
72 display
->char_width
= 1;
73 display
->char_height
= 1;
75 display
->nb_lines
= height
/ display
->char_height
;