Chameleon

Chameleon Commit Details

Date:2010-07-26 02:09:27 (9 years 2 months ago)
Author:Tamás Kosárszky
Commit:254
Parents: 253
Message:Merged back changes of branches/zef between r224-r253: Now loadThemeImage() and loadEmbeddedThemeImage() are unified along with the LOADPNG macro. Updated loadThemeImage() for handling embedded images. Converted embedded them loop to a binary search. Maximum loop is now log2(n). Using different image fallback scheme makes "useRollOver" testing obsolete (removed). Updated boot2's Makefile with Kabyl's version for generating the embeddedImages[] array. Added optional Apple HFS RAID device icon support, using device_hfsraid.png + device_hfsraid_o.png files. Removed device_fat32.png and device_fat16.png and replaced with device_fat.png. For compatibility reasons the booter can still handle the fat32/16 images.
Changes:
D/trunk/artwork/themes/default/device_fat32.png
D/trunk/artwork/themes/default/device_fat16.png
A/trunk/artwork/themes/default/device_fat.png
M/trunk/i386/libsaio/msdos.c
M/trunk/i386/boot2/gui.c
M/trunk/i386/libsaio/disk.c
M/trunk/i386/boot2/gui.h
M/trunk/i386/libsaio/saio_internal.h
M/trunk/i386/boot2/options.c
M/trunk/i386/libsaio/sys.c
M/trunk/i386/boot2/Makefile
M/trunk/i386/libsaio/hfs.c

File differences

