Index: branches/cparm/CHANGES
===================================================================
--- branches/cparm/CHANGES (revision 1736)
+++ branches/cparm/CHANGES (revision 1737)
@@ -1,3 +1,6 @@
+- Updated the default theme to v 1.1 (credit to blackosx)
+- Updated LogintoLion with he haiku device logo (credit to blackosx)
+- Updated for the gui
- Chameleon can now boot the Lion Auto-Installer partition (additionally, on a GPT disk this enable the option "Localize my Mac" of iCloud)
- Added a first version of amlsgn (NOTE: This tool can can sign an aml file for your machine (with the UUID) or for your machine model, this can be useful
with multiple machines w/o an identical model, combined with acpicodec and the option "LoadSignedAmlOnly", you can make sure that Chameleon will load the
Index: branches/cparm/artwork/themes/default/device_hfsplus_tiger.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsplus_tiger.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_befs.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_befs.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/text_scroll_prev.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsraid.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/logo.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsplus_sl.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsplus_sl.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsplus_lion_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsplus_lion_o.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_ext3.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsplus_leo.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsplus_leo.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/boot.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/menu_single_user.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_fat_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_freebsd_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_freebsd_o.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsraid_tiger_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsraid_tiger_o.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_ntfs_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_scroll_prev.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_openbsd.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_openbsd.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsraid_sl_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsraid_sl_o.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsraid_leo_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsraid_leo_o.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/menu_ignore_caches.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/menu_verbose_disabled.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsplus_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsplus_lion.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsplus_lion.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/menu_boot.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/font_console.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_ntfs.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsraid_tiger.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsraid_tiger.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_freebsd.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_freebsd.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_fat.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_fat.png
___________________________________________________________________
Deleted: svn:executable
- *
Index: branches/cparm/artwork/themes/default/menu_single_user_disabled.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsraid_sl.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsraid_sl.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsraid_lion_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsraid_lion_o.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsraid_leo.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsraid_leo.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/font_small.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/text_scroll_next.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_cdrom_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsplus.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_selection.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/menu_ignore_caches_disabled.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/menu_video_info.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/menu_memory_info.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_generic_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/menu_selection.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/theme.plist
===================================================================
--- branches/cparm/artwork/themes/default/theme.plist (revision 1736)
+++ branches/cparm/artwork/themes/default/theme.plist (revision 1737)
@@ -5,11 +5,9 @@
Author
Blackosx
Version
- 1.0
-
+ 1.1
Enabled
no
-
screen_width
1024
screen_height
@@ -20,12 +18,10 @@
10
screen_bgcolor
#767f73
-
background_pos_x
50%
background_pos_y
0
-
logo_pos_x
logo_pos_y
@@ -34,7 +30,6 @@
#000000
logo_transparency
255
-
devices_pos_x
devices_pos_y
@@ -49,7 +44,6 @@
45
devices_layout
horizontal
-
bootprompt_pos_x
bootprompt_pos_y
@@ -66,7 +60,6 @@
#3e3e3e
bootprompt_transparency
1
-
infobox_pos_x
infobox_pos_y
@@ -83,7 +76,6 @@
#3e3e3e
infobox_transparency
35
-
menu_pos_x
menu_pos_y
@@ -96,7 +88,6 @@
#3e3e3e
menu_transparency
1
-
progressbar_pos_x
progressbar_pos_y
@@ -105,12 +96,10 @@
100
progressbar_height
40
-
countdown_pos_x
countdown_pos_y
-20%
-
boot_width
1024
boot_height
Index: branches/cparm/artwork/themes/default/device_hfsplus_tiger_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsplus_tiger_o.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_scroll_next.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_befs_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_befs_o.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/menu_help.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsraid_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsplus_sl_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsplus_sl_o.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/background.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/thumb.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsraid_lion.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsraid_lion.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_hfsplus_leo_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_hfsplus_leo_o.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/device_ext3_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_cdrom.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_openbsd_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/default/device_openbsd_o.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/default/progress_bar_background.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/progress_bar.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/menu_verbose.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/default/device_generic.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/cparm/artwork/themes/LoginToLion/device_befs.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/LoginToLion/device_befs.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/LoginToLion/device_befs_alt.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/LoginToLion/device_befs_alt.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/LoginToLion/device_befs_o.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/LoginToLion/device_befs_o.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/artwork/themes/LoginToLion/device_befs_o_alt.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/cparm/artwork/themes/LoginToLion/device_befs_o_alt.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Index: branches/cparm/i386/libsaio/disk.c
===================================================================
--- branches/cparm/i386/libsaio/disk.c (revision 1736)
+++ branches/cparm/i386/libsaio/disk.c (revision 1737)
@@ -1546,7 +1546,8 @@
sprintf(dirSpec, "hd(%d,%d)/", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (GetFileInfo(dirSpec, "Mac OS X Install Data", &flags, &time) == 0)
- {
+ {
+ /*** DIRTY HACK (would be better to have a plist) ***/
*str = '\0';
strncat(str, "10.7", 4);
return true;
Index: branches/cparm/i386/libsaio/stringTable.c
===================================================================
--- branches/cparm/i386/libsaio/stringTable.c (revision 1736)
+++ branches/cparm/i386/libsaio/stringTable.c (revision 1737)
@@ -597,12 +597,13 @@
int loadBooterConfig(config_file_t *config)
{
char *dirspec[] = {
- "rd(0,0)/Extra/com.apple.Boot.plist",
- "/Extra/com.apple.Boot.plist",
- "bt(0,0)/Extra/com.apple.Boot.plist",
+ "rd(0,0)/Extra/com.apple.Boot.plist",
+ "/Extra/com.apple.Boot.plist",
+ "bt(0,0)/Extra/com.apple.Boot.plist",
"rd(0,0)/Extra/org.chameleon.Boot.plist", // Add compatibility with the trunk
"/Extra/org.chameleon.Boot.plist", // Add compatibility with the trunk
- "bt(0,0)/Extra/org.chameleon.Boot.plist" // Add compatibility with the trunk
+ "bt(0,0)/Extra/org.chameleon.Boot.plist" // Add compatibility with the trunk
+
};
int i,fd, count, ret=-1;
@@ -683,11 +684,11 @@
int loadSystemConfig(config_file_t *config)
{
char *dirspec[] = {
- "rd(0,0)/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",
- "/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",
+ "rd(0,0)/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",
+ "/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",
"bt(0,0)/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",
- "rd(0,0)/Mac OS X Install Data/com.apple.Boot.plist",
- "/Mac OS X Install Data/com.apple.Boot.plist",
+ "rd(0,0)/Mac OS X Install Data/com.apple.Boot.plist",
+ "/Mac OS X Install Data/com.apple.Boot.plist",
"bt(0,0)/Mac OS X Install Data/com.apple.Boot.plist"
};
int i,fd, count, ret=-1;
Index: branches/cparm/i386/libsaio/saio_types.h
===================================================================
--- branches/cparm/i386/libsaio/saio_types.h (revision 1736)
+++ branches/cparm/i386/libsaio/saio_types.h (revision 1737)
@@ -208,7 +208,7 @@
bool filtered; /* newFilteredBVChain() will set to TRUE */
bool visible; /* will shown in the device list */
char OSVersion[8];
- bool OSisServer; /* Basically mean that OS X server is installed on this partition, not to be confused with Platform->CPU.isServer which means it tries to emulate an xserve in the smbios */
+ bool OSisServer; /* 1 = OS X server , 0 = OS X client, not to be confused with Platform->CPU.isServer which means it tries to emulate an xserve in the smbios */
};
enum {
Index: branches/cparm/i386/libsaio/fake_efi.c
===================================================================
--- branches/cparm/i386/libsaio/fake_efi.c (revision 1736)
+++ branches/cparm/i386/libsaio/fake_efi.c (revision 1737)
@@ -99,8 +99,8 @@
/* Info About the current Firmware */
#define FIRMWARE_MAINTENER "cparm, armelcadetpetit@gmail.com"
-static EFI_CHAR16 const FIRMWARE_NAME[] = {'S','a','d','D','a','r','w','i','n', 0}; // hummm, damn, Unfortunately, that day has come, ..... One more thing ???
-static EFI_UINT32 const FIRMWARE_REVISION = 0x00010500; //1.5
+static EFI_CHAR16 const FIRMWARE_NAME[] = {'S','a','v','a','n','n','a', 0};
+static EFI_UINT32 const FIRMWARE_REVISION = 0x00010700; //1.7
static EFI_UINT32 const DEVICE_SUPPORTED = 0x00000001;
/* Default platform system_id (fix by IntVar) */
Index: branches/cparm/i386/modules/GUI/gui.c
===================================================================
--- branches/cparm/i386/modules/GUI/gui.c (revision 1736)
+++ branches/cparm/i386/modules/GUI/gui.c (revision 1737)
@@ -22,7 +22,18 @@
#include "modules.h"
#include "sl.h"
+#ifndef DEBUG_GUI
+#define DEBUG_GUI 0
+#endif
+#if DEBUG_GUI==2
+#define DBG(x...) printf(x);sleep(2)
+#elif DEBUG_GUI==1
+#define DBG(x...) printf(x)
+#else
+#define DBG(x...)
+#endif
+
gui_t gui; // gui structure
font_t font_small;
font_t font_console;
@@ -54,7 +65,7 @@
static void drawStrCenteredAt(char *text, font_t *font, pixmap_t *blendInto, position_t p);
static position_t drawChar(unsigned char ch, font_t *font, pixmap_t *blendInto, position_t p);
static void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p);
-#if DEBUG
+#if DEBUG_GUI
static int dprintf( window_t * window, const char * fmt, ...);
#endif
static void sputc(int c, struct putc_info * pi);
@@ -345,7 +356,10 @@
uint16_t width;
uint16_t height;
uint8_t *imagedata;
- if ((unsigned)(strlen(image) + strlen(theme_name) + 30 ) > sizeof(dirspec)) {
+ if ((unsigned)(strlen(image) + strlen(theme_name) + strlen(src) + (6+1) ) > sizeof(dirspec)) {
+
+ DBG("Path of %s/%s/%s.png to long\n", src, theme_name, image);
+
return 1;
}
@@ -354,6 +368,9 @@
if (images[i].image == NULL) {
images[i].image = malloc(sizeof(pixmap_t));
if (images[i].image == NULL) {
+
+ DBG("Unable to allocate memory for %s.png\n", image);
+
return 1;
}
}
@@ -368,6 +385,9 @@
images[i].image->height = height;
images[i].image->pixels = (pixel_t *)imagedata;
flipRB(images[i].image);
+
+ DBG("[ %s ] succesfully loaded and registred !!\n", dirspec);
+
return 0;
}
#ifdef EMBED_THEME
@@ -399,7 +419,11 @@
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;
+
} else {
+
+ DBG("Unable to load %s, this image not vital anyway, reseting and returning success !!\n", dirspec);
+
free(images[i].image);
images[i].image = NULL;
}
@@ -408,22 +432,34 @@
}
else
{
-#ifndef EMBED_THEME
+#if DEBUG_GUI
printf("ERROR: GUI: could not open '%s/%s.png'!\n", theme_name, image);
sleep(2);
+#else
+#ifndef CONFIG_EMBED_THEME
+ printf("ERROR: GUI: could not open '%s/%s.png'!\n", theme_name, image);
+ sleep(2);
#endif
+#endif
free(images[i].image);
images[i].image = NULL;
return 1;
}
- }
+ }
+
+#if DEBUG_GUI
+ printf("[ %s/%s/%s.png ] not used in this version, skipped !!\n",src, theme_name, image);
+ sleep(2);
+#endif
return 1;
}
static int loadGraphics(char *src)
{
+ DBG("Loading image into memory....\n",theme_name);
+
LOADPNG(src, background, IMG_REQUIRED);
LOADPNG(src, logo, IMG_REQUIRED);
@@ -496,9 +532,13 @@
LOADPNG(src, font_console, IMG_REQUIRED);
LOADPNG(src, font_small, IMG_REQUIRED);
-
+
+ DBG("Initializing font....\n",theme_name);
+
initFont( &font_console, &images[iFontConsole]);
initFont( &font_small, &images[iFontSmall]);
+
+ DBG("Graphic objects successfully loaded !!\n",theme_name);
return 0;
}
@@ -566,13 +606,17 @@
{
gui.backbuffer = malloc(sizeof(pixmap_t));
if(!gui.backbuffer)
+ {
+ DBG("Unable to allocate memory for gui.backbuffer");
return 1;
+ }
gui.backbuffer->pixels = malloc( window->width * window->height * 4 );
if(!gui.backbuffer->pixels)
{
free(gui.backbuffer);
gui.backbuffer = 0;
+ DBG("Unable to allocate memory for gui.backbuffer->pixels");
return 1;
}
@@ -586,13 +630,17 @@
{
window->pixmap = malloc(sizeof(pixmap_t));
if(!window->pixmap)
+ {
+ DBG("Unable to allocate memory for window->pixmap");
return 1;
+ }
window->pixmap->pixels = malloc( window->width * window->height * 4 );
if(!window->pixmap->pixels)
{
free(window->pixmap);
window->pixmap = 0;
+ DBG("Unable to allocate memory for window->pixmap->pixels");
return 1;
}
@@ -925,56 +973,89 @@
int initGUI(void)
{
bool dummybool = true;
+ int ret = 1;
+ bool theme_ran= false;
+ bool theme_name_set= false;
+
getBoolForKey(kGUIKey, &dummybool, &bootInfo->bootConfig);
if (!dummybool) {
return 1;
}
+
+ getBoolForKey("RandomTheme", &theme_ran, &bootInfo->bootConfig);
+
{
long flags;
long time;
long ret = -1;
+ int len;
- ret = GetFileInfo("rd(0,0)/Extra/", "Themes", &flags, &time);
- if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) {
- sprintf(dirsrc, "rd(0,0)/Extra/Themes");
-
- } else {
- ret = GetFileInfo("/Extra/", "Themes", &flags, &time);
+ theme_name_set = getValueForKey( "Theme", &theme_name, &len, &bootInfo->bootConfig );
+
+ if (theme_ran)
+ {
+retry:
+ ret = GetFileInfo("rd(0,0)/Extra/", "Themes", &flags, &time);
if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) {
- sprintf(dirsrc, "/Extra/Themes");
+ sprintf(dirsrc, "rd(0,0)/Extra/Themes");
} else {
- ret = GetFileInfo("bt(0,0)/Extra/", "Themes", &flags, &time);
+ ret = GetFileInfo("/Extra/", "Themes", &flags, &time);
if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) {
- sprintf(dirsrc, "bt(0,0)/Extra/Themes");
+ sprintf(dirsrc, "/Extra/Themes");
} else {
- printf("Failed to find the /extra/Themes folder\n");
- return 1;
+ ret = GetFileInfo("bt(0,0)/Extra/", "Themes", &flags, &time);
+ if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) {
+ sprintf(dirsrc, "bt(0,0)/Extra/Themes");
+
+ } else {
+ printf("Failed to find the /extra/Themes folder\n");
+ return 1;
+ }
}
+
+ }
+ }
+ else if (theme_name_set)
+ {
+ ret = GetFileInfo("rd(0,0)/Extra/Themes/", theme_name, &flags, &time);
+ if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) {
+ sprintf(dirsrc, "rd(0,0)/Extra/Themes");
+
+ } else {
+ ret = GetFileInfo("/Extra/Themes/", theme_name, &flags, &time);
+ if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) {
+ sprintf(dirsrc, "/Extra/Themes");
+
+ } else {
+ ret = GetFileInfo("bt(0,0)/Extra/Themes/", theme_name, &flags, &time);
+ if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) {
+ sprintf(dirsrc, "bt(0,0)/Extra/Themes");
+
+ } else {
+ printf("Failed to find the /extra/Themes/%s folder\n",theme_name);
+ theme_name_set = false;
+ goto retry;
+ }
+ }
+
}
-
- }
- }
+ }
+ }
- int len;
- bool theme_ran= false;
- getBoolForKey("RandomTheme", &theme_ran, &bootInfo->bootConfig);
- int ret = 1;
-
- if (theme_ran) {
+ if (theme_ran)
+ {
ret = randomTheme(dirsrc, &theme_name);
- if (ret) printf("randomTheme Failed !! \n");
-
+ if (ret) printf("randomTheme Failed !! \n");
}
-
if (ret)
{
- if (getValueForKey( "Theme", &theme_name, &len, &bootInfo->bootConfig ) == true)
+ if (theme_name_set == true)
{
ret = startGUI();
@@ -990,7 +1071,7 @@
}
#endif
- if (ret) {
+ if (ret && (strcmp(theme_name, THEME_NAME_DEFAULT) != 0)) {
theme_name = THEME_NAME_DEFAULT;
ret = startGUI();
@@ -1006,12 +1087,14 @@
char dirspec[256];
- if ((unsigned)(strlen(theme_name) + 34) > sizeof(dirspec)) {
+ if ((unsigned)(strlen(theme_name) + strlen(dirsrc) + strlen("theme.plist") + 2 ) > sizeof(dirspec)) {
+
+ DBG("Path of %s/%s/theme.plist to long\n", dirsrc, theme_name);
return 1;
}
sprintf(dirspec, "%s/%s/theme.plist", dirsrc ,theme_name);
-
+
if (loadConfigFile(dirspec, &bootInfo->themeConfig) != 0) {
#ifdef EMBED_THEME
@@ -1020,11 +1103,18 @@
config = &bootInfo->themeConfig;
if (ParseXMLFile((char *)__theme_plist, &config->dictionary) != 0) {
+
+ DBG("Unable to load embed theme plist datas.\n");
+
return 1;
}
}
#else
- return 1;
+
+ DBG("Unable to load %s theme plist.\n",theme_name);
+
+ return 1;
+
#endif
}
@@ -1038,6 +1128,13 @@
screen_params[1] = val;
}
}
+#if DEBUG_GUI
+ else
+ {
+ printf("No getResolution function hook installed, using default resolution.\n",theme_name);
+
+ }
+#endif
// Initalizing GUI strucutre.
@@ -1086,7 +1183,9 @@
}
}
}
-
+
+ DBG("Loading error occurred, reseting...\n",theme_name);
+
// Loading error occurred, freeing resources
freeWindowBuffer(&gui.menu);
freeWindowBuffer(&gui.infobox);
@@ -1276,7 +1375,7 @@
if(gui.menu.draw)
drawInfoMenuItems();
-#if DEBUG
+#if DEBUG_GUI
gui.debug.cursor = pos( 10, 100);
dprintf( &gui.screen, "label %s\n", param->label );
dprintf( &gui.screen, "biosdev 0x%x\n", param->biosdev );
@@ -1542,7 +1641,7 @@
}
return 1;
}
-#if DEBUG
+#if DEBUG_GUI
static int dprintf( window_t * window, const char * fmt, ...)
{
char *formattedtext;