]> git.saurik.com Git - winterboard.git/commitdiff
Put some paper down to clean up the mess.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 6 May 2010 09:09:24 +0000 (09:09 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 6 May 2010 09:09:24 +0000 (09:09 +0000)
Application.mm
Library.mm
Settings.mm
WinterBoardSettings.bundle/WinterBoard.plist
control
preinst

index b09de36615b953ae0787bad1a7ff8b9492c785bc..aa4397ff1e1a0b20c391ea3945cd26a05b0dd8d2 100644 (file)
@@ -134,13 +134,13 @@ static Class $WBSettingsController;
     }
 }
 
     }
 }
 
-- (id) _popController {
+- (void) _popController {
     // Pop the last controller = exit the application.
     // The only time the last controller should pop is when the user taps Respring/Cancel.
     // Which only gets displayed if the user has made changes.
     if ([self topViewController] == _rootListController)
         [[UIApplication sharedApplication] terminateWithSuccess];
     // Pop the last controller = exit the application.
     // The only time the last controller should pop is when the user taps Respring/Cancel.
     // Which only gets displayed if the user has made changes.
     if ([self topViewController] == _rootListController)
         [[UIApplication sharedApplication] terminateWithSuccess];
-    return [super _popController];
+    [super _popController];
 }
 
 @end
 }
 
 @end
index 697f07d1873845474e568647e11689eb1d96fe56..af36b35ff9f6490701240868880649bbd3e0a0bf 100644 (file)
@@ -143,6 +143,8 @@ Class $SBStatusBarTimeView;
 Class $SBUIController;
 Class $SBWidgetApplicationIcon;
 
 Class $SBUIController;
 Class $SBWidgetApplicationIcon;
 
+static bool IsWild_;
+
 @interface NSDictionary (WinterBoard)
 - (UIColor *) wb$colorForKey:(NSString *)key;
 - (BOOL) wb$boolForKey:(NSString *)key;
 @interface NSDictionary (WinterBoard)
 - (UIColor *) wb$colorForKey:(NSString *)key;
 - (BOOL) wb$boolForKey:(NSString *)key;
@@ -464,6 +466,15 @@ MSHook(UIImage *, SBApplicationIcon$icon, SBApplicationIcon *self, SEL sel) {
     return _SBApplicationIcon$icon(self, sel);
 }
 
     return _SBApplicationIcon$icon(self, sel);
 }
 
+MSHook(UIImage *, SBApplicationIcon$generateIconImage$, SBApplicationIcon *self, SEL sel, int type) {
+    if (type == 2)
+        if (![Info_ wb$boolForKey:@"ComposeStoreIcons"])
+            if (NSString *path = $pathForIcon$([self application]))
+                if (UIImage *image = [UIImage imageWithContentsOfFile:path])
+                    return [image _imageScaledToProportion:1.2 interpolationQuality:5];
+    return _SBApplicationIcon$generateIconImage$(self, sel, type);
+}
+
 MSHook(UIImage *, SBWidgetApplicationIcon$icon, SBWidgetApplicationIcon *self, SEL sel) {
     if (Debug_)
         NSLog(@"WB:Debug:Widget(%@:%@)", [self displayIdentifier], [self displayName]);
 MSHook(UIImage *, SBWidgetApplicationIcon$icon, SBWidgetApplicationIcon *self, SEL sel) {
     if (Debug_)
         NSLog(@"WB:Debug:Widget(%@:%@)", [self displayIdentifier], [self displayName]);
@@ -592,15 +603,12 @@ MSHook(void, SBCalendarIconContentsView$drawRect$, SBCalendarIconContentsView *s
 
     CFRelease(formatter);
 
 
     CFRelease(formatter);
 
-    UIDevice *device([UIDevice currentDevice]);
-    bool isWild([device respondsToSelector:@selector(isWildcat)] && [device isWildcat]);
-
     NSString *datestyle([@""
         "font-family: Helvetica; "
         "font-weight: bold; "
         "color: #333333; "
         "alpha: 1.0; "
     NSString *datestyle([@""
         "font-family: Helvetica; "
         "font-weight: bold; "
         "color: #333333; "
         "alpha: 1.0; "
-    "" stringByAppendingString:(isWild
+    "" stringByAppendingString:(IsWild_
         ? @"font-size: 54px; "
         : @"font-size: 39px; "
     )]);
         ? @"font-size: 54px; "
         : @"font-size: 39px; "
     )]);
@@ -610,7 +618,7 @@ MSHook(void, SBCalendarIconContentsView$drawRect$, SBCalendarIconContentsView *s
         "font-weight: bold; "
         "color: white; "
         "text-shadow: rgba(0, 0, 0, 0.2) -1px -1px 2px; "
         "font-weight: bold; "
         "color: white; "
         "text-shadow: rgba(0, 0, 0, 0.2) -1px -1px 2px; "
-    "" stringByAppendingString:(isWild
+    "" stringByAppendingString:(IsWild_
         ? @"font-size: 11px; "
         : @"font-size: 9px; "
     )]);
         ? @"font-size: 11px; "
         : @"font-size: 9px; "
     )]);