trunk/i386/libsaio/hfs.c
299299
300300
301301
302
302
303303
304304
305305
return -1;
}
getDeviceStringFromBVR(ih, devStr);
getDeviceDescription(ih, devStr);
verbose("Read HFS%s file: [%s/%s] %d bytes.\n",
(gIsHFSPlus ? "+" : ""), devStr, filePath, (uint32_t)length);
trunk/i386/libsaio/sys.c
10761076
10771077
10781078
1079
1079
1080
1081
1082
10801083
10811084
10821085
1086
1087
10831088
10841089
1085
1090
1091
1092
10861093
1087
1088
1089
1090
1091
1094
10921095
10931096
10941097
return bvr ? bvr : bvr1;
}
int getDeviceStringFromBVR(const BVRef bvr, char *str)
//==========================================================================
// getDeviceDescription() - Extracts unit number and partition number
// from bvr structure into "dw(u,p)" format.
int getDeviceDescription(BVRef bvr, char *str)
{
const struct devsw *dp;
*str = '\0';
if (bvr)
{
*str = '\0';
for (dp = devsw; dp->name && bvr->biosdev >= dp->biosdev; dp++);
dp--;
if (dp->name) sprintf(str, "%s(%d,%d)", dp->name, bvr->biosdev - dp->biosdev, bvr->part_no);
for (dp = devsw; dp->name && bvr->biosdev >= dp->biosdev; dp++);
dp--;
if (dp->name) sprintf(str, "%s(%d,%d)", dp->name, bvr->biosdev - dp->biosdev, bvr->part_no);
return true;
return true;
}
return false;
trunk/i386/libsaio/disk.c
17071707
17081708
17091709
1710
1710
1711
17111712
17121713
17131714
p = str;
if (verbose) {
sprintf( str, "hd(%d,%d) ", BIOS_DEV_UNIT(bvr), bvr->part_no);
getDeviceDescription(bvr, str);
strcat(str, " ");
for (; strMaxLen > 0 && *p != '\0'; p++, strMaxLen--);
}
trunk/i386/libsaio/msdos.c
757757
758758
759759
760
760
761761
762762
763763
toread-=msdosclustersize;
}
getDeviceStringFromBVR(ih, devStr);
getDeviceDescription(ih, devStr);
verbose("Read FAT%d file: [%s/%s] %d bytes.\n",
msdosfatbits, devStr, filePath, (uint32_t)( toread<0 ) ? wastoread : wastoread-toread);
free (buf);
trunk/i386/libsaio/saio_internal.h
202202
203203
204204
205
205
206206
207207
208208
extern void getBootVolumeDescription(BVRef bvr, char *str, long strMaxLen, bool verbose);
extern void setRootVolume(BVRef volume);
extern void setBootGlobals(BVRef chain);
extern int getDeviceStringFromBVR(const BVRef volume, char *str);
extern int getDeviceDescription(BVRef volume, char *str);
extern int gBIOSDev;
extern int gBootFileType;
trunk/i386/boot2/gui.c
1212
1313
1414
15
1516
1617
1718
1819
1920
20
21
22
23
24
25
2621
2722
23
24
2825
2926
3027
......
3229
3330
3431
35
32
3633
3734
3835
......
4138
4239
4340
44
45
41
42
4643
47
48
49
50
51
52
53
54
55
56
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
5762
58
59
60
61
62
63
64
65
66
67
68
63
64
65
6966
70
71
67
68
69
70
71
72
73
74
75
76
77
7278
73
74
79
80
7581
76
77
82
83
84
85
86
7887
7988
8089
81
82
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
83111
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
115136
116137
117138
......
149170
150171
151172
173
174
175
176
177
178
179
180
181
182
183
152184
153
185
154186
155
156
157
158
159
160
161
162
163
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
164202
165
166
167
168
169
203
204
205
170206
171
172
173
174
175
207
176208
209
210
211
212
213
214
215
216
217
218
219
220
177221
178
222
179223
180224
181
225
226
182227
183228
184
229
230
231
232
185233
186234
187235
......
189237
190238
191239
192
193
194
195
196
197
198
199
200
201
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
202289
203
204
290
291
205292
206
207
208
209
210
211
212
213
214
293
294
295
215296
216297
217298
218
219299
220300
221
222
301
302
223303
224
225
226
227
228
229
230
231
232
233
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
234322
235
236
237
238
239
240
241
242
243
244
245
323
324
325
246326
247
248
327
328
329
330
331
332
333
334
335
336
337
249338
250
251
339
340
252341
253
254
342
343
255344
345
346
347
256348
257349
258350
......
624716
625717
626718
627
719
628720
629721
630
722
631723
632724
633725
......
636728
637729
638730
639
640
641
731
732
642733
643
734
644735
645736
646737
647
738
648739
649740
650741
651
742
652743
653744
654745
655
746
656747
657748
658749
659
750
660751
661752
662753
663754
664755
665756
757
758
759
666760
667761
668762
......
712806
713807
714808
715
809
716810
717
811
718812
719
813
814
720815
721
722
723
724
725
726
727
728
816
817
818
819
820
821
822
823
824
825
729826
730827
731828
......
733830
734831
735832
736
737
738
739
740
741
742
743
744
745
746
747
748
749
833
834
835
836
837
838
839
840
841
842
843
844
845
846
750847
751848
752849
753
850
754851
755852
756853
#include "appleboot.h"
#include "vers.h"
#define IMG_REQUIRED -1
#define THEME_NAME_DEFAULT"Default"
static const char *theme_name = THEME_NAME_DEFAULT;
#ifdef EMBED_THEME
#include "art.h"
#define LOADPNG(img) \
if (loadThemeImage(#img) != 0) \
if (loadEmbeddedThemeImage(#img, __## img ##_png, __## img ##_png_len) != 0) \
return 1;
#else
#define LOADPNG(img)if (loadThemeImage(#img) != 0) { return 1; }
#endif
#define LOADPNG(img, alt_img) if (loadThemeImage(#img, alt_img) != 0) { return 1; }
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#define vram VIDEO(baseAddr)
int lasttime=0; // we need this for animating maybe
int lasttime = 0; // we need this for animating maybe
extern int gDeviceCount;
* ATTENTION: the enum and the following array images[] MUST match !!!
*/
enum {
iBackground = 0,
iLogo,
iBackground = 0,
iLogo,
iDeviceGeneric,
iDeviceHFS,
iDeviceEXT3,
iDeviceFAT16,
iDeviceFAT32,
iDeviceNTFS,
iDeviceCDROM,
iSelection,
iDeviceScrollPrev,
iDeviceScrollNext,
iDeviceGeneric,
iDeviceGeneric_o,
iDeviceHFS,
iDeviceHFS_o,
iDeviceHFSRAID,
iDeviceHFSRAID_o,
iDeviceEXT3,
iDeviceEXT3_o,
iDeviceFAT,
iDeviceFAT_o,
iDeviceFAT16,
iDeviceFAT16_o,
iDeviceFAT32,
iDeviceFAT32_o,
iDeviceNTFS,
iDeviceNTFS_o,
iDeviceCDROM,
iDeviceCDROM_o,
iMenuBoot,
iMenuVerbose,
iMenuIgnoreCaches,
iMenuSingleUser,
iMenuMemoryInfo,
iMenuVideoInfo,
iMenuHelp,
iMenuVerboseDisabled,
iMenuIgnoreCachesDisabled,
iMenuSingleUserDisabled,
iMenuSelection,
iSelection,
iDeviceScrollPrev,
iDeviceScrollNext,
iProgressBar,
iProgressBarBackground,
iMenuBoot,
iMenuVerbose,
iMenuIgnoreCaches,
iMenuSingleUser,
iMenuMemoryInfo,
iMenuVideoInfo,
iMenuHelp,
iMenuVerboseDisabled,
iMenuIgnoreCachesDisabled,
iMenuSingleUserDisabled,
iMenuSelection,
iTextScrollPrev,
iTextScrollNext,
iProgressBar,
iProgressBarBackground,
iFontConsole,
iFontSmall,
iTextScrollPrev,
iTextScrollNext,
iFontConsole,
iFontSmall,
};
image_t images[] = {
{.name = "background",.image = NULL},
{.name = "logo",.image = NULL},
{.name = "background", .image = NULL},
{.name = "logo", .image = NULL},
{.name = "device_generic", .image = NULL},
{.name = "device_generic_o", .image = NULL},
{.name = "device_hfsplus", .image = NULL},
{.name = "device_hfsplus_o", .image = NULL},
{.name = "device_hfsraid", .image = NULL},
{.name = "device_hfsraid_o", .image = NULL},
{.name = "device_ext3", .image = NULL},
{.name = "device_ext3_o", .image = NULL},
{.name = "device_fat", .image = NULL},
{.name = "device_fat_o", .image = NULL},
{.name = "device_fat16", .image = NULL},
{.name = "device_fat16_o", .image = NULL},
{.name = "device_fat32", .image = NULL},
{.name = "device_fat32_o", .image = NULL},
{.name = "device_ntfs", .image = NULL},
{.name = "device_ntfs_o", .image = NULL},
{.name = "device_cdrom", .image = NULL},
{.name = "device_cdrom_o", .image = NULL},
{.name = "device_generic",.image = NULL},
{.name = "device_hfsplus",.image = NULL},
{.name = "device_ext3",.image = NULL},
{.name = "device_fat16",.image = NULL},
{.name = "device_fat32",.image = NULL},
{.name = "device_ntfs",.image = NULL},
{.name = "device_cdrom",.image = NULL},
{.name = "device_selection",.image = NULL},
{.name = "device_scroll_prev",.image = NULL},
{.name = "device_scroll_next",.image = NULL},
{.name = "menu_boot",.image = NULL},
{.name = "menu_verbose",.image = NULL},
{.name = "menu_ignore_caches",.image = NULL},
{.name = "menu_single_user",.image = NULL},
{.name = "menu_memory_info",.image = NULL},
{.name = "menu_video_info",.image = NULL},
{.name = "menu_help",.image = NULL},
{.name = "menu_verbose_disabled",.image = NULL},
{.name = "menu_ignore_caches_disabled",.image = NULL},
{.name = "menu_single_user_disabled",.image = NULL},
{.name = "menu_selection",.image = NULL},
{.name = "progress_bar",.image = NULL},
{.name = "progress_bar_background",.image = NULL},
{.name = "text_scroll_prev",.image = NULL},
{.name = "text_scroll_next",.image = NULL},
{.name = "font_console",.image = NULL},
{.name = "font_small",.image = NULL},
{.name = "device_selection", .image = NULL},
{.name = "device_scroll_prev", .image = NULL},
{.name = "device_scroll_next", .image = NULL},
{.name = "menu_boot", .image = NULL},
{.name = "menu_verbose", .image = NULL},
{.name = "menu_ignore_caches", .image = NULL},
{.name = "menu_single_user", .image = NULL},
{.name = "menu_memory_info", .image = NULL},
{.name = "menu_video_info", .image = NULL},
{.name = "menu_help", .image = NULL},
{.name = "menu_verbose_disabled", .image = NULL},
{.name = "menu_ignore_caches_disabled", .image = NULL},
{.name = "menu_single_user_disabled", .image = NULL},
{.name = "menu_selection", .image = NULL},
{.name = "progress_bar", .image = NULL},
{.name = "progress_bar_background", .image = NULL},
{.name = "text_scroll_prev", .image = NULL},
{.name = "text_scroll_next", .image = NULL},
{.name = "font_console", .image = NULL},
{.name = "font_small", .image = NULL},
};
int imageCnt = 0;
static unsigned long screen_params[4] = {DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT, 32, 0};// here we store the used screen resolution
static int getImageIndexByName(const char *name)
{
int i;
for (i = 0; i < sizeof(images) / sizeof(images[0]); i++)
{
if (strcmp(name, images[i].name) == 0)
return i; // found the name
}
return -1;
}
#ifdef EMBED_THEME
static int loadEmbeddedThemeImage(const char *image, unsigned char *image_data, unsigned int image_size)
static int getEmbeddedImageIndexByName(const char *name)
{
inti;
uint16_twidth;
uint16_theight;
uint8_t*imagedata;
for (i=0; i < sizeof(images) / sizeof(images[0]); i++) {
if (strcmp(image, images[i].name) == 0) {
if (images[i].image == NULL) {
images[i].image = malloc(sizeof(pixmap_t));
int upperLimit = sizeof(embeddedImages) / sizeof(embeddedImages[0]) - 1;
int lowerLimit = 0;
int compareIndex = (upperLimit - lowerLimit) >> 1; // Midpoint
int result;
// NOTE: This algorithm assumes that the embeddedImages is sorted.
// This is currently done using the make file. If the array is every
// manualy generated, this *will* fail to work properly.
while((result = strcmp(name, embeddedImages[compareIndex].name)) != 0)
{
if(result > 0)// We need to search a HIGHER index
{
if(compareIndex != lowerLimit)
{
lowerLimit = compareIndex;
}
width = 0;
height = 0;
imagedata = NULL;
if ((loadEmbeddedPngImage(image_data, image_size, &width, &height, &imagedata)) != 0) {
return 1;
else
{
return -1;
}
images[i].image->width = width;
images[i].image->height = height;
images[i].image->pixels = (pixel_t *)imagedata;
flipRB(images[i].image);
return 0;
compareIndex = (upperLimit + lowerLimit + 1) >> 1;// Midpoint, round up
}
else // We Need to search a LOWER index
{
if(compareIndex != upperLimit)
{
upperLimit = compareIndex;
}
else
{
return -1;
}
compareIndex = (upperLimit + lowerLimit) >> 1;// Midpoint, round down
}
}
return 1;
return compareIndex;
}
#endif
static int loadThemeImage(const char *image)
static int loadThemeImage(const char *image, int alt_image)
{
chardirspec[256];
inti;
int i;
#ifdef EMBED_THEME
int e;
#endif
uint16_twidth;
uint16_theight;
uint8_t*imagedata;
if ((strlen(image) + strlen(theme_name) + 20 ) > sizeof(dirspec)) {
return 1;
}
for (i=0; i < sizeof(images) / sizeof(images[0]); i++) {
if (strcmp(image, images[i].name) == 0) {
if (images[i].image == NULL) {
images[i].image = malloc(sizeof(pixmap_t));
}
sprintf(dirspec,"/Extra/Themes/%s/%s.png", theme_name, image);
width = 0;
height = 0;
imagedata = NULL;
if ((loadPngImage(dirspec, &width, &height, &imagedata)) != 0) {
if ((i = getImageIndexByName(image)) >= 0)
{
if (images[i].image == NULL) {
images[i].image = malloc(sizeof(pixmap_t));
}
sprintf(dirspec, "/Extra/Themes/%s/%s.png", theme_name, image);
width = 0;
height = 0;
imagedata = NULL;
if ((loadPngImage(dirspec, &width, &height, &imagedata)) == 0)
{
images[i].image->width = width;
images[i].image->height = height;
images[i].image->pixels = (pixel_t *)imagedata;
flipRB(images[i].image);
return 0;
}
#ifdef EMBED_THEME
else if ((e = getEmbeddedImageIndexByName(image)) >= 0)
{
unsigned char *embed_data;
unsigned int embed_size;
embed_data = embeddedImages[e].pngdata;
embed_size = *embeddedImages[e].length;
if (loadEmbeddedPngImage(embed_data, embed_size, &width, &height, &imagedata) == 0)
{
images[i].image->width = width;
images[i].image->height = height;
images[i].image->pixels = (pixel_t *)imagedata;
flipRB(images[i].image);
return 0;
}
return 0;
}
#endif
else if (alt_image != IMG_REQUIRED && images[alt_image].image->pixels != NULL)
{
// Using the passed alternate image for non-mandatory images.
// We don't clone the already existing pixmap, but using its properties instead!
images[i].image->width = images[alt_image].image->width;
images[i].image->height = images[alt_image].image->height;
images[i].image->pixels = images[alt_image].image->pixels;
return 0;
}
else
{
#ifndef EMBED_THEME
printf("ERROR: GUI: could not open '%s/%s.png'!\n", theme_name, image);
sleep(2);
printf("ERROR: GUI: could not open '%s/%s.png'!\n", theme_name, image);
sleep(2);
#endif
return 1;
}
images[i].image->width = width;
images[i].image->height = height;
images[i].image->pixels = (pixel_t *)imagedata;
flipRB(images[i].image);
return 0;
}
}
return 1;
}
}
return 1;
}
static int loadGraphics(void)
{
LOADPNG(background);
LOADPNG(logo);
LOADPNG(background, IMG_REQUIRED);
LOADPNG(logo, IMG_REQUIRED);
LOADPNG(device_generic);
LOADPNG(device_hfsplus);
LOADPNG(device_ext3);
LOADPNG(device_fat16);
LOADPNG(device_fat32);
LOADPNG(device_ntfs);
LOADPNG(device_cdrom);
LOADPNG(device_selection);
LOADPNG(device_scroll_prev);
LOADPNG(device_scroll_next);
LOADPNG(device_generic, IMG_REQUIRED);
LOADPNG(device_generic_o, iDeviceGeneric);
LOADPNG(device_hfsplus, iDeviceGeneric);
LOADPNG(device_hfsplus_o, iDeviceHFS);
LOADPNG(device_hfsraid, iDeviceGeneric);
LOADPNG(device_hfsraid_o, iDeviceHFSRAID);
LOADPNG(device_ext3, iDeviceGeneric);
LOADPNG(device_ext3_o, iDeviceEXT3);
LOADPNG(device_fat, iDeviceGeneric);
LOADPNG(device_fat_o, iDeviceFAT);
LOADPNG(device_fat16, iDeviceFAT);
LOADPNG(device_fat16_o, iDeviceFAT_o);
LOADPNG(device_fat32, iDeviceFAT);
LOADPNG(device_fat32_o, iDeviceFAT_o);
LOADPNG(device_ntfs, iDeviceGeneric);
LOADPNG(device_ntfs_o, iDeviceNTFS);
LOADPNG(device_cdrom, iDeviceGeneric);
LOADPNG(device_cdrom_o, iDeviceCDROM);
LOADPNG(menu_boot);
LOADPNG(menu_verbose);
LOADPNG(menu_ignore_caches);
LOADPNG(menu_single_user);
LOADPNG(menu_memory_info);
LOADPNG(menu_video_info);
LOADPNG(menu_help);
LOADPNG(menu_verbose_disabled);
LOADPNG(menu_ignore_caches_disabled);
LOADPNG(menu_single_user_disabled);
LOADPNG(menu_selection);
LOADPNG(device_selection, IMG_REQUIRED);
LOADPNG(device_scroll_prev, IMG_REQUIRED);
LOADPNG(device_scroll_next, IMG_REQUIRED);
LOADPNG(progress_bar);
LOADPNG(progress_bar_background);
LOADPNG(menu_boot, IMG_REQUIRED);
LOADPNG(menu_verbose, IMG_REQUIRED);
LOADPNG(menu_ignore_caches, IMG_REQUIRED);
LOADPNG(menu_single_user, IMG_REQUIRED);
LOADPNG(menu_memory_info, IMG_REQUIRED);
LOADPNG(menu_video_info, IMG_REQUIRED);
LOADPNG(menu_help, IMG_REQUIRED);
LOADPNG(menu_verbose_disabled, IMG_REQUIRED);
LOADPNG(menu_ignore_caches_disabled, IMG_REQUIRED);
LOADPNG(menu_single_user_disabled, IMG_REQUIRED);
LOADPNG(menu_selection, IMG_REQUIRED);
LOADPNG(text_scroll_prev);
LOADPNG(text_scroll_next);
LOADPNG(progress_bar, IMG_REQUIRED);
LOADPNG(progress_bar_background, IMG_REQUIRED);
LOADPNG(font_console);
LOADPNG(font_small);
LOADPNG(text_scroll_prev, IMG_REQUIRED);
LOADPNG(text_scroll_next, IMG_REQUIRED);
LOADPNG(font_console, IMG_REQUIRED);
LOADPNG(font_small, IMG_REQUIRED);
initFont( &font_console, &images[iFontConsole]);
initFont( &font_small, &images[iFontSmall]);
return 1;
}
void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p)
void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected)
{
int devicetype;
if( diskIsCDROM(device) )
devicetype = iDeviceCDROM;// Use CDROM icon
else
{
case kPartitionTypeHFS:
// TODO: add apple raid icon choices
devicetype = iDeviceHFS;// Use HFS icon
// Use HFS or HFSRAID icon depending on bvr flags.
devicetype = (device->flags & kBVFlagBooter) ? iDeviceHFSRAID : iDeviceHFS;
break;
case kPartitionTypeHPFS:
devicetype = iDeviceNTFS;// Use HPFS / NTFS icon
break;
case kPartitionTypeFAT16:
devicetype = iDeviceFAT16;// Use FAT16 icon
break;
case kPartitionTypeFAT32:
devicetype = iDeviceFAT32;// Use FAT32 icon
break;
case kPartitionTypeEXT3:
devicetype = iDeviceEXT3;// Use EXT2/3 icon
break;
default:
devicetype = iDeviceGeneric;// Use Generic icon
break;
}
}
// Use the next (device_*_o) image for the selected item.
if (isSelected) devicetype++;
// draw icon
blend( images[devicetype].image, buffer, centeredAt( images[devicetype].image, p ));
}
// draw visible device icons
for ( i=0; i < gui.maxdevices; i++ )
for (i = 0; i < gui.maxdevices; i++)
{
BVRef param = menuItems[start+i].param;
BVRef param = menuItems[start + i].param;
if((start+i) == selection)
bool isSelected = ((start + i) == selection) ? true : false;
if (isSelected)
{
if(param->flags & kBVFlagNativeBoot)
infoMenuNativeBoot = true;
else
{
infoMenuNativeBoot = false;
if(infoMenuSelection >= INFOMENU_NATIVEBOOT_START && infoMenuSelection <= INFOMENU_NATIVEBOOT_END)
infoMenuSelection = 0;
}
if (param->flags & kBVFlagNativeBoot)
{
infoMenuNativeBoot = true;
}
else
{
infoMenuNativeBoot = false;
if(infoMenuSelection >= INFOMENU_NATIVEBOOT_START && infoMenuSelection <= INFOMENU_NATIVEBOOT_END)
infoMenuSelection = 0;
}
if(gui.menu.draw)
drawInfoMenuItems();
blend( images[iSelection].image, gui.devicelist.pixmap, centeredAt( images[iSelection].image, p ) );
#if DEBUG
gui.debug.cursor = pos( 10, 100);
dprintf( &gui.screen, "label %s\n", param->label );
dprintf( &gui.screen, "biosdev 0x%x\n", param->biosdev );
dprintf(&gui.screen, "width %d\n", gui.screen.width);
dprintf(&gui.screen, "height %d\n", gui.screen.height);
dprintf( &gui.screen, "type 0x%x\n", param->type );
dprintf( &gui.screen, "flags 0x%x\n", param->flags );
dprintf( &gui.screen, "part_no %d\n", param->part_no );
dprintf( &gui.screen, "part_boff 0x%x\n", param->part_boff );
dprintf( &gui.screen, "part_type 0x%x\n", param->part_type );
dprintf( &gui.screen, "bps 0x%x\n", param->bps );
dprintf( &gui.screen, "name %s\n", param->name );
dprintf( &gui.screen, "type_name %s\n", param->type_name );
dprintf( &gui.screen, "modtime %d\n", param->modTime );
gui.debug.cursor = pos( 10, 100);
dprintf( &gui.screen, "label %s\n", param->label );
dprintf( &gui.screen, "biosdev 0x%x\n", param->biosdev );
dprintf(&gui.screen, "width %d\n", gui.screen.width);
dprintf(&gui.screen, "height %d\n", gui.screen.height);
dprintf( &gui.screen, "type 0x%x\n", param->type );
dprintf( &gui.screen, "flags 0x%x\n", param->flags );
dprintf( &gui.screen, "part_no %d\n", param->part_no );
dprintf( &gui.screen, "part_boff 0x%x\n", param->part_boff );
dprintf( &gui.screen, "part_type 0x%x\n", param->part_type );
dprintf( &gui.screen, "bps 0x%x\n", param->bps );
dprintf( &gui.screen, "name %s\n", param->name );
dprintf( &gui.screen, "type_name %s\n", param->type_name );
dprintf( &gui.screen, "modtime %d\n", param->modTime );
#endif
}
drawDeviceIcon( param, gui.devicelist.pixmap, p );
drawDeviceIcon( param, gui.devicelist.pixmap, p, isSelected);
if (gui.layout == HorizontalLayout)
{
trunk/i386/boot2/gui.h
134134
135135
136136
137
137
138138
139139
140140
int initGUI();
void drawBackground();
void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p);
void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected);
void drawDeviceList(int start, int end, int selection);
void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress);
trunk/i386/boot2/options.c
112112
113113
114114
115
115
116116
117117
118118
char dummy[80];
getBootVolumeDescription( gBootVolume, dummy, 80, true );
drawDeviceIcon( gBootVolume, gui.screen.pixmap, p );
drawDeviceIcon( gBootVolume, gui.screen.pixmap, p, false );
drawStrCenteredAt( (char *) msg, &font_small, gui.screen.pixmap, gui.countdown.pos );
// make this screen the new background
trunk/i386/boot2/Makefile
9595
9696
9797
98
99
100
101
102
103
104
105
106
107
108
109
98110
99111
100112
@echo "#define __BOOT2_ART_H" >> $(SYMROOT)/art.h
@cd $(SYMROOT)/embed && find . -name 'theme.plist' -exec xxd -i >> $(SYMROOT)/art.h {} \;
@cd $(SYMROOT)/embed && find . -name '*.png' -exec xxd -i >> $(SYMROOT)/art.h {} \;
@echo "typedef struct {" >> $(SYMROOT)/art.h
@echo "charname[32];" >> $(SYMROOT)/art.h
@echo "unsigned char*pngdata;" >> $(SYMROOT)/art.h
@echo "unsigned int*length;" >> $(SYMROOT)/art.h
@echo "} embeddedpng_t;" >> $(SYMROOT)/art.h
@echo "" >> $(SYMROOT)/art.h
@echo "embeddedpng_t embeddedImages[] = {" >> $(SYMROOT)/art.h
@cd $(SYMROOT)/embed && find . -name '*.png' | sort | cut -f 2 -d '/' | cut -f 1 -d '.' | \
awk '{ printf "\t{.name = \"%s\", .pngdata = __%s_png, .length = &__%s_png_len},\n", $$1, $$1, $$1 }' >> $(SYMROOT)/art.h
@echo "};" >> $(SYMROOT)/art.h
@echo "#endif /* !__BOOT2_ART_H */" >> $(SYMROOT)/art.h ;\
rm -rf $(SYMROOT)/embed ;\

Archive Download the corresponding diff file

Revision: 254