]> code.delx.au - refind/commitdiff
Refinements to icons_dir feature; version 0.3.4 release.
authorsrs5694 <srs5694@users.sourceforge.net>
Wed, 9 May 2012 17:19:37 +0000 (13:19 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Wed, 9 May 2012 17:19:37 +0000 (13:19 -0400)
18 files changed:
BUILDING.txt
NEWS.txt
docs/refind/bootmode.html
docs/refind/configfile.html
docs/refind/drivers.html
docs/refind/features.html
docs/refind/getting.html
docs/refind/index.html
docs/refind/installing.html
docs/refind/linux.html
docs/refind/revisions.html
docs/refind/themes.html
docs/refind/todo.html
docs/refind/using.html
libeg/image.c
refind.conf-sample
refind/icns.c
refind/main.c

index 91d86f9d579d9a8c7dec3f96254ac25a16352c4b..2c624c644d036f7934f96bbadce0e4b70206c774 100644 (file)
@@ -151,3 +151,6 @@ build process for your binary packages (RPMs, Debian packages, etc.).
 (Gentoo could use it in an ebuild, though....) You COULD, however, copy the
 files to a directory somewhere (/usr/share/refind or whatever) and then
 call install.sh as part of the binary package installation process.
+Placing the files in /boot/efi/EFI/{distname}/refind and then having a
+post-install script call efibootmgr is probably the better way to go,
+though.
index 23d3378fb5cbc711ceffb67f827f2fd3bb2437ba..8fb2dc561244584317bc21c4580d0ec12873cec3 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,5 +1,5 @@
-0.3.4 (?/??/2012):
-------------------
+0.3.4 (5/9/2012):
+-----------------
 
 - Added new configuration file option: "icons_dir", which sets the name
   of the subdirectory in which icons are found. See the documentation or
index 165d0c3a04216d1960d9fd5e1713a6a1fd97b7fd..a972b19a709934082ef21d91510887bf69e3c67a 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>\r
 \r
 <p>Originally written: 3/14/2012; last Web page update:\r
-5/6/2012, referencing rEFInd 0.3.3</p>\r
+5/9/2012, referencing rEFInd 0.3.4</p>\r
 \r
 \r
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>\r
index 2a133663984fbce1610e105de32cefb9cb944886..b65c6fa7831b13f7ca95498fba1b5fe9bbe5041b 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
@@ -151,7 +151,7 @@ timeout 20
 <tr>
    <td><tt>icons_dir</tt></td>
    <td>directory name</td>
-   <td>Specifies a directory in which custom icons may be found. This directory should contain files with the same names as the files in the standard <tt>icons</tt> directory. The directory name is specified relative to the directory in which the rEFInd binary resides.</td>
+   <td>Specifies a directory in which custom icons may be found. This directory should contain files with the same names as the files in the standard <tt>icons</tt> directory. The directory name is specified relative to the directory in which the rEFInd binary resides. The standard <tt>icons</tt> directory is searched if an icon can't be found in the one specified by <tt>icons_dir</tt>, so you can use this location to redefine just some icons.</td>
 </tr>
 <tr>
    <td><tt>banner</tt></td>
@@ -270,7 +270,7 @@ default_selection elilo
 <tr>
    <td><tt>icon</tt></td>
    <td>filename</td>
-   <td>Sets the filename for an icon for the menu. If you omit this item, a default icon will be used, based on rEFInd's auto-detection algorithms.</td>
+   <td>Sets the filename for an icon for the menu. If you omit this item, a default icon will be used, based on rEFInd's auto-detection algorithms. The filename should be a complete path from the root of the current directory, not relative to the default icons subdirectory or the one set via <tt>icons_dir</tt>.</td>
 </tr>
 <tr>
    <td><tt>ostype</tt></td>
index 22a8fe0c45c1bef3a5414dbdfe5eaa6e732bf6a3..879c680cdfd0cdf4ac0773fe11bdd472c885519e 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 4/19/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
index e47ae1db80f6d58e3d634ab4551bcd3c121ba5c6..417171cc3479a53502453fc2813f5c0142695540 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
 
@@ -129,6 +129,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <li>The ability to specify additional directories to scan for boot loaders and drivers (as of version 0.2.7).</li>
 
+<li>The ability to specify an additional icon storage directory, to assist in efforts to customize rEFInd's appearance (as of version 0.3.4).</li>
+
 <li>The ability to set the screen's resolution, within limits imposed by the EFI (as of rEFInd 0.3.0).</li>
 
 <li>Proper handling of more OS options than can fit on the screen. (rEFIt displays an empty list in graphical mode when it detects too many OSes.)</li>
index 41c31d0858aef714f4bd2e904239f67c217ca5b9..dc44ae0d218d21bee5b7e7e0a7900fe437a85121 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
 
@@ -97,7 +97,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <ul>
 
-<li><b><a href="http://sourceforge.net/projects/refind/files/0.3.3/refind-src-0.3.3.zip/download">A
+<li><b><a href="http://sourceforge.net/projects/refind/files/0.3.4/refind-src-0.3.4.zip/download">A
     source code zip file</a></b>&mdash;This is useful if you want to
     compile the software locally. Note that I use Linux with the <a
     href="http://sourceforge.net/projects/gnu-efi">GNU-EFI</a> development
@@ -106,7 +106,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
     it.</li>
 
 <li><b><a
-    href="http://sourceforge.net/projects/refind/files/0.3.3/refind-bin-0.3.3.zip/download">A
+    href="http://sourceforge.net/projects/refind/files/0.3.4/refind-bin-0.3.4.zip/download">A
     binary zip file</a></b>&mdash;Download this if you want to install
     rEFInd on an <i>x</i>86 or <i>x</i>86-64 computer and have no need to
     test rEFInd first by booting it on an optical disc. This zip file
@@ -116,7 +116,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
     href="installing.html">Installing rEFInd</a> page.</li>
 
 <li><b><a
-    href="http://sourceforge.net/projects/refind/files/0.3.3/refind-cd-0.3.3.zip/download">A
+    href="http://sourceforge.net/projects/refind/files/0.3.4/refind-cd-0.3.4.zip/download">A
     CD-R image file</a></b>&mdash;This download contains the same files as
     the zip file, but you can burn it to a CD-R to test rEFInd without
     installing it first. (It boots on UEFI PCs, but fails on some older
index a00829078e32e30a53467086c00480c92313e778..3fe4fca37f73aae0eeddd409827e9928c9af1691 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
index 7be19bd29837f1edce073c608b8fd4bb6f075406..288c86cd0e32a08ee12ae7ad66e4ca2d282b5d9b 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
index e6dbcbf1ee164a50281f9c0bd46db41c38d4f2b9..5d52042b264f445fd9b743e93da5cef7e932ee3c 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/19/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
index 1ea8d935a3ff32fbd201fe9f0d6f90f9e6622380..38a1a91abef9623db2c9c6d037556dc4ef031182 100644 (file)
@@ -14,7 +14,7 @@
 <p class="subhead">by Roderick W. Smith, <a
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
-<p>Last Web page update: 5/6/2012</p>
+<p>Last Web page update: 5/9/2012</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
@@ -93,6 +93,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <ul>
 
+<li><b>0.3.4 (5/9/2012)</b>&mdash;The biggest change to this version is the addition of the <tt>icons_dir</tt> configuration file token, which enables you to specify a directory that holds icons that override those in the default <tt>icons</tt> subdirectory. See the <a href="themes.html">Theming rEFInd</a> and <a href="configfile.html">Configuring the Boot Manager</a> pages for details. This version also reduces flicker when moving your selection around the screen and modifies the <tt>install.sh</tt> script so that it can be used directly after building rEFInd from source code. Related to this, building from source now creates a binary that includes an architecture code&mdash;<tt>refind_ia32.efi</tt> or <tt>refind_x64.efi</tt> rather than <tt>refind.efi</tt>.</li>
+
 <li><b>0.3.3 (5/6/2012)</b>&mdash;I've focused on user interface improvements for this release. The biggest improvement is in the text-mode interface, which suffered from assorted display glitches in previous releases. These have now been fixed, so the text-mode interface should be more usable. I've also fine-tuned the use of keyboard keys, particularly in graphical mode. The up and down arrow keys now move between the two rows of the display, and Page Up and Page Down scroll the first row if it's too big for the display. (They'll also move between rows, but only when at the end of the first row or the start of the second.) Returning from a failed loader or a tool or built-in function now renders that tag as the currently-selected item, rather than setting the default loader as active, as happened with previous versions.</li>
 
 <li><b>0.3.2 (5/4/2012)</b>&mdash;rEFInd's core functionality changes very little with this version; I've tweaked the detection of BIOS-mode boot loaders to keep unbootable FAT partitions created under Linux and Windows out of the boot list, while adding detection of GRUB BIOS Boot Partitions to the list. I've also made a change that improves screen-clearing when launching EFI utilities and OSes in text mode. The major change to this version is the addition of a new Linux/OS X installation script, <tt>install.sh</tt>. In most cases, this makes it possible to install rEFInd simply by typing <tt class="userinput">./install.sh</tt> from the rEFInd package directory; however, you should see the <a href="installing.html">Installing rEFInd</a> page for details. In some cases, manual installation may still be required. Also, you may prefer to copy over the old rEFInd program file with the new one when upgrading.</li>
index 261a61d57297de8fb2ec5c31c8a10f9e0e2a3942..d231ac77ecc55bdde3a4128f036465cd0481ae70 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 4/19/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.4</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
@@ -96,7 +96,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <ul>
 
-<li>You can create new icons, place them in a subdirectory rEFInd's main directory, and tell the program to use the new icons by setting the <tt>icons_dir</tt> token in <tt>refind.conf</tt>. This will affect the appearance of the OS tags, the utility tags, and so on. The names of these icons should match those in the <tt>icons</tt> subdirectory, and are fairly self-explanatory. Be aware that rEFInd expects its icons to be in Apple's <a href="http://en.wikipedia.org/wiki/Icns">icon image format (ICNS).</a> You can generate such files easily in various Apple programs, or by using the <a href="http://icns.sourceforge.net/">libicns</a> library (and in particular its <tt>png2icns</tt> program) in Linux.</li>
+<li>You can create new icons, place them in a subdirectory of rEFInd's main directory, and tell the program to use the new icons by setting the <tt>icons_dir</tt> token in <tt>refind.conf</tt>. This will affect the appearance of the OS tags, the utility tags, and so on. The names of these icons should match those in the <tt>icons</tt> subdirectory, and are fairly self-explanatory. If an icon is missing from the directory specified by <tt>icons_dir</tt>, rEFInd falls back to the icon from the standard <tt>icons</tt> subdirectory; thus, you can replace just a subset of the standard icons. Be aware that rEFInd expects its icons to be in Apple's <a href="http://en.wikipedia.org/wiki/Icns">icon image format (ICNS).</a> You can generate such files easily in various Apple programs, or by using the <a href="http://icns.sourceforge.net/">libicns</a> library (and in particular its <tt>png2icns</tt> program) in Linux.</li>
 
 <li>You can do as above, but place your new icons in the default <tt>icons</tt> subdirectory. This method is discouraged because using the <tt>install.sh</tt> script to upgrade rEFInd will replace your customized icons.</li>
 
index 19c4d335422aa326aed4edccf55ddac0bd4ddedf..cef030735c56d638df03de2f9688ec00d8d3582b 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
@@ -126,10 +126,6 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
     themes for rEFInd, see the <a href="themes.html">Theming rEFInd</a>
     page.</li>
 
-<li>If the <tt>icons_dir</tt> option points to a non-existent directory,
-    the program displays ugly "icon-missing" icons. It would be better to
-    drop back to the default icon set.</li>
-
 <li>The code could be more flexible in its handling of the sizes of various
     graphical elements, and particularly drawn text. Prior to version
     0.2.2, submenu text was invisible on UEFI-based PCs with 800x600 and
index 1e0ccfc8c72a6b0848b69c9f609020b0de4f8f2b..bf150e2078ce57a2028859fb684c8c11683f390c 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-5/6/2012, referencing rEFInd 0.3.3</p>
+5/9/2012, referencing rEFInd 0.3.4</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
index 4dac964bdbb4fb1f4564096a023db48b765949f2..271141fbcc99f1a8a4abbbad00e435d3bb9d2ec5 100644 (file)
@@ -35,6 +35,8 @@
  */
 
 #include "libegint.h"
+#include "../refind/global.h"
+#include "../refind/lib.h"
 #include "refit_call_wrapper.h"
 
 #define MAX_FILE_SIZE (1024*1024*1024)
@@ -46,7 +48,7 @@
 EG_IMAGE * egCreateImage(IN UINTN Width, IN UINTN Height, IN BOOLEAN HasAlpha)
 {
     EG_IMAGE        *NewImage;
-    
+
     NewImage = (EG_IMAGE *) AllocatePool(sizeof(EG_IMAGE));
     if (NewImage == NULL)
         return NULL;
@@ -55,7 +57,7 @@ EG_IMAGE * egCreateImage(IN UINTN Width, IN UINTN Height, IN BOOLEAN HasAlpha)
         FreePool(NewImage);
         return NULL;
     }
-    
+
     NewImage->Width = Width;
     NewImage->Height = Height;
     NewImage->HasAlpha = HasAlpha;
@@ -65,11 +67,11 @@ EG_IMAGE * egCreateImage(IN UINTN Width, IN UINTN Height, IN BOOLEAN HasAlpha)
 EG_IMAGE * egCreateFilledImage(IN UINTN Width, IN UINTN Height, IN BOOLEAN HasAlpha, IN EG_PIXEL *Color)
 {
     EG_IMAGE        *NewImage;
-    
+
     NewImage = egCreateImage(Width, Height, HasAlpha);
     if (NewImage == NULL)
         return NULL;
-    
+
     egFillImage(NewImage, Color);
     return NewImage;
 }
@@ -111,14 +113,12 @@ EFI_STATUS egLoadFile(IN EFI_FILE* BaseDir, IN CHAR16 *FileName,
 
     Status = refit_call5_wrapper(BaseDir->Open, BaseDir, &FileHandle, FileName, EFI_FILE_MODE_READ, 0);
     if (EFI_ERROR(Status)) {
-//        Print(L"Returning %d from egLoadFile() because of an error on open!\n", Status);
         return Status;
     }
 
     FileInfo = LibFileInfo(FileHandle);
     if (FileInfo == NULL) {
         refit_call1_wrapper(FileHandle->Close, FileHandle);
-//        Print(L"LibFileInfo() returned NULL!\n");
         return EFI_NOT_FOUND;
     }
     ReadSize = FileInfo->FileSize;
@@ -132,7 +132,7 @@ EFI_STATUS egLoadFile(IN EFI_FILE* BaseDir, IN CHAR16 *FileName,
         refit_call1_wrapper(FileHandle->Close, FileHandle);
         return EFI_OUT_OF_RESOURCES;
     }
-    
+
     Status = refit_call3_wrapper(FileHandle->Read, FileHandle, &BufferSize, Buffer);
     refit_call1_wrapper(FileHandle->Close, FileHandle);
     if (EFI_ERROR(Status)) {
@@ -142,7 +142,6 @@ EFI_STATUS egLoadFile(IN EFI_FILE* BaseDir, IN CHAR16 *FileName,
 
     *FileData = Buffer;
     *FileDataLength = BufferSize;
-//    Print(L"In egLoadFile(), Returning EFI_SUCCESS\n");
     return EFI_SUCCESS;
 }
 
@@ -247,32 +246,40 @@ EG_IMAGE * egLoadImage(IN EFI_FILE* BaseDir, IN CHAR16 *FileName, IN BOOLEAN Wan
     return NewImage;
 }
 
-EG_IMAGE * egLoadIcon(IN EFI_FILE* BaseDir, IN CHAR16 *FileName, IN UINTN IconSize)
+// Load an icon from (BaseDir)/Path, extracting the icon of size IconSize x IconSize.
+// If the initial attempt is unsuccessful, try again, replacing the directory
+// component of Path with DEFAULT_ICONS_DIR.
+// Note: The assumption is that BaseDir points to rEFInd's home directory and Path
+// includes one subdirectory level. If this changes in future revisions, it may be
+// necessary to alter the code that tries again with DEFAULT_ICONS_DIR.
+// Returns a pointer to the image data, or NULL if the icon could not be loaded.
+EG_IMAGE * egLoadIcon(IN EFI_FILE* BaseDir, IN CHAR16 *Path, IN UINTN IconSize)
 {
     EFI_STATUS      Status;
     UINT8           *FileData;
     UINTN           FileDataLength;
+    CHAR16          *FileName, FileName2[256];
     EG_IMAGE        *NewImage;
 
-    if (BaseDir == NULL || FileName == NULL)
+    if (BaseDir == NULL || Path == NULL)
         return NULL;
 
     // load file
-    Status = egLoadFile(BaseDir, FileName, &FileData, &FileDataLength);
+    Status = egLoadFile(BaseDir, Path, &FileData, &FileDataLength);
     if (EFI_ERROR(Status)) {
-//        Print(L"In egLoadIcon(), Status = %d after egLoadFile(); aborting load!\n", Status);
-        return NULL;
+        FileName = Basename(Path); // Note: FileName is a pointer within Path; DON'T FREE IT!
+        SPrint(FileName2, 255, L"%s\\%s", DEFAULT_ICONS_DIR, FileName);
+        Status = egLoadFile(BaseDir, FileName2, &FileData, &FileDataLength);
+        if (EFI_ERROR(Status))
+           return NULL;
     }
 
     // decode it
-    NewImage = egDecodeAny(FileData, FileDataLength, egFindExtension(FileName), IconSize, TRUE);
-//    Print(L"Done with egDecodeAny(), used extension '%s'\n", egFindExtension(FileName));
-//    if (NewImage == NULL)
-//       Print(L"Returning NULL from egLoadIcon()\n");
+    NewImage = egDecodeAny(FileData, FileDataLength, egFindExtension(Path), IconSize, TRUE);
     FreePool(FileData);
 
     return NewImage;
-}
+} // EG_IMAGE *egLoadIcon()
 
 EG_IMAGE * egDecodeImage(IN UINT8 *FileData, IN UINTN FileDataLength, IN CHAR16 *Format, IN BOOLEAN WantAlpha)
 {
@@ -285,26 +292,26 @@ EG_IMAGE * egPrepareEmbeddedImage(IN EG_EMBEDDED_IMAGE *EmbeddedImage, IN BOOLEA
     UINT8               *CompData;
     UINTN               CompLen;
     UINTN               PixelCount;
-    
+
     // sanity check
     if (EmbeddedImage->PixelMode > EG_MAX_EIPIXELMODE ||
         (EmbeddedImage->CompressMode != EG_EICOMPMODE_NONE && EmbeddedImage->CompressMode != EG_EICOMPMODE_RLE))
         return NULL;
-    
+
     // allocate image structure and pixel buffer
     NewImage = egCreateImage(EmbeddedImage->Width, EmbeddedImage->Height, WantAlpha);
     if (NewImage == NULL)
         return NULL;
-    
+
     CompData = (UINT8 *)EmbeddedImage->Data;   // drop const
     CompLen  = EmbeddedImage->DataLength;
     PixelCount = EmbeddedImage->Width * EmbeddedImage->Height;
-    
+
     // FUTURE: for EG_EICOMPMODE_EFICOMPRESS, decompress whole data block here
-    
+
     if (EmbeddedImage->PixelMode == EG_EIPIXELMODE_GRAY ||
         EmbeddedImage->PixelMode == EG_EIPIXELMODE_GRAY_ALPHA) {
-        
+
         // copy grayscale plane and expand
         if (EmbeddedImage->CompressMode == EG_EICOMPMODE_RLE) {
             egDecompressIcnsRLE(&CompData, &CompLen, PLPTR(NewImage, r), PixelCount);
@@ -314,10 +321,10 @@ EG_IMAGE * egPrepareEmbeddedImage(IN EG_EMBEDDED_IMAGE *EmbeddedImage, IN BOOLEA
         }
         egCopyPlane(PLPTR(NewImage, r), PLPTR(NewImage, g), PixelCount);
         egCopyPlane(PLPTR(NewImage, r), PLPTR(NewImage, b), PixelCount);
-        
+
     } else if (EmbeddedImage->PixelMode == EG_EIPIXELMODE_COLOR ||
                EmbeddedImage->PixelMode == EG_EIPIXELMODE_COLOR_ALPHA) {
-        
+
         // copy color planes
         if (EmbeddedImage->CompressMode == EG_EICOMPMODE_RLE) {
             egDecompressIcnsRLE(&CompData, &CompLen, PLPTR(NewImage, r), PixelCount);
@@ -331,20 +338,20 @@ EG_IMAGE * egPrepareEmbeddedImage(IN EG_EMBEDDED_IMAGE *EmbeddedImage, IN BOOLEA
             egInsertPlane(CompData, PLPTR(NewImage, b), PixelCount);
             CompData += PixelCount;
         }
-        
+
     } else {
-        
+
         // set color planes to black
         egSetPlane(PLPTR(NewImage, r), 0, PixelCount);
         egSetPlane(PLPTR(NewImage, g), 0, PixelCount);
         egSetPlane(PLPTR(NewImage, b), 0, PixelCount);
-        
+
     }
-    
+
     if (WantAlpha && (EmbeddedImage->PixelMode == EG_EIPIXELMODE_GRAY_ALPHA ||
                       EmbeddedImage->PixelMode == EG_EIPIXELMODE_COLOR_ALPHA ||
                       EmbeddedImage->PixelMode == EG_EIPIXELMODE_ALPHA)) {
-        
+
         // copy alpha plane
         if (EmbeddedImage->CompressMode == EG_EICOMPMODE_RLE) {
             egDecompressIcnsRLE(&CompData, &CompLen, PLPTR(NewImage, a), PixelCount);
@@ -352,11 +359,11 @@ EG_IMAGE * egPrepareEmbeddedImage(IN EG_EMBEDDED_IMAGE *EmbeddedImage, IN BOOLEA
             egInsertPlane(CompData, PLPTR(NewImage, a), PixelCount);
             CompData += PixelCount;
         }
-        
+
     } else {
         egSetPlane(PLPTR(NewImage, a), WantAlpha ? 255 : 0, PixelCount);
     }
-    
+
     return NewImage;
 }
 
index 1f44731514252be0427d56fb5b93ee03757a538e..ec8e696d16071f070e0be7e8c3fc8e63513afaeb 100644 (file)
@@ -23,7 +23,10 @@ timeout 20
 
 # Set the name of a subdirectory in which icons are stored. Icons must
 # have the same names they have in the standard directory. The directory
-# name is specified relative to the main rEFInd binary's directory.
+# name is specified relative to the main rEFInd binary's directory. If
+# an icon can't be found in the specified directory, an attempt is made
+# to load it from the default directory; thus, you can replace just some
+# icons in your own directory and rely on the default for others.
 # Default is "icons".
 #
 #icons_dir myicons
index 1bc320245df20ccf0ca3fa51195ac82deec7eaf5..e4738e26486e3d5c807041928f956fda9b62dac4 100644 (file)
@@ -160,7 +160,7 @@ EG_IMAGE * DummyImage(IN UINTN PixelSize)
         }
         YPtr += LineOffset;
     }
-    
+
     return Image;
 }
 
index 55ddf895b9252a3448df0639accedc4ba7f4335f..6256bbff984dd81da85e515e5373be06b2d4f5dc 100644 (file)
@@ -104,7 +104,7 @@ static VOID AboutrEFInd(VOID)
 {
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.3.3.2");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.3.4");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");