@@ -625,7 +633,7 @@ MSHook(void, SBCalendarIconContentsView$drawRect$, SBCalendarIconContentsView *s
     CGSize datesize = [(NSString *)date sizeWithStyle:datestyle forWidth:(width + leeway)];
     CGSize daysize = [(NSString *)day sizeWithStyle:daystyle forWidth:(width + leeway)];
 
     CGSize datesize = [(NSString *)date sizeWithStyle:datestyle forWidth:(width + leeway)];
     CGSize daysize = [(NSString *)day sizeWithStyle:daystyle forWidth:(width + leeway)];
 
-    unsigned base(isWild ? 89 : 70);
+    unsigned base(IsWild_ ? 89 : 70);
     if ($GSFontGetUseLegacyFontMetrics())
         base = base + 1;
 
     if ($GSFontGetUseLegacyFontMetrics())
         base = base + 1;
 
@@ -634,7 +642,7 @@ MSHook(void, SBCalendarIconContentsView$drawRect$, SBCalendarIconContentsView *s
     ) withStyle:datestyle];
 
     [(NSString *)day drawAtPoint:CGPointMake(
     ) withStyle:datestyle];
 
     [(NSString *)day drawAtPoint:CGPointMake(
-        (width + 1 - daysize.width) / 2, ((isWild ? 18 : 16) - daysize.height) / 2
+        (width + 1 - daysize.width) / 2, ((IsWild_ ? 18 : 16) - daysize.height) / 2
     ) withStyle:daystyle];
 
     CFRelease(date);
     ) withStyle:daystyle];
 
     CFRelease(date);
@@ -698,6 +706,7 @@ MSHook(UIImage *, UIImage$defaultDesktopImage, UIImage *self, SEL sel) {
 }
 
 static NSArray *Wallpapers_;
 }
 
 static NSArray *Wallpapers_;
+static bool Papered_;
 static NSString *WallpaperFile_;
 static UIImageView *WallpaperImage_;
 static UIWebDocumentView *WallpaperPage_;
 static NSString *WallpaperFile_;
 static UIImageView *WallpaperImage_;
 static UIWebDocumentView *WallpaperPage_;
