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 ****************************************************************************/
20 #ifndef _GUI_TEXTAREA_H_
21 #define _GUI_TEXTAREA_H_
22 #include "screen_access.h"
24 #include "statusbar.h"
33 * Clears the area in the screen in which text can be displayed
34 * and sets the y margin properly
35 * - display : the screen structure
37 extern void gui_textarea_clear(struct screen
* display
);
40 * Updates the area in the screen in which text can be displayed
41 * - display : the screen structure
43 extern void gui_textarea_update(struct screen
* display
);
46 * Displays message lines on the given screen
47 * - display : the screen structure
48 * - message : the lines to display
49 * - ystart : the lineon which we start displaying
50 * returns : the number of lines effectively displayed
52 extern int gui_textarea_put_message(struct screen
* display
,
53 struct text_message
* message
,
56 * Compute the number of text lines the display can draw with the current font
57 * Also updates the char height and width
58 * - display : the screen structure
60 extern void gui_textarea_update_nblines(struct screen
* display
);
63 * Speak a text_message. The message's lines may be virtual pointers
64 * representing language / voicefont IDs (see settings.h).
66 extern void talk_text_message(struct text_message
* message
, bool enqueue
);
68 #ifdef HAVE_LCD_BITMAP
70 * Compute the number of pixels from which text can be displayed
71 * - display : the screen structure
72 * Returns the number of pixels
74 #define gui_textarea_get_ystart(display) \
75 ( (global_settings.statusbar)? STATUSBAR_HEIGHT : 0)
78 * Compute the number of pixels below which text can't be displayed
79 * - display : the screen structure
80 * Returns the number of pixels
83 #define gui_textarea_get_yend(display) \
84 ( (display)->height - ( (global_settings.buttonbar && \
85 (display)->has_buttonbar)? \
86 BUTTONBAR_HEIGHT : 0) )
88 #define gui_textarea_get_yend(display) \
90 #endif /* HAS_BUTTONBAR */
92 #endif /* HAVE_LCD_BITMAP */
94 #endif /* _GUI_TEXTAREA_H_ */