Chameleon

Chameleon Commit Details

Date:2010-11-19 08:36:15 (8 years 8 months ago)
Author:Evan Lojewski
Commit:642
Parents: 641
Message:GUI now starts after all modules have loaded. Fixed boot banner issue
Changes:
M/branches/meklort/i386/modules/GUI/GUI_module.c
M/branches/meklort/i386/modules/GUI/gui.c

File differences

branches/meklort/i386/modules/GUI/gui.c
716716
717717
718718
719
720
719
720
721721
722722
723
723
724
724725
725726
727
726728
729
727730
728731
732
729733
730734
731735
......
18651869
18661870
18671871
1872
18681873
18691874
18701875
18711876
18721877
18731878
1874
1875
1879
1880
18761881
18771882
18781883
18791884
1880
1885
1886
18811887
1882
1888
1889
18831890
1884
1885
1891
1892
18861893
18871894
18881895
}
else
{
// parse display size parameters
if (getIntForKey("screen_width", &val, &bootInfo->themeConfig) && val > 0) {
if (getIntForKey("screen_width", &val, &bootInfo->themeConfig) && val > 0)
{
screen_params[0] = val;
}
if (getIntForKey("screen_height", &val, &bootInfo->themeConfig) && val > 0) {
if (getIntForKey("screen_height", &val, &bootInfo->themeConfig) && val > 0)
{
screen_params[1] = val;
}
}
// Initalizing GUI strucutre.
bzero(&gui, sizeof(gui_t));
loadBootGraphics();
}
// parse screen size parameters
if(is_module_loaded("Resolution.dylib"))
{
getResolution(&screen_params[0], &screen_params[1], &screen_params[2]);
}
else
{
// parse screen size parameters
if (getIntForKey("boot_width", &pos, &bootInfo->themeConfig) && pos > 0) {
if (getIntForKey("boot_width", &pos, &bootInfo->themeConfig) && pos > 0)
{
screen_params[0] = pos;
} else {
screen_params[0] = DEFAULT_SCREEN_WIDTH;
}
if (getIntForKey("boot_height", &pos, &bootInfo->themeConfig) && pos > 0) {
if (getIntForKey("boot_height", &pos, &bootInfo->themeConfig) && pos > 0)
{
screen_params[1] = pos;
} else {
} else
{
screen_params[1] = DEFAULT_SCREEN_HEIGHT;
}
}
}
}
// Save current screen resolution.
oldScreenWidth = gui.screen.width;
branches/meklort/i386/modules/GUI/GUI_module.c
2323
2424
2525
26
2627
2728
2829
......
106107
107108
108109
109
110
111
112
113
114
110
115111
116
117112
118
119113
120114
121115
......
137131
138132
139133
134
135
136
137
138
139
140
141
142
140143
141144
142145
143146
144
147
145148
146149
147150
......
748751
749752
750753
751
754
752755
753756
754757
void GUI_Kernel_Start_hook(void* kernelEntry, void* arg2, void* arg3, void* arg4);
void GUI_PreBoot_hook(void* arg1, void* arg2, void* arg3, void* arg4);
void GUI_ModulesLoaded_hook(void* arg1, void* arg2, void* arg3, void* arg4);
int GUI_getBootOptions(bool firstRun);
}
}
/**
** Module startup code. Replace console only print functions as well as
** replace various menu functions. Finaly, initialize the gui and hook
** into important events.
**/
void GUI_start()
void GUI_ModulesLoaded_hook(void* kernelEntry, void* arg2, void* arg3, void* arg4)
{
// Start the gui
useGUI = true;
// Override useGUI default
getBoolForKey(kGUIKey, &useGUI, &bootInfo->bootConfig);
replace_function("_stop", &GUI_stop);
}
}
/**
** Module startup code. Replace console only print functions as well as
** replace various menu functions. Finaly, initialize the gui and hook
** into important events.
**/
void GUI_start()
{
// Hoot for the boot screen
//ExecKernel register_hook_callback("Kernel Start", &GUI_Kernel_Start_hook);
register_hook_callback("ExecKernel", &GUI_ExecKernel_hook);
register_hook_callback("PreBoot", &GUI_PreBoot_hook);
register_hook_callback("ModulesLoaded", &GUI_ModulesLoaded_hook);
}
/**
bool showBootBanner = false;
// Check if "Boot Banner"=N switch is present in config file.
if (getBoolForKey(kBootBannerKey, &showBootBanner, &bootInfo->bootConfig) && !showBootBanner)
if (getBoolForKey(kBootBannerKey, &showBootBanner, &bootInfo->bootConfig) && showBootBanner)
{
// Display banner and show hardware info.
gprintf(&gui.screen, bootBanner + 1, (bootInfo->convmem + bootInfo->extmem) / 1024);

Archive Download the corresponding diff file

Revision: 642