@@ -714,6 +723,15 @@ MSHook(id, SBUIController$init, SBUIController *self, SEL sel) {
     if (self == nil)
         return nil;
 
     if (self == nil)
         return nil;
 
+    if (Papered_) {
+        UIWindow *&_wallpaperView(MSHookIvar<UIWindow *>(self, "_wallpaperView"));
+        if (&_wallpaperView != NULL) {
+            [_wallpaperView removeFromSuperview];
+            [_wallpaperView release];
+            _wallpaperView = nil;
+        }
+    }
+
     UIWindow *&_window(MSHookIvar<UIWindow *>(self, "_window"));
     UIView *&_contentLayer(MSHookIvar<UIView *>(self, "_contentLayer"));
     UIView *&_contentView(MSHookIvar<UIView *>(self, "_contentView"));
     UIWindow *&_window(MSHookIvar<UIWindow *>(self, "_window"));
     UIView *&_contentLayer(MSHookIvar<UIView *>(self, "_contentLayer"));
     UIView *&_contentView(MSHookIvar<UIView *>(self, "_contentView"));
@@ -727,11 +745,22 @@ MSHook(id, SBUIController$init, SBUIController *self, SEL sel) {
         layer = nil;
 
     UIView *content([[[UIView alloc] initWithFrame:[layer frame]] autorelease]);
         layer = nil;
 
     UIView *content([[[UIView alloc] initWithFrame:[layer frame]] autorelease]);
+
     [content setBackgroundColor:[layer backgroundColor]];
     [layer setBackgroundColor:[UIColor clearColor]];
     [layer setFrame:[content bounds]];
     [_window setContentView:content];
 
     [content setBackgroundColor:[layer backgroundColor]];
     [layer setBackgroundColor:[UIColor clearColor]];
     [layer setFrame:[content bounds]];
     [_window setContentView:content];
 
+    UIView *indirect;
+    if (!SummerBoard_ || !IsWild_)
+        indirect = content;
+    else {
+        CGRect bounds([content bounds]);
+        indirect = [[[UIView alloc] initWithFrame:bounds] autorelease];
+        [content addSubview:indirect];
+        [indirect zoomToScale:2.4];
+    }
+
     _release(WallpaperFile_);
     _release(WallpaperImage_);
     _release(WallpaperPage_);
     _release(WallpaperFile_);
     _release(WallpaperImage_);
     _release(WallpaperPage_);
@@ -751,7 +780,7 @@ MSHook(id, SBUIController$init, SBUIController *self, SEL sel) {
 
             AVQueue *queue([controller_ queue]);
 
 
             AVQueue *queue([controller_ queue]);
 
-            UIView *video([[[UIView alloc] initWithFrame:[content bounds]] autorelease]);
+            UIView *video([[[UIView alloc] initWithFrame:[indirect bounds]] autorelease]);
             [controller_ setLayer:[video _layer]];
 
             AVItem *item([[[AVItem alloc] initWithPath:mp4 error:&error] autorelease]);
             [controller_ setLayer:[video _layer]];
 
             AVItem *item([[[AVItem alloc] initWithPath:mp4 error:&error] autorelease]);
@@ -764,14 +793,14 @@ MSHook(id, SBUIController$init, SBUIController *self, SEL sel) {
            controller.movieControlMode = MPMovieControlModeHidden;
            [controller play];
 #else
            controller.movieControlMode = MPMovieControlModeHidden;
            [controller play];
 #else
-            MPVideoView *video = [[[$MPVideoView alloc] initWithFrame:[content bounds]] autorelease];
+            MPVideoView *video = [[[$MPVideoView alloc] initWithFrame:[indirect bounds]] autorelease];
             [video setMovieWithPath:mp4];
             [video setRepeatMode:1];
             [video setRepeatGap:-1];
             [video playFromBeginning];;
 #endif
 
             [video setMovieWithPath:mp4];
             [video setRepeatMode:1];
             [video setRepeatGap:-1];
             [video playFromBeginning];;
 #endif
 
-            [content addSubview:video];
+            [indirect addSubview:video];
         }
 
         NSString *png = [theme stringByAppendingPathComponent:@"Wallpaper.png"];
         }
 
         NSString *png = [theme stringByAppendingPathComponent:@"Wallpaper.png"];
@@ -796,12 +825,12 @@ MSHook(id, SBUIController$init, SBUIController *self, SEL sel) {
             WallpaperImage_ = [[UIImageView alloc] initWithImage:image];
             if (NSNumber *number = [Info_ objectForKey:@"WallpaperAlpha"])
                 [WallpaperImage_ setAlpha:[number floatValue]];
             WallpaperImage_ = [[UIImageView alloc] initWithImage:image];
             if (NSNumber *number = [Info_ objectForKey:@"WallpaperAlpha"])
                 [WallpaperImage_ setAlpha:[number floatValue]];
-            [content addSubview:WallpaperImage_];
+            [indirect addSubview:WallpaperImage_];
         }
 
         NSString *html = [theme stringByAppendingPathComponent:@"Wallpaper.html"];
         if ([Manager_ fileExistsAtPath:html]) {
         }
 
         NSString *html = [theme stringByAppendingPathComponent:@"Wallpaper.html"];
         if ([Manager_ fileExistsAtPath:html]) {
-            CGRect bounds = [content bounds];
+            CGRect bounds = [indirect bounds];
 
             UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]);
             [view setAutoresizes:true];
 
             UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]);
             [view setAutoresizes:true];
