Chameleon

Chameleon Commit Details

Date:2012-06-07 19:53:54 (11 years 10 months ago)
Author:Cosmosis Jones
Commit:1990
Parents: 1989
Message:iLoad moutnain lion icons patch from ermac http://forge.voodooprojects.org/p/chameleon/issues/261/#ic1998
Changes:
M/trunk/i386/boot2/gui.c
M/trunk/i386/boot2/gui.h

File differences

trunk/i386/boot2/gui.c
1515
1616
1717
18
18
1919
2020
2121
......
4343
4444
4545
46
46
47
48
4749
48
50
4951
50
52
5153
52
54
5355
5456
5557
56
58
59
60
5761
58
62
5963
60
64
6165
62
66
6367
6468
6569
......
113117
114118
115119
116
117
118
119
120
121
122
123
124
125
120
121
122
123
124
125
126
127
128
129
130
131
126132
127133
128
129
130
131
132
133
134
135
134
135
136
137
138
139
140
141
142
143
136144
137145
138146
......
189197
190198
191199
192
200
193201
194202
195203
......
306314
307315
308316
309
317
310318
311319
312320
......
330338
331339
332340
333
341
334342
335
343
336344
337345
338346
......
348356
349357
350358
351
359
352360
353
361
354362
355363
356364
......
364372
365373
366374
375
376
367377
368378
369379
......
372382
373383
374384
375
385
376386
377387
378
379
380
381
382
383
384
385
388
389
390
391
392
393
394
395
396
397
386398
387399
388400
......
432444
433445
434446
435
447
436448
437449
438450
439451
440452
441453
442
443454
444455
445456
......
452463
453464
454465
466
467
468
469
470
471
472
473
474
475
476
477
478
455479
456480
457481
......
482506
483507
484508
509
485510
486
511
487512
488513
489514
......
494519
495520
496521
497
522
498523
499524
500525
501
502
503
504
505
506
507
508
509
510
511
512
513
514526
515527
516528
517529
530
518531
532
519533
520534
521535
......
527541
528542
529543
530
544
531545
532546
533547
......
539553
540554
541555
542
556
543557
544558
545559
......
606620
607621
608622
609
623
610624
611625
612626
......
790804
791805
792806
793
807
794808
795809
796810
......
859873
860874
861875
862
863
864
865
866
867
868
869
876
877
878
879
880
881
882
883
884
885
870886
871887
872888
......
889905
890906
891907
892
908
909
893910
894911
912
913
914
895915
896916
897917
......
909929
910930
911931
912
913
914
915
932
933
916934
935
936
937
917938
918939
919940
......
939960
940961
941962
942
963
943964
944965
945966
946
967
947968
948969
949970
950
971
951972
952973
953974
954
955
975
976
956977
957978
958
959
979
980
960981
961982
962
963
983
984
964985
965986
966
987
967988
968989
969990
......
974995
975996
976997
977
998
978999
9791000
9801001
......
9951016
9961017
9971018
998
1019
9991020
10001021
10011022
......
10451066
10461067
10471068
1048
1069
10491070
10501071
10511072
......
10981119
10991120
11001121
1101
1122
11021123
11031124
11041125
......
11721193
11731194
11741195
1175
1196
11761197
11771198
11781199
......
11871208
11881209
11891210
1190
1211
11911212
11921213
11931214
11941215
11951216
11961217
1197
1218
11981219
11991220
12001221
......
12511272
12521273
12531274
1254
1275
12551276
1256
1277
12571278
12581279
12591280
12601281
12611282
1262
1283
12631284
12641285
12651286
......
12711292
12721293
12731294
1274
1295
12751296
12761297
12771298
......
14141435
14151436
14161437
1417
1438
14181439
14191440
14201441
......
14491470
14501471
14511472
1452
1473
14531474
14541475
14551476
......
15481569
15491570
15501571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
15511587
15521588
15531589
......
15611597
15621598
15631599
1564
1600
15651601
15661602
15671603
......
15871623
15881624
15891625
1590
1626
15911627
15921628
15931629
......
16071643
16081644
16091645
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
16251646
16261647
16271648
......
17591780
17601781
17611782
1762
1783
17631784
17641785
17651786
1766
1787
17671788
17681789
17691790
......
18131834
18141835
18151836
1816
1837
18171838
18181839
18191840
......
18851906
18861907
18871908
1888
1909
18891910
18901911
18911912
......
18931914
18941915
18951916
1896
1917
18971918
18981919
18991920
......
19201941
19211942
19221943
1944
19231945
1946
19241947
19251948
19261949
1950
19271951
19281952
1953
19291954
1955
19301956
19311957
1958
19321959
19331960
19341961
......
19571984
19581985
19591986
1960
1987
1988
1989
19611990
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1991
19781992
1979
1980
1981
1982
1993
19831994
1984
1985
1986
1987
1988
1989
1995
19901996
1991
1997
1998
19921999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
19932025
1994
1995
1996
2026
2027
2028
19972029
1998
1999
2030
2031
20002032
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
20122044
20132045
20142046
#define IMG_REQUIRED -1
#define THEME_NAME_DEFAULT"Default"
static const char *theme_name = THEME_NAME_DEFAULT;
static const char *theme_name = THEME_NAME_DEFAULT;
#ifdef CONFIG_EMBED_THEME
#include "art.h"
iDeviceGeneric_o,
iDeviceHFS,
iDeviceHFS_o,
iDeviceHFS_Lion,
iDeviceHFS_ML,
iDeviceHFS_ML_o,
iDeviceHFS_Lion,
iDeviceHFS_Lion_o,
iDeviceHFS_SL,
iDeviceHFS_SL,
iDeviceHFS_SL_o,
iDeviceHFS_Leo,
iDeviceHFS_Leo,
iDeviceHFS_Leo_o,
iDeviceHFS_Tiger,
iDeviceHFS_Tiger,
iDeviceHFS_Tiger_o,
iDeviceHFSRAID,
iDeviceHFSRAID_o,
iDeviceHFSRAID_Lion,
iDeviceHFSRAID_ML,
iDeviceHFSRAID_ML_o,
iDeviceHFSRAID_Lion,
iDeviceHFSRAID_Lion_o,
iDeviceHFSRAID_SL,
iDeviceHFSRAID_SL,
iDeviceHFSRAID_SL_o,
iDeviceHFSRAID_Leo,
iDeviceHFSRAID_Leo,
iDeviceHFSRAID_Leo_o,
iDeviceHFSRAID_Tiger,
iDeviceHFSRAID_Tiger,
iDeviceHFSRAID_Tiger_o,
iDeviceEXT3,
iDeviceEXT3_o,
{.name = "device_generic", .image = NULL},
{.name = "device_generic_o", .image = NULL},
{.name = "device_hfsplus", .image = NULL},
{.name = "device_hfsplus_o", .image = NULL},
{.name = "device_hfsplus_lion", .image = NULL},
{.name = "device_hfsplus_lion_o", .image = NULL},
{.name = "device_hfsplus_sl", .image = NULL},
{.name = "device_hfsplus_sl_o", .image = NULL},
{.name = "device_hfsplus_leo", .image = NULL},
{.name = "device_hfsplus_leo_o", .image = NULL},
{.name = "device_hfsplus_tiger", .image = NULL},
{.name = "device_hfsplus_tiger_o", .image = NULL},
{.name = "device_hfsplus_o", .image = NULL},
{.name = "device_hfsplus_ml", .image = NULL},
{.name = "device_hfsplus_ml_o", .image = NULL},
{.name = "device_hfsplus_lion", .image = NULL},
{.name = "device_hfsplus_lion_o", .image = NULL},
{.name = "device_hfsplus_sl", .image = NULL},
{.name = "device_hfsplus_sl_o", .image = NULL},
{.name = "device_hfsplus_leo", .image = NULL},
{.name = "device_hfsplus_leo_o", .image = NULL},
{.name = "device_hfsplus_tiger", .image = NULL},
{.name = "device_hfsplus_tiger_o", .image = NULL},
{.name = "device_hfsraid", .image = NULL},
{.name = "device_hfsraid_o", .image = NULL},
{.name = "device_hfsraid_lion", .image = NULL},
{.name = "device_hfsraid_lion_o", .image = NULL},
{.name = "device_hfsraid_sl", .image = NULL},
{.name = "device_hfsraid_sl_o", .image = NULL},
{.name = "device_hfsraid_leo", .image = NULL},
{.name = "device_hfsraid_leo_o", .image = NULL},
{.name = "device_hfsraid_tiger", .image = NULL},
{.name = "device_hfsraid_tiger_o", .image = NULL},
{.name = "device_hfsraid_ml", .image = NULL},
{.name = "device_hfsraid_ml_o", .image = NULL},
{.name = "device_hfsraid_lion", .image = NULL},
{.name = "device_hfsraid_lion_o", .image = NULL},
{.name = "device_hfsraid_sl", .image = NULL},
{.name = "device_hfsraid_sl_o", .image = NULL},
{.name = "device_hfsraid_leo", .image = NULL},
{.name = "device_hfsraid_leo_o", .image = NULL},
{.name = "device_hfsraid_tiger", .image = NULL},
{.name = "device_hfsraid_tiger_o", .image = NULL},
{.name = "device_ext3", .image = NULL},
{.name = "device_ext3_o", .image = NULL},
{.name = "device_freebsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
extern char gBootArgs[BOOT_STRING_LEN];
char prompt_text[] = "boot: ";
menuitem_t infoMenuItems[] =
{
{ .text = "Boot" },
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->pixels = images[alt_image].image->pixels;
} else {
// Unable to load or to find the image, this image not vital anyway, reseting and returning success !!
free(images[i].image);
images[i].image = NULL;
}
free(images[i].image);
images[i].image = NULL;
return 1;
}
}
return 1;
}
LOADPNG(device_generic_o, iDeviceGeneric);
LOADPNG(device_hfsplus, iDeviceGeneric);
LOADPNG(device_hfsplus_o, iDeviceHFS);
LOADPNG(device_hfsplus_ml, iDeviceHFS_ML);
LOADPNG(device_hfsplus_ml_o, iDeviceHFS_ML_o);
LOADPNG(device_hfsplus_lion, iDeviceHFS_Lion);
LOADPNG(device_hfsplus_lion_o, iDeviceHFS_Lion_o);
LOADPNG(device_hfsplus_sl, iDeviceHFS_SL);
LOADPNG(device_hfsplus_leo_o, iDeviceHFS_Leo_o);
LOADPNG(device_hfsplus_tiger, iDeviceHFS_Tiger);
LOADPNG(device_hfsplus_tiger_o, iDeviceHFS_Tiger_o);
LOADPNG(device_hfsraid, iDeviceGeneric);
LOADPNG(device_hfsraid_o, iDeviceHFSRAID);
LOADPNG(device_hfsraid_lion, iDeviceHFSRAID_Lion);
LOADPNG(device_hfsraid_lion_o, iDeviceHFSRAID_Lion_o);
LOADPNG(device_hfsraid_sl, iDeviceHFSRAID_SL);
LOADPNG(device_hfsraid_sl_o, iDeviceHFSRAID_SL_o);
LOADPNG(device_hfsraid_leo, iDeviceHFSRAID_Leo);
LOADPNG(device_hfsraid_leo_o, iDeviceHFSRAID_Leo_o);
LOADPNG(device_hfsraid_tiger, iDeviceHFSRAID_Tiger);
LOADPNG(device_hfsraid_tiger_o, iDeviceHFSRAID_Tiger_o);
LOADPNG(device_hfsraid_ml, iDeviceHFSRAID_ML);
LOADPNG(device_hfsraid_ml_o, iDeviceHFSRAID_ML_o);
LOADPNG(device_hfsraid_lion, iDeviceHFSRAID_Lion);
LOADPNG(device_hfsraid_lion_o, iDeviceHFSRAID_Lion_o);
LOADPNG(device_hfsraid_sl, iDeviceHFSRAID_SL);
LOADPNG(device_hfsraid_sl_o, iDeviceHFSRAID_SL_o);
LOADPNG(device_hfsraid_leo, iDeviceHFSRAID_Leo);
LOADPNG(device_hfsraid_leo_o, iDeviceHFSRAID_Leo_o);
LOADPNG(device_hfsraid_tiger, iDeviceHFSRAID_Tiger);
LOADPNG(device_hfsraid_tiger_o, iDeviceHFSRAID_Tiger_o);
LOADPNG(device_ext3, iDeviceGeneric);
LOADPNG(device_ext3_o, iDeviceEXT3);
LOADPNG(device_freebsd, iDeviceGeneric); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
return 0;
}
static int unloadGraphics(void)
{
int i;
destroyFont(&font_console);
destroyFont(&font_small);
for (i = 0; i < sizeof(images) / sizeof(images[0]); i++)
{
if (images[i].image)
return 0;
}
int freeBackBuffer( window_t *window )
{
if (gui.backbuffer && gui.backbuffer->pixels)
{
free(gui.backbuffer->pixels);
free(gui.backbuffer);
gui.backbuffer = 0;
return 0;
}
return 1;
}
pixmap_t *getCroppedPixmapAtPosition( pixmap_t *from, position_t pos, uint16_t width, uint16_t height )
{
{
gui.backbuffer = malloc(sizeof(pixmap_t));
if(!gui.backbuffer)
{
return 1;
}
gui.backbuffer->pixels = malloc( window->width * window->height * 4 );
if(!gui.backbuffer->pixels)
{
gui.backbuffer->width = gui.screen.width;
gui.backbuffer->height = gui.screen.height;
return 0;
}
int freeBackBuffer( window_t *window )
{
if (gui.backbuffer && gui.backbuffer->pixels)
{
free(gui.backbuffer->pixels);
free(gui.backbuffer);
gui.backbuffer = 0;
return 0;
}
return 1;
}
int createWindowBuffer( window_t *window )
{
window->pixmap = malloc(sizeof(pixmap_t));
if(!window->pixmap)
{
return 1;
}
window->pixmap->pixels = malloc( window->width * window->height * 4 );
if(!window->pixmap->pixels)
window->pixmap->width = window->width;
window->pixmap->height = window->height;
return 0;
}
free(window->pixmap);
return 0;
}
return 1;
}
if(getDimensionForKey("devices_pos_y", &pixel, theme, gui.screen.height , gui.devicelist.height ) )
gui.devicelist.pos.y = pixel;
break;
case HorizontalLayout:
default:
gui.devicelist.width = ((images[iSelection].image->width + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->width + images[iDeviceScrollNext].image->width) + gui.devicelist.iconspacing);
if(getColorForKey("font_console_color", &color, theme))
gui.screen.font_console_color = (color & 0x00FFFFFF);
}
int initGUI(void)
{
intval;
}
}
}
// not available memory, freeing resources
freeWindowBuffer(&gui.menu);
freeWindowBuffer(&gui.infobox);
freeWindowBuffer(&gui.bootprompt);
freeWindowBuffer(&gui.devicelist);
freeWindowBuffer(&gui.screen);
freeBackBuffer(&gui.screen);
unloadGraphics();
// not available memory, freeing resources
freeWindowBuffer(&gui.menu);
freeWindowBuffer(&gui.infobox);
freeWindowBuffer(&gui.bootprompt);
freeWindowBuffer(&gui.devicelist);
freeWindowBuffer(&gui.screen);
freeBackBuffer(&gui.screen);
unloadGraphics();
return 1;
}
{
// Use HFS or HFSRAID icon depending on bvr flags.
if (device->flags & kBVFlagBooter) {
if (device->flags & kBVFlagBooter)
{
switch (device->OSVersion[3]) {
case '8':
devicetype = is_image_loaded(iDeviceHFSRAID_ML) ? iDeviceHFSRAID_ML : is_image_loaded(iDeviceHFSRAID) ? iDeviceHFSRAID : iDeviceGeneric;
break;
case '7':
devicetype = is_image_loaded(iDeviceHFSRAID_Lion) ? iDeviceHFSRAID_Lion : is_image_loaded(iDeviceHFSRAID) ? iDeviceHFSRAID : iDeviceGeneric;
break;
break;
}
}
else
{
} else {
switch (device->OSVersion[3]) {
case '8':
devicetype = is_image_loaded(iDeviceHFS_ML) ? iDeviceHFS_ML : is_image_loaded(iDeviceHFS) ? iDeviceHFS : iDeviceGeneric;
break;
case '7':
devicetype = is_image_loaded(iDeviceHFS_Lion) ? iDeviceHFS_Lion : is_image_loaded(iDeviceHFS) ? iDeviceHFS : iDeviceGeneric;
break;
case kPartitionTypeHPFS:
devicetype = is_image_loaded(iDeviceNTFS) ? iDeviceNTFS : iDeviceGeneric;// Use HPFS / NTFS icon
break;
case kPartitionTypeFAT16:
devicetype = is_image_loaded(iDeviceFAT16) ? iDeviceFAT16 : iDeviceGeneric;// Use FAT16 icon
break;
case kPartitionTypeFAT32:
devicetype = is_image_loaded(iDeviceFAT32) ? iDeviceFAT32 : iDeviceGeneric;// Use FAT32 icon
break;
case kPartitionTypeEXT3:
devicetype = is_image_loaded(iDeviceEXT3) ? iDeviceEXT3 : iDeviceGeneric;// Use EXT2/3 icon
break;
case kPartitionTypeFreeBSD:
case kPartitionTypeFreeBSD: /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
devicetype = is_image_loaded(iDeviceFreeBSD) ? iDeviceFreeBSD : iDeviceGeneric;// Use FreeBSD icon
break;
case kPartitionTypeOpenBSD:
case kPartitionTypeOpenBSD: /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */
devicetype = is_image_loaded(iDeviceOpenBSD) ? iDeviceOpenBSD : iDeviceGeneric;// Use OpenBSD icon
break;
case kPartitionTypeBEFS: /* Haiku detection and Icon credits to scorpius */
case kPartitionTypeBEFS: /* Haiku detection and Icon credits to scorpius */
devicetype = is_image_loaded(iDeviceBEFS) ? iDeviceBEFS : iDeviceGeneric;// Use BEFS / Haiku icon
break;
default:
devicetype = iDeviceGeneric;// Use Generic icon
break;
if (isSelected)
{
blend(images[iSelection].image, buffer, centeredAt(images[iSelection].image, p));
devicetype++;
devicetype++; // selec override image
}
// draw icon
position_tp, p_prev, p_next;
//uint8_tmaxDevices = MIN( gui.maxdevices, menucount );
fillPixmapWithColor( gui.devicelist.pixmap, gui.devicelist.bgcolor);
makeRoundedCorners( gui.devicelist.pixmap);
if(infoMenuSelection >= INFOMENU_NATIVEBOOT_START && infoMenuSelection <= INFOMENU_NATIVEBOOT_END)
infoMenuSelection = 0;
}
if (gui.menu.draw)
drawInfoMenuItems();
updateVRAM();
}
void clearGraphicBootPrompt()
{
// clear text buffer
//break;
case 15:
*(uint16_t *)(((uint8_t *)vram)+i*VIDEO (rowBytes) + j*2) = ((b&0xf8)>>3) | ((g&0xf8)<<2) | ((r&0xf8)<<7);
break;
break;
}
}
}
if (gui.bootprompt.draw)
blend( gui.bootprompt.pixmap, gui.backbuffer, gui.bootprompt.pos );
if (gui.menu.draw)
blend( gui.menu.pixmap, gui.backbuffer, gui.menu.pos );
if (gui.infobox.draw)
blend( gui.infobox.pixmap, gui.backbuffer, gui.infobox.pos );
}
vramwrite ( gui.backbuffer->pixels, gui.backbuffer->width, gui.backbuffer->height );
if (gui.redraw)
bounds.y = ( window->height - window->vborder );
cursor = origin;
font_t *font = &font_console;
for( i=0; i< strlen(formattedtext); i++ )
{
character = formattedtext[i];
character -= 32;
// newline ?
if( formattedtext[i] == '\n' )
{
continue;
}
// tab ?
if( formattedtext[i] == '\t' )
cursor.x += ( font->chars[0]->width * 5 );
bounds.x = ( window->width - ( window->hborder * 2 ) );
bounds.y = ( window->height - ( window->vborder * 2 ) );
cursor = origin;
for( i=0; i< strlen(formattedtext); i++ )
{
character = formattedtext[i];
cursor.x = origin.x;
cursor.y += font->height;
}
// check y pos and reset to origin.y
if ( cursor.y > ( bounds.y + font->chars[0]->height) )
{
drawStr(text, font, blendInto, p);
}
int destroyFont(font_t *font)
{
int i;
for (i = 0; i < CHARACTERS_COUNT; i++)
{
if (font->chars[i])
{
if (font->chars[i]->pixels) free (font->chars[i]->pixels);
free (font->chars[i]);
font->chars[i] = 0;
}
}
return 0;
}
int initFont(font_t *font, image_t *data)
{
unsigned int x = 0, y = 0, x2 = 0, x3 = 0;
for( x = 0; x < data->image->width && count < CHARACTERS_COUNT; x++)
{
start = end;
// if the pixel is red we've reached the end of the char
if( pixel( data->image, x, 0 ).value == 0xFFFF0000)
{
// check if font is monospaced
if( ( count > 0 ) && ( font->width != font->chars[count]->width ) )
monospaced = true;
font->width = font->chars[count]->width;
count++;
return 0;
}
int destroyFont(font_t *font)
{
int i;
for (i = 0; i < CHARACTERS_COUNT; i++)
{
if (font->chars[i])
{
if (font->chars[i]->pixels) free (font->chars[i]->pixels);
free (font->chars[i]);
font->chars[i] = 0;
}
}
return 0;
}
void colorFont(font_t *font, uint32_t color)
{
if( !color )
break;
}
}
fillPixmapWithColor( gui.infobox.pixmap, gui.infobox.bgcolor);
makeRoundedCorners( gui.infobox.pixmap);
// print the title if present
if( title )
drawStr(title, &font_console, gui.infobox.pixmap, pos_title);
updateVRAM();
break;
}
if(key == ' ') // spacebar = next page
{
if( lines > ( currentline + visiblelines ) )
for(x=todraw, x2 = 0; x < width - 1; x++, x2++)
{
if(x2 == (buffBG->width -2 )) x2 = 0;
pixel(&progressbar, x,y).value = pixel(buffBG, x2,y).value;
pixel(&progressbar, x,y).value = pixel(buffBG, x2,y).value;
}
if(progress < 100)
pixel(&progressbar, width - 1, y).value = pixel(buffBG, buffBG->width - 1, y).value;
pixel(&progressbar, 0, y).value = pixel(buffBG, buffBG->width - 1, y).value;
x2=0;
}
blend(&progressbar, blendInto, p);
animateProgressBar();
free(progressbar.pixels);
for ( i = 0, n = iMenuBoot; i < infoMenuItemsCount; i++, n++)
{
if (i == infoMenuSelection)
{
blend(selection, gui.menu.pixmap, position);
}
pbuff = images[n].image;
if (offset && i >= INFOMENU_NATIVEBOOT_START && i <= INFOMENU_NATIVEBOOT_END)
{
blend( images[n + (iMenuHelp - iMenuBoot)].image , gui.menu.pixmap,
pos((position.x + (gui.menu.hborder / 2)), position.y + ((selection->height - pbuff->height) / 2)));
}
else
{
blend( pbuff, gui.menu.pixmap,
pos((position.x + (gui.menu.hborder / 2)), position.y + ((selection->height - pbuff->height) / 2)));
}
drawStr(infoMenuItems[i].text, &font_console, gui.menu.pixmap,
pos(position.x + (pbuff->width + gui.menu.hborder),
{
case KEY_UP:// up arrow
if (infoMenuSelection > 0)
if (infoMenuSelection > 0)
{
if(!infoMenuNativeBoot && infoMenuSelection == INFOMENU_NATIVEBOOT_END + 1)
{
if(!infoMenuNativeBoot && infoMenuSelection == INFOMENU_NATIVEBOOT_END + 1)
infoMenuSelection -= 4;
else
infoMenuSelection--;
drawInfoMenuItems();
updateVRAM();
} else {
gui.menu.draw = false;
gui.redraw = true;
updateVRAM();
return CLOSE_INFO_MENU;
infoMenuSelection -= 4;
}
break;
case KEY_DOWN:// down arrow
if (infoMenuSelection < infoMenuItemsCount - 1)
else
{
if(!infoMenuNativeBoot && infoMenuSelection == INFOMENU_NATIVEBOOT_START - 1)
infoMenuSelection += 4;
else
infoMenuSelection++;
drawInfoMenuItems();
updateVRAM();
infoMenuSelection--;
}
break;
drawInfoMenuItems();
updateVRAM();
}
else
{
gui.menu.draw = false;
gui.redraw = true;
updateVRAM();
return CLOSE_INFO_MENU;
}
break;
case KEY_DOWN:// down arrow
if (infoMenuSelection < infoMenuItemsCount - 1)
{
if(!infoMenuNativeBoot && infoMenuSelection == INFOMENU_NATIVEBOOT_START - 1)
infoMenuSelection += 4;
else
infoMenuSelection++;
drawInfoMenuItems();
updateVRAM();
}
break;
case KEY_ENTER:
key = 0;
if( infoMenuSelection == MENU_SHOW_MEMORY_INFO )
showInfoBox( "Memory Info. Press q to quit.\n", getMemoryInfoString());
key = 0;
if( infoMenuSelection == MENU_SHOW_MEMORY_INFO )
showInfoBox( "Memory Info. Press q to quit.\n", getMemoryInfoString());
else if( infoMenuSelection == MENU_SHOW_VIDEO_INFO )
showInfoBox( getVBEInfoString(), getVBEModeInfoString() );
else if( infoMenuSelection == MENU_SHOW_VIDEO_INFO )
showInfoBox( getVBEInfoString(), getVBEModeInfoString() );
else if( infoMenuSelection == MENU_SHOW_HELP )
showHelp();
else
{
int buff = infoMenuSelection;
infoMenuSelection = 0;
return buff;
}
break;
}
else if( infoMenuSelection == MENU_SHOW_HELP )
showHelp();
else
{
int buff = infoMenuSelection;
infoMenuSelection = 0;
return buff;
}
break;
}
return DO_NOT_BOOT;
}
trunk/i386/boot2/gui.h
1717
1818
1919
20
20
2121
2222
23
24
25
23
24
25
2626
27
27
2828
2929
3030
3131
3232
3333
34
34
3535
3636
3737
38
38
3939
4040
4141
#include "graphic_utils.h"
#include "picopng.h"
#define CHARACTERS_COUNT223
#define CHARACTERS_COUNT223
#define BOOT_NORMAL0
#define BOOT_VERBOSE1
#define BOOT_IGNORECACHE2
#define BOOT_SINGLEUSER3
#define BOOT_VERBOSE1
#define BOOT_IGNORECACHE2
#define BOOT_SINGLEUSER3
#define DO_NOT_BOOT4
#define CLOSE_INFO_MENU5
#define CLOSE_INFO_MENU5
#define INFOMENU_NATIVEBOOT_START1
#define INFOMENU_NATIVEBOOT_END3
#define MENU_SHOW_MEMORY_INFO4
#define MENU_SHOW_VIDEO_INFO5
#define MENU_SHOW_HELP6
#define MENU_SHOW_HELP6
enum {
HorizontalLayout= 0,
VerticalLayout= 1
VerticalLayout= 1,
};
/*

Archive Download the corresponding diff file

Revision: 1990