From e43b78ac466588d8a0bc95efd7b476495739c47a Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Wed, 16 Apr 2003 00:12:31 +0000 Subject: Magnus Ă–man's long awaited inverted cursor patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3565 a1c6a512-1295-4272-9138-f99709370657 --- apps/lang/english.lang | 5 +++++ apps/menu.c | 16 ++++++++++++---- apps/settings.c | 26 +++++++++++++++++-------- apps/settings.h | 3 +++ apps/settings_menu.c | 9 +++++++++ apps/tree.c | 42 +++++++++++++++++++++++++++++++++-------- firmware/drivers/lcd-recorder.c | 27 +++++++++++++++++++++++--- firmware/export/lcd.h | 6 ++++++ 8 files changed, 111 insertions(+), 23 deletions(-) diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 529000bec9..e080491e2c 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -1462,3 +1462,8 @@ id: LANG_VBRFIX desc: The context menu entry eng: "Update VBR file" new: + +id: LANG_INVERT_CURSOR +desc: in settings_menu +eng: "Invert cursor" +new: diff --git a/apps/menu.c b/apps/menu.c index bdf6f45e54..1c6be6f58a 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -64,7 +64,7 @@ struct menu { the margins, so this is the amount of lines we add to the cursor Y position to position it on a line */ -#define CURSOR_WIDTH 4 +#define CURSOR_WIDTH (global_settings.invert_cursor ? 0 : 4) #define SCROLLBAR_X 0 #define SCROLLBAR_Y lcd_getymargin() @@ -92,6 +92,8 @@ void put_cursorxy(int x, int y, bool on) #ifdef HAVE_LCD_BITMAP int fh, fw; int xpos, ypos; + if (global_settings.invert_cursor) + return; lcd_getstringsize("A", &fw, &fh); xpos = x*6; ypos = y*fh + lcd_getymargin(); @@ -146,7 +148,13 @@ static void menu_draw(int m) (i < menus[m].itemcount) && (i 0x09 0x1d 0x0a 0x1e -0x0b 0x1f +0x0b 0x1f 0x0c 0x20 0x0d 0x21 0x0e 0x22 start_tick = current_tick + scroll_delay; + s->invert = false; + if (style & STYLE_INVERT) { + s->invert = true; + lcd_puts_style(x,y,string,STYLE_INVERT); + } + else + lcd_puts(x,y,string); - lcd_puts(x,y,string); lcd_getstringsize(string, &w, &h); if (LCD_WIDTH - x * 8 - xmargin < w) { @@ -819,6 +838,8 @@ static void scroll_thread(void) lcd_clearrect(xpos, ypos, LCD_WIDTH - xmargin, h); lcd_putsxyofs(xpos, ypos, s->offset, s->line); + if (s->invert) + lcd_invertrect(xpos, ypos, LCD_WIDTH - xmargin, h); lcd_update_rect(xpos, ypos, LCD_WIDTH - xmargin, h); } diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 74bbcc304e..45d9296555 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h @@ -24,14 +24,20 @@ #include "sh7034.h" #include "config.h" +#define STYLE_DEFAULT 0 +#define STYLE_INVERT 1 + /* common functions */ extern void lcd_init(void); extern void lcd_clear_display(void); extern void lcd_backlight(bool on); extern void lcd_puts(int x, int y, unsigned char *string); +extern void lcd_puts_style(int x, int y, unsigned char *string, int style); extern void lcd_putc(int x, int y, unsigned short ch); extern void lcd_puts_scroll(int x, int y, unsigned char* string ); +extern void lcd_puts_scroll_style(int x, int y, unsigned char* string, + int style); extern void lcd_icon(int icon, bool enable); extern void lcd_stop_scroll(void); extern void lcd_scroll_speed( int speed ); -- cgit v1.2.3