@@ -816,7 +845,7 @@ MSHook(id, SBUIController$init, SBUIController *self, SEL sel) {
                 [view setDrawsBackground:NO];
             [[view webView] setDrawsBackground:NO];
 
                 [view setDrawsBackground:NO];
             [[view webView] setDrawsBackground:NO];
 
-            [content addSubview:view];
+            [indirect addSubview:view];
         }
     }
 
         }
     }
 
@@ -824,7 +853,7 @@ MSHook(id, SBUIController$init, SBUIController *self, SEL sel) {
         NSString *theme = [themes_ objectAtIndex:(e - i - 1)];
         NSString *html = [theme stringByAppendingPathComponent:@"Widget.html"];
         if ([Manager_ fileExistsAtPath:html]) {
         NSString *theme = [themes_ objectAtIndex:(e - i - 1)];
         NSString *html = [theme stringByAppendingPathComponent:@"Widget.html"];
         if ([Manager_ fileExistsAtPath:html]) {
-            CGRect bounds = [content bounds];
+            CGRect bounds = [indirect bounds];
 
             UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]);
             [view setAutoresizes:true];
 
             UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]);
             [view setAutoresizes:true];
@@ -837,7 +866,7 @@ MSHook(id, SBUIController$init, SBUIController *self, SEL sel) {
                 [view setDrawsBackground:NO];
             [[view webView] setDrawsBackground:NO];
 
                 [view setDrawsBackground:NO];
             [[view webView] setDrawsBackground:NO];
 
-            [content addSubview:view];
+            [indirect addSubview:view];
         }
     }
 
         }
     }
 
