summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-recorder.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-09-24 18:04:15 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-09-24 18:04:15 +0000
commita4c3b03f15eefd516224e429215258bffa0221de (patch)
tree84ab843fdeaed0010f09a5de80ba679258e4fcd3 /firmware/drivers/lcd-recorder.c
parent614272c45f6235b01685d3aa48b5a154f9362c10 (diff)
downloadrockbox-a4c3b03f15eefd516224e429215258bffa0221de.tar.gz
rockbox-a4c3b03f15eefd516224e429215258bffa0221de.zip
Removed lcd_getfontsize(). Removed font parameters to lcd_putsxy and lcd_getstringsize.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2403 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-recorder.c')
-rw-r--r--firmware/drivers/lcd-recorder.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index 9f86d8f1c4..fee42d9ef4 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -228,17 +228,9 @@ void lcd_setfont(int newfont)
228 curfont = newfont; 228 curfont = newfont;
229} 229}
230 230
231void lcd_getfontsize(int font, int *width, int *height) 231int lcd_getstringsize(unsigned char *str, int *w, int *h)
232{ 232{
233 struct font* pf = font_get(font); 233 struct font* pf = font_get(curfont);
234
235 *width = pf->maxwidth;
236 *height = pf->height;
237}
238
239int lcd_getstringsize(unsigned char *str, int font, int *w, int *h)
240{
241 struct font* pf = font_get(font);
242 int ch; 234 int ch;
243 int width = 0; 235 int width = 0;
244 236
@@ -279,10 +271,10 @@ void lcd_puts(int x, int y, unsigned char *str)
279 if(!str || !str[0]) 271 if(!str || !str[0])
280 return; 272 return;
281 273
282 lcd_getstringsize(str, curfont, &w, &h); 274 lcd_getstringsize(str, &w, &h);
283 xpos = xmargin + x*w / strlen(str); 275 xpos = xmargin + x*w / strlen(str);
284 ypos = ymargin + y*h; 276 ypos = ymargin + y*h;
285 lcd_putsxy( xpos, ypos, str, curfont); 277 lcd_putsxy(xpos, ypos, str);
286 lcd_clearrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h); 278 lcd_clearrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h);
287 279
288#if defined(SIMULATOR) && defined(HAVE_LCD_CHARCELLS) 280#if defined(SIMULATOR) && defined(HAVE_LCD_CHARCELLS)
@@ -293,10 +285,10 @@ void lcd_puts(int x, int y, unsigned char *str)
293} 285}
294 286
295/* put a string at a given pixel position */ 287/* put a string at a given pixel position */
296void lcd_putsxy(int x, int y, unsigned char *str, int font) 288void lcd_putsxy(int x, int y, unsigned char *str)
297{ 289{
298 int ch; 290 int ch;
299 struct font* pf = font_get(font); 291 struct font* pf = font_get(curfont);
300 292
301 while (((ch = *str++) != '\0')) { 293 while (((ch = *str++) != '\0')) {
302 bitmap_t *bits; 294 bitmap_t *bits;
@@ -645,15 +637,14 @@ void lcd_puts_scroll(int x, int y, unsigned char* string )
645 struct scrollinfo* s = &scroll; 637 struct scrollinfo* s = &scroll;
646 unsigned char ch[2]; 638 unsigned char ch[2];
647 int w, h; 639 int w, h;
648 int width, height; 640 int width;
649 lcd_getfontsize(curfont, &width, &height);
650 641
651 ch[1] = 0; /* zero terminate */ 642 ch[1] = 0; /* zero terminate */
652 ch[0] = string[0]; 643 ch[0] = string[0];
653 width = 0; 644 width = 0;
654 s->space = 0; 645 s->space = 0;
655 while ( ch[0] && 646 while ( ch[0] &&
656 (width + lcd_getstringsize(ch, curfont, &w, &h) < 647 (width + lcd_getstringsize(ch, &w, &h) <
657 (LCD_WIDTH - x*8))) { 648 (LCD_WIDTH - x*8))) {
658 width += w; 649 width += w;
659 s->space++; 650 s->space++;
@@ -664,7 +655,7 @@ void lcd_puts_scroll(int x, int y, unsigned char* string )
664 s->textlen = strlen(string); 655 s->textlen = strlen(string);
665 656
666 s->space += 2; 657 s->space += 2;
667 lcd_getstringsize(string,curfont,&w,&h); 658 lcd_getstringsize(string,&w,&h);
668 if ( w > LCD_WIDTH - xmargin ) { 659 if ( w > LCD_WIDTH - xmargin ) {
669 s->offset=s->space; 660 s->offset=s->space;
670 s->startx=x; 661 s->startx=x;
@@ -688,7 +679,7 @@ void lcd_stop_scroll(void)
688 struct scrollinfo* s = &scroll; 679 struct scrollinfo* s = &scroll;
689 scroll_count = 0; 680 scroll_count = 0;
690 681
691 lcd_getstringsize( s->text, FONT_UI, &w, &h); 682 lcd_getstringsize( s->text, &w, &h);
692 lcd_clearrect(xmargin + s->startx*w/s->textlen, 683 lcd_clearrect(xmargin + s->startx*w/s->textlen,
693 ymargin + s->starty*h, 684 ymargin + s->starty*h,
694 LCD_WIDTH - xmargin, 685 LCD_WIDTH - xmargin,
@@ -745,7 +736,7 @@ static void scroll_thread(void)
745 s->offset = 0; 736 s->offset = 0;
746 } 737 }
747 738
748 lcd_getstringsize( s->text, FONT_UI, &w, &h); 739 lcd_getstringsize( s->text, &w, &h);
749 lcd_clearrect(xmargin + s->startx*w/s->textlen, 740 lcd_clearrect(xmargin + s->startx*w/s->textlen,
750 ymargin + s->starty*h, 741 ymargin + s->starty*h,
751 LCD_WIDTH - xmargin, 742 LCD_WIDTH - xmargin,