+@implementation WBSettingsController
+
++ (void) load {
+ void *libhide(dlopen("/usr/lib/hide.dylib", RTLD_LAZY));
+ IsIconHiddenDisplayId = reinterpret_cast<BOOL (*)(NSString *)>(dlsym(libhide, "IsIconHiddenDisplayId"));
+ HideIconViaDisplayId = reinterpret_cast<BOOL (*)(NSString *)>(dlsym(libhide, "HideIconViaDisplayId"));
+ UnHideIconViaDisplayId = reinterpret_cast<BOOL (*)(NSString *)>(dlsym(libhide, "UnHideIconViaDisplayId"));
+}
+
+- (id) initForContentSize:(CGSize)size {
+ if ((self = [super initForContentSize:size]) != nil) {
+ _plist = [[NSString stringWithFormat:@"%@/Library/Preferences/com.saurik.WinterBoard.plist", NSHomeDirectory()] retain];
+ _settings = [([NSMutableDictionary dictionaryWithContentsOfFile:_plist] ?: [NSMutableDictionary dictionary]) retain];
+
+ [_settings setObject:[NSNumber numberWithBool:IsIconHiddenDisplayId(WinterBoardDisplayID)] forKey:@"IconHidden"];
+ } return self;
+}
+
+- (void) dealloc {
+ [_settings release];
+ [_plist release];
+ [super dealloc];