@@ -1192,19 +1221,16 @@ MSHook(void, SBIconLabel$drawRect$, SBIconLabel *self, SEL sel, CGRect rect) {
 
     NSString *label(MSHookIvar<NSString *>(self, "_label"));
 
 
     NSString *label(MSHookIvar<NSString *>(self, "_label"));
 
-    UIDevice *device([UIDevice currentDevice]);
-    bool isWild([device respondsToSelector:@selector(isWildcat)] && [device isWildcat]);
-
     NSString *style = [NSString stringWithFormat:@""
         "font-family: Helvetica; "
         "font-weight: bold; "
         "color: %@; %@"
     NSString *style = [NSString stringWithFormat:@""
         "font-family: Helvetica; "
         "font-weight: bold; "
         "color: %@; %@"
-    "", (docked || !SummerBoard_ ? @"white" : @"#b3b3b3"), (isWild
+    "", (docked || !SummerBoard_ ? @"white" : @"#b3b3b3"), (IsWild_
         ? @"font-size: 12px; "
         : @"font-size: 11px; "
     )];
 
         ? @"font-size: 12px; "
         : @"font-size: 11px; "
     )];
 
-    if (isWild)
+    if (IsWild_)
         style = [style stringByAppendingString:@"text-shadow: rgba(0, 0, 0, 0.5) 0px 1px 0px; "];
     else if (docked)
         style = [style stringByAppendingString:@"text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px; "];
         style = [style stringByAppendingString:@"text-shadow: rgba(0, 0, 0, 0.5) 0px 1px 0px; "];
     else if (docked)
         style = [style stringByAppendingString:@"text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px; "];
@@ -1601,6 +1627,7 @@ extern "C" void WBInitialize() {
         if (SummerBoard_) {
             WBRename(SBApplication, pathForIcon, pathForIcon);
             WBRename(SBApplicationIcon, icon, icon);
         if (SummerBoard_) {
             WBRename(SBApplication, pathForIcon, pathForIcon);
             WBRename(SBApplicationIcon, icon, icon);
+            WBRename(SBApplicationIcon, generateIconImage:, generateIconImage$);
         }
 
         WBRename(SBBookmarkIcon, icon, icon);
         }
 
         WBRename(SBBookmarkIcon, icon, icon);
@@ -1646,10 +1673,14 @@ extern "C" void WBInitialize() {
     }
 
     Wallpapers_ = [[NSArray arrayWithObjects:@"Wallpaper.mp4", @"Wallpaper.png", @"Wallpaper.jpg", @"Wallpaper.html", nil] retain];
     }
 
     Wallpapers_ = [[NSArray arrayWithObjects:@"Wallpaper.mp4", @"Wallpaper.png", @"Wallpaper.jpg", @"Wallpaper.html", nil] retain];
+    Papered_ = $getTheme$(Wallpapers_) != nil;
+
+    UIDevice *device([UIDevice currentDevice]);
+    IsWild_ = [device respondsToSelector:@selector(isWildcat)] && [device isWildcat];
 
     if ([Info_ objectForKey:@"UndockedIconLabels"] == nil)
         [Info_ setObject:[NSNumber numberWithBool:(
 
     if ([Info_ objectForKey:@"UndockedIconLabels"] == nil)
         [Info_ setObject:[NSNumber numberWithBool:(
-            $getTheme$(Wallpapers_) == nil ||
+            Papered_ ||
             [Info_ objectForKey:@"DockedIconLabelStyle"] != nil ||
             [Info_ objectForKey:@"UndockedIconLabelStyle"] != nil
         )] forKey:@"UndockedIconLabels"];
             [Info_ objectForKey:@"DockedIconLabelStyle"] != nil ||
             [Info_ objectForKey:@"UndockedIconLabelStyle"] != nil
         )] forKey:@"UndockedIconLabels"];
index 6c4cd0142b9434275b7f4314227b75a91ce45dd9..3a5d6b67ffd1bb55a1549aae90e9922ef1f00ac3 100644 (file)
@@ -454,8 +454,8 @@ static NSString *_plist;
     [_settings setObject:[NSNumber numberWithBool:IsIconHiddenDisplayId(WinterBoardDisplayID)] forKey:@"IconHidden"];
     [self reloadSpecifiers];
     if (![[PSViewController class] instancesRespondToSelector:@selector(showLeftButton:withStyle:rightButton:withStyle:)]) {
     [_settings setObject:[NSNumber numberWithBool:IsIconHiddenDisplayId(WinterBoardDisplayID)] forKey:@"IconHidden"];
     [self reloadSpecifiers];
     if (![[PSViewController class] instancesRespondToSelector:@selector(showLeftButton:withStyle:rightButton:withStyle:)]) {
-        self.navigationItem.leftBarButtonItem = nil;
-        self.navigationItem.rightBarButtonItem = nil;
+        [[self navigationItem] setLeftBarButtonItem:nil];
+        [[self navigationItem] setRightBarButtonItem:nil];
     } else {
         [self showLeftButton:nil withStyle:0 rightButton:nil withStyle:0];
     }
     } else {
         [self showLeftButton:nil withStyle:0 rightButton:nil withStyle:0];
     }
@@ -490,7 +490,8 @@ static NSString *_plist;
 - (void) viewWillAppear:(BOOL)animated {
     if (settingsChanged)
         [self settingsChanged];
 - (void) viewWillAppear:(BOOL)animated {
     if (settingsChanged)
         [self settingsChanged];
-    [super viewWillAppear:animated];
+    if ([super respondsToSelector:@selector(viewWillAppear:)])
+        [super viewWillAppear:animated];
 }
 
 - (void) pushController:(id)controller {
 }
 
 - (void) pushController:(id)controller {
@@ -510,8 +511,8 @@ static NSString *_plist;
         UIBarButtonItem *cancelButton([[UIBarButtonItem alloc] initWithTitle:@"Cancel" style:UIBarButtonItemStylePlain target:self action:@selector(settingsConfirmButtonClicked:)]);
         cancelButton.tag = 0;
         respringButton.tag = 1;
         UIBarButtonItem *cancelButton([[UIBarButtonItem alloc] initWithTitle:@"Cancel" style:UIBarButtonItemStylePlain target:self action:@selector(settingsConfirmButtonClicked:)]);
         cancelButton.tag = 0;
         respringButton.tag = 1;
-        self.navigationItem.leftBarButtonItem = respringButton;
-        self.navigationItem.rightBarButtonItem = cancelButton;
+        [[self navigationItem] setLeftBarButtonItem:respringButton];
+        [[self navigationItem] setRightBarButtonItem:cancelButton];
         [respringButton release];
         [cancelButton release];
     } else {
         [respringButton release];
         [cancelButton release];
     } else {
index 4321e9c700f7c6088322106b8b9e6437127918fd..e44af72dd719e15489fa832a5170cce28abb119d 100644 (file)
@@ -50,8 +50,7 @@
                        <key>cell</key>
                        <string>PSGroupCell</string>
                        <key>footerText</key>
                        <key>cell</key>
                        <string>PSGroupCell</string>
                        <key>footerText</key>
-                       <string>Most themes are ancient/slow, designed
-for SummerBoard, not WinterBoard.</string>
+                       <string>Most themes are ancient/slow, designed for SummerBoard, not WinterBoard.</string>
                </dict>
                <dict>
                        <key>cell</key>
                </dict>
                <dict>
                        <key>cell</key>
@@ -90,8 +89,7 @@ for SummerBoard, not WinterBoard.</string>
                        <key>cell</key>
                        <string>PSTitleValueCell</string>
                        <key>label</key>
                        <key>cell</key>
                        <string>PSTitleValueCell</string>
                        <key>label</key>
-                       <string>Most themes are ancient/slow, designed
-for SummerBoard, not WinterBoard.</string>
+                       <string>Most themes are ancient/slow, designed for SummerBoard, not WinterBoard.</string>
                        <key>requiredCapabilities</key>
                        <array>
                                <dict>
                        <key>requiredCapabilities</key>
                        <array>
                                <dict>
diff --git a/control b/control
index 15e183dd5fc7edff8d5aa3ccda11a7bfd0195255..5d9fea3c49e413db9842a10fdcc23dddd4146d9a 100644 (file)
--- a/control
+++ b/control
@@ -3,7 +3,7 @@ Priority: optional
 Section: System
 Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
 Architecture: iphoneos-arm
 Section: System
 Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
 Architecture: iphoneos-arm
-Version: 0.9.3173-1
+Version: 0.9.3179-1
 Description: more powerful, open-source SummerBoard
 Name: WinterBoard
 Depends: mobilesubstrate (>= 0.9.2958-1), killall, preferenceloader, libhide (>= 2.0.4), findutils, net.howett.pincrush (>= 0.0.1-23) | pincrush
 Description: more powerful, open-source SummerBoard
 Name: WinterBoard
 Depends: mobilesubstrate (>= 0.9.2958-1), killall, preferenceloader, libhide (>= 2.0.4), findutils, net.howett.pincrush (>= 0.0.1-23) | pincrush
diff --git a/preinst b/preinst
index 8018e12a2b62956e66bf6ffcc54cb4c370208f2e..e5691e6a703486f032d1cf632029f1dda1e1638c 100755 (executable)
--- a/preinst
+++ b/preinst
@@ -31,6 +31,7 @@ if [[ $1 == install || $1 == upgrade ]]; then
         cat <<EOF
 reserve com.saurik.winterboard. 0 0 rwr-r-
 monitor com.saurik.winterboard.lockbackground /var/mobile/Library/LockBackground.jpg
         cat <<EOF
 reserve com.saurik.winterboard. 0 0 rwr-r-
 monitor com.saurik.winterboard.lockbackground /var/mobile/Library/LockBackground.jpg
+monitor com.saurik.winterboard.lockbackground /var/mobile/Library/HomeBackground.jpg
 EOF
     } >/etc/notify.conf_ &&
         chmod --reference=/etc/notify.conf /etc/notify.conf_ &&
 EOF
     } >/etc/notify.conf_ &&
         chmod --reference=/etc/notify.conf /etc/notify.conf_ &&