summaryrefslogtreecommitdiffstats
path: root/apps/gui/textarea.c
diff options
context:
space:
mode:
authorKevin Ferrare <kevin@rockbox.org>2005-11-01 23:56:03 +0000
committerKevin Ferrare <kevin@rockbox.org>2005-11-01 23:56:03 +0000
commit4158ba1ff13d623ee32b91efedd4d1d2212543e4 (patch)
treecccb8c9a6080876bfed126604e1057e627368b1a /apps/gui/textarea.c
parent0b19487898b779b60de8f07ff1a52ef515b8d072 (diff)
downloadrockbox-4158ba1ff13d623ee32b91efedd4d1d2212543e4.tar.gz
rockbox-4158ba1ff13d623ee32b91efedd4d1d2212543e4.tar.bz2
rockbox-4158ba1ff13d623ee32b91efedd4d1d2212543e4.zip
Changed back the copyright's name in onplay.c (silly UTF-8, sorry Björn ! ), changed the internal multi-screen API a little bit, in a cleaner way
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7716 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/textarea.c')
-rw-r--r--apps/gui/textarea.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/apps/gui/textarea.c b/apps/gui/textarea.c
new file mode 100644
index 0000000000..c49602611f
--- /dev/null
+++ b/apps/gui/textarea.c
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2005 by Kevin Ferrare
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#include "textarea.h"
+
+void gui_textarea_clear(struct screen * display)
+{
+#ifdef HAVE_LCD_BITMAP
+ int y_start = gui_textarea_get_ystart(display);
+ int y_end = gui_textarea_get_yend(display);
+
+ display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
+ display->fillrect(0, y_start, display->width, y_end - y_start);
+ display->set_drawmode(DRMODE_SOLID);
+ display->stop_scroll();
+ screen_set_ymargin(display, y_start);
+#else
+ display->clear_display();
+#endif
+}
+
+#ifdef HAVE_LCD_BITMAP
+void gui_textarea_update(struct screen * display)
+{
+ int y_start = gui_textarea_get_ystart(display);
+ int y_end = gui_textarea_get_yend(display);
+ display->update_rect(0, y_start, display->width, y_end - y_start);
+}
+#endif
+
+void gui_textarea_update_nblines(struct screen * display)
+{
+#ifdef HAVE_LCD_BITMAP
+ int height=display->height;
+ if(global_settings.statusbar)
+ height -= STATUSBAR_HEIGHT;
+#ifdef HAS_BUTTONBAR
+ if(global_settings.buttonbar && display->has_buttonbar)
+ height -= BUTTONBAR_HEIGHT;
+#endif
+ display->getstringsize("A", &display->char_width, &display->char_height);
+ display->nb_lines = height / display->char_height;
+#else
+ display->char_width = 1;
+ display->char_height = 1;
+ /* default on char based player supported by rb */
+ display->nb_lines = MAX_LINES_ON_SCREEN;
+#endif
+}