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 ****************************************************************************/
25 void gui_textarea_clear(struct screen
* display
)
27 #ifdef HAVE_LCD_BITMAP
28 int y_start
= gui_textarea_get_ystart(display
);
29 int y_end
= gui_textarea_get_yend(display
);
30 screen_clear_area(display
, 0, y_start
, display
->width
, y_end
- y_start
);
31 display
->stop_scroll();
32 screen_set_ymargin(display
, y_start
);
34 display
->clear_display();
38 void gui_textarea_update(struct screen
* display
)
40 #ifdef HAVE_LCD_BITMAP
41 int y_start
= gui_textarea_get_ystart(display
);
42 int y_end
= gui_textarea_get_yend(display
);
43 display
->update_rect(0, y_start
, display
->width
, y_end
- y_start
);
49 int gui_textarea_put_message(struct screen
* display
,
50 struct text_message
* message
,
54 gui_textarea_clear(display
);
55 for(i
=0;i
<message
->nb_lines
&& i
+ystart
<display
->nb_lines
;i
++)
56 display
->puts_scroll(0, i
+ystart
, P2STR((unsigned char *)message
->
58 gui_textarea_update(display
);
62 void gui_textarea_update_nblines(struct screen
* display
)
64 int height
=display
->height
;
65 #ifdef HAVE_LCD_BITMAP
66 if(global_settings
.statusbar
)
67 height
-= STATUSBAR_HEIGHT
;
69 if(global_settings
.buttonbar
&& display
->has_buttonbar
)
70 height
-= BUTTONBAR_HEIGHT
;
72 display
->getstringsize((unsigned char *)"A", &display
->char_width
,
73 &display
->char_height
);
75 display
->char_width
= 1;
76 display
->char_height
= 1;
78 display
->nb_lines
= height
/ display
->char_height
;
81 void talk_text_message(struct text_message
* message
, bool enqueue
)
85 for(line
=0; line
<message
->nb_lines
; line
++)
87 long id
= P2ID((unsigned char *)message
->message_lines
[line
]);