From 6a5cc0bd25bd468c79e453fa49f353edd824141a Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 16 Apr 2007 09:14:36 +0000 Subject: Customizable icons for all bitmap targets. (FS#7013) http://www.rockbox.org/twiki/bin/view/Main/CustomIcons for info on format and how to load them git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13177 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/bmp.c | 7 ------- apps/recorder/icons.c | 38 -------------------------------------- apps/recorder/icons.h | 45 --------------------------------------------- apps/recorder/keyboard.c | 16 +++++++--------- 4 files changed, 7 insertions(+), 99 deletions(-) (limited to 'apps/recorder') diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c index b33c0a329d..352b2f47b1 100644 --- a/apps/recorder/bmp.c +++ b/apps/recorder/bmp.c @@ -215,13 +215,6 @@ int read_bmp_file(char* filename, } height = readlong(&bmph.height); - if (height > LCD_HEIGHT) { - DEBUGF("read_bmp_file: Bitmap too high (%d pixels, max is %d)\n", - height, LCD_HEIGHT); - close(fd); - return -5; - } - depth = readshort(&bmph.bit_count); padded_width = ((width * depth + 31) >> 3) & ~3; /* 4-byte boundary aligned */ diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index ccb42d5919..007cd07b7d 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c @@ -44,44 +44,6 @@ const unsigned char bitmap_icons_5x8[][5] = #endif }; -const unsigned char bitmap_icons_6x8[][6] = -{ - { 0x60, 0x7f, 0x03, 0x33, 0x3f, 0x00 }, /* Musical note */ - { 0x7e, 0x41, 0x41, 0x42, 0x7e, 0x00 }, /* Folder */ - { 0x55, 0x00, 0x55, 0x55, 0x55, 0x55 }, /* Playlist */ - { 0x3e, 0x1c, 0x08, 0x00, 0x00, 0x00 }, /* Cursor / Marker */ - { 0x58, 0x5f, 0x42, 0x50, 0x55, 0x55 }, /* WPS file */ - { 0x63, 0x7f, 0x3a, 0x7f, 0x63, 0x00 }, /* Mod or ajz file */ - { 0x60, 0x70, 0x38, 0x2c, 0x7e, 0x7e }, /* Font file */ - { 0x3e, 0x2a, 0x3e, 0x2a, 0x2a, 0x3e }, /* Language file */ - { 0x4e, 0x51, 0x51, 0x40, 0x55, 0x55 }, /* Config file */ - { 0x0a, 0x0a, 0x5f, 0x4e, 0x24, 0x18 }, /* Plugin file */ - { 0x7f, 0x41, 0x4f, 0x4a, 0x4c, 0x78 }, /* Bookmark file */ - { 0x5f, 0x45, 0x5b, 0x40, 0x55, 0x55 }, /* Preset file */ - { 0x77, 0x55, 0x55, 0x55, 0x55, 0x77 }, /* Queued Item */ - { 0x3e, 0x41, 0x3e, 0x1c, 0x1c, 0x08 }, /* Moving Item */ - { 0x7f, 0x7f, 0x1c, 0x3e, 0x77, 0x63 }, /* Keyboard file */ - { 0x00, 0x00, 0x00, 0x08, 0x1c, 0x3e }, /* Reverse Cursor / Marker */ - { 0x06, 0x03, 0x5b, 0x5b, 0x0f, 0x06 }, /* question mark */ - { 0x00, 0x18, 0x24, 0x24, 0x18, 0x00 }, /* Menu Settings */ - { 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00 }, /* function call from the menu */ - { 0x18, 0x18, 0x7e, 0x7e, 0x18, 0x18 }, /* sub menu */ - { 0x01, 0x55, 0x01, 0x55, 0x54, 0x54 }, /* in submenu */ - { 0x1c, 0x3e, 0x7f, 0x7f, 0x3e, 0x1c }, /* Recording menu */ - { 0x1c, 0x1c, 0x22, 0x41, 0x7f, 0x00 }, /* voice menu */ - { 0x06, 0x0f, 0x78, 0x78, 0x0f, 0x06 }, /* general settings menu */ - { 0x1e, 0x22, 0x49, 0x49, 0x22, 0x1e }, /* system menu */ - { 0x7f, 0x7f, 0x3e, 0x1c, 0x08, 0x00 }, /* playback menu */ - { 0x1f, 0x51, 0x71, 0x71, 0x51, 0x1f }, /* display menu */ - { 0x1e, 0x32, 0x32, 0x32, 0x1e, 0x00 }, /* remote display menu */ -#if CONFIG_TUNER - { 0x03, 0x05, 0x7f, 0x05, 0x03, 0x00 }, /* radio */ -#endif - { 0x1f, 0x11, 0x7d, 0x46, 0x44, 0x78 }, /* File View Menu */ - { 0x06, 0x7f, 0x06, 0x18, 0x7f, 0x18 }, /* EQ menu */ - { 0x20, 0x70, 0x70, 0x3f, 0x0a, 0x0a }, /* "rockbox" musical note */ -}; - const unsigned char bitmap_icons_7x8[][7] = { {0x08,0x1c,0x3e,0x3e,0x3e,0x14,0x14}, /* Power plug */ diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h index 7682d44733..8c4cd2b2dd 100644 --- a/apps/recorder/icons.h +++ b/apps/recorder/icons.h @@ -32,10 +32,6 @@ #include #endif -/* - * Icons of size 6x8 pixels - */ - /* Symbolic names for icons */ enum icons_5x8 { @@ -49,46 +45,6 @@ enum icons_5x8 { Icon5x8Last }; -/* If any icons are added to this enum, they must be - added to the unused_but_needed enum in ../player/icons.h */ -enum icons_6x8 { - Icon_Audio, - Icon_Folder, - Icon_Playlist, - Icon_Cursor, - Icon_Wps, - Icon_Firmware, - Icon_Font, - Icon_Language, - Icon_Config, - Icon_Plugin, - Icon_Bookmark, - Icon_Preset, - Icon_Queued, - Icon_Moving, - Icon_Keyboard, - Icon_Reverse_Cursor, - Icon_Questionmark, - Icon_Menu_setting, - Icon_Menu_functioncall, - Icon_Submenu, - Icon_Submenu_Entered, - Icon_Recording, - Icon_Voice, - Icon_General_settings_menu, - Icon_System_menu, - Icon_Playback_menu, - Icon_Display_menu, - Icon_Remote_Display_menu, -#if CONFIG_TUNER - Icon_Radio_screen, -#endif - Icon_file_view_menu, - Icon_EQ, - Icon_Rockbox, - Icon6x8Last, -}; - enum icons_7x8 { Icon_Plug, Icon_USBPlug, @@ -144,7 +100,6 @@ extern const unsigned char bitmap_formats_18x8[Format_18x8Last][18]; #endif /* CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING) */ extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5]; -extern const unsigned char bitmap_icons_6x8[Icon6x8Last][6]; extern const unsigned char bitmap_icons_7x8[Icon7x8Last][7]; extern const unsigned char bitmap_icon_disk[]; diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c index 9856e80d4a..bb8e4e93c3 100644 --- a/apps/recorder/keyboard.c +++ b/apps/recorder/keyboard.c @@ -31,7 +31,7 @@ #include "logf.h" #include "hangul.h" #include "action.h" -#include "icons.h" +#include "icon.h" #ifndef O_BINARY #define O_BINARY 0 @@ -654,10 +654,9 @@ int kbd_input(char* text, int buflen) /* Draw nicer bitmap arrow if room, else settle for "<". */ if (text_w >= 6 && pm->font_h >= 8) { - sc->mono_bitmap(bitmap_icons_6x8[Icon_Reverse_Cursor], - (text_w - 6) / 2, - pm->main_y + (pm->font_h - 8) / 2 , - 6, 8); + screen_put_iconxy(sc, (text_w - 6) / 2, + pm->main_y + (pm->font_h - 8) / 2 , + Icon_Reverse_Cursor); } else { @@ -672,10 +671,9 @@ int kbd_input(char* text, int buflen) /* Draw nicer bitmap arrow if room, else settle for ">". */ if (text_w >= 6 && pm->font_h >= 8) { - sc->mono_bitmap(bitmap_icons_6x8[Icon_Cursor], - sc->width - text_w + (text_w - 6) / 2, - pm->main_y + (pm->font_h - 8) / 2, - 6, 8); + screen_put_iconxy(sc, sc->width - text_w + (text_w - 6) / 2, + pm->main_y + (pm->font_h - 8) / 2, + Icon_Cursor); } else { -- cgit v1.2.3