]> git.saurik.com Git - winterboard.git/commitdiff
Fixed some visual artifacts on themes (transparency).
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 3 Aug 2008 12:49:04 +0000 (12:49 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 3 Aug 2008 12:49:04 +0000 (12:49 +0000)
Library.mm
control
makefile

index 194a6d27312553a98a6a91ed96e848378a008bd0..ebc014083b5ef63e1ce4103eac9ad97cac16e9c4 100644 (file)
@@ -62,6 +62,8 @@ extern "C" {
 #import <SpringBoard/SBAppWindow.h>
 #import <SpringBoard/SBButtonBar.h>
 #import <SpringBoard/SBContentLayer.h>
+#import <SpringBoard/SBStatusBarContentsView.h>
+#import <SpringBoard/SBStatusBarTimeView.h>
 #import <SpringBoard/SBUIController.h>
 
 #import <CoreGraphics/CGGeometry.h>
@@ -131,6 +133,8 @@ void WBRename(const char *classname, const char *oldname, IMP newimp) {
 @protocol WinterBoard
 - (NSString *) wb_pathForIcon;
 - (NSString *) wb_pathForResource:(NSString *)resource ofType:(NSString *)type;
+- (id) wb_init;
+- (id) wb_layer;
 - (id) wb_initWithSize:(CGSize)size;
 - (id) wb_initWithFrame:(CGRect)frame;
 - (id) wb_initWithCoder:(NSCoder *)coder;
@@ -139,6 +143,8 @@ void WBRename(const char *classname, const char *oldname, IMP newimp) {
 - (void) wb_setAlpha:(float)value;
 - (void) wb_setBarStyle:(int)style;
 - (id) wb_initWithFrame:(CGRect)frame withBarStyle:(int)style withTintColor:(UIColor *)color;
+- (void) wb_setOpaque:(BOOL)opaque;
+- (void) wb_didMoveToSuperview;
 @end
 
 NSMutableDictionary **ImageMap_;
@@ -197,12 +203,25 @@ NSString *NSBundle$pathForResource$ofType$(NSBundle<WinterBoard> *self, SEL sel,
     return [self wb_pathForResource:resource ofType:type];
 }
 
-void SBAppWindow$setBackgroundColor$(SBAppWindow<WinterBoard> *self, SEL sel, UIColor *color) {
+void $setBackgroundColor$(id<WinterBoard> self, SEL sel, UIColor *color) {
     if (Wallpaper_ != nil)
         return [self wb_setBackgroundColor:[UIColor clearColor]];
     return [self wb_setBackgroundColor:color];
 }
 
+/*id SBStatusBarContentsView$initWithFrame$(SBStatusBarContentsView<WinterBoard> *self, SEL sel, CGRect frame) {
+    self = [self wb_initWithFrame:frame];
+    if (self == nil)
+        return nil;
+
+    NSString *path = [NSString stringWithFormat:@"%@/StatusBar.png", theme_];
+    if ([Manager_ fileExistsAtPath:path])
+        [self addSubview:[[[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:path]] autorelease]];
+    //[self setBackgroundColor:[UIColor clearColor]];
+
+    return self;
+}*/
+
 bool UINavigationBar$setBarStyle$_(SBAppWindow<WinterBoard> *self) {
     if (Info_ != nil) {
         NSNumber *number = [Info_ objectForKey:@"NavigationBarStyle"];
@@ -253,23 +272,21 @@ void UINavigationBar$setBarStyle$(SBAppWindow<WinterBoard> *self, SEL sel, int s
     return [self wb_setBarStyle:style];
 }
 
-/*id SBButtonBar$initWithFrame$(SBButtonBar<WinterBoard> *self, SEL sel, CGRect frame) {
-    self = [self wb_initWithFrame:frame];
-    if (self == nil)
-        return nil;
-    if (Wallpaper_ != nil)
-        [self setBackgroundColor:[UIColor clearColor]];
-    return self;
-}*/
+void $didMoveToSuperview(SBButtonBar<WinterBoard> *self, SEL sel) {
+    [[self superview] setBackgroundColor:[UIColor clearColor]];
+    [self wb_didMoveToSuperview];
+}
 
 id SBContentLayer$initWithSize$(SBContentLayer<WinterBoard> *self, SEL sel, CGSize size) {
     self = [self wb_initWithSize:size];
     if (self == nil)
         return nil;
 
-    if (Wallpaper_ != nil)
+    if (Wallpaper_ != nil) {
         if (UIImage *image = [[UIImage alloc] initWithContentsOfFile:Wallpaper_])
             [self addSubview:[[[UIImageView alloc] initWithImage:image] autorelease]];
+        [self setBackgroundColor:[UIColor redColor]];
+    }
 
     return self;
 }
@@ -305,14 +322,18 @@ extern "C" void WBInitialize() {
 
     Manager_ = [[NSFileManager defaultManager] retain];
 
-    WBRename("SBApplication", "pathForIcon", (IMP) &SBApplication$pathForIcon);
-    WBRename("NSBundle", "pathForResource:ofType:", (IMP) &NSBundle$pathForResource$ofType$);
-    WBRename("SBAppWindow", "setBackgroundColor:", (IMP) &SBAppWindow$setBackgroundColor$);
-    WBRename("SBContentLayer", "initWithSize:", (IMP) &SBContentLayer$initWithSize$);
+    //WBRename("SBStatusBarContentsView", "setBackgroundColor:", (IMP) &$setBackgroundColor$);
     //WBRename("UINavigationBar", "initWithFrame:", (IMP) &UINavigationBar$initWithFrame$);
     //WBRename("UINavigationBar", "initWithCoder:", (IMP) &UINavigationBar$initWithCoder$);
     WBRename("UINavigationBar", "setBarStyle:", (IMP) &UINavigationBar$setBarStyle$);
     //WBRename("UINavigationBarBackground", "initWithFrame:withBarStyle:withTintColor:", (IMP) &UINavigationBarBackground$initWithFrame$withBarStyle$withTintColor$);
+    //WBRename("SBStatusBarContentsView", "initWithFrame:", (IMP) &SBStatusBarContentsView$initWithFrame$);
+
+    WBRename("SBApplication", "pathForIcon", (IMP) &SBApplication$pathForIcon);
+    WBRename("NSBundle", "pathForResource:ofType:", (IMP) &NSBundle$pathForResource$ofType$);
+    WBRename("SBContentLayer", "initWithSize:", (IMP) &SBContentLayer$initWithSize$);
+    WBRename("SBStatusBarContentsView", "didMoveToSuperview", (IMP) &$didMoveToSuperview);
+    WBRename("SBButtonBar", "didMoveToSuperview", (IMP) &$didMoveToSuperview);
 
     if (NSDictionary *settings = [[NSDictionary alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/Library/Preferences/com.saurik.WinterBoard.plist", NSHomeDirectory()]]) {
         [settings autorelease];
diff --git a/control b/control
index 6d3a9d279bf81f158b7d497c03a3651438bb166a..ad24cef77461a7ffe63f9dc592a816907c961672 100644 (file)
--- a/control
+++ b/control
@@ -3,7 +3,7 @@ Priority: optional
 Section: Themes
 Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
 Architecture: iphoneos-arm
-Version: 0.9.2500-1
+Version: 0.9.2501-2
 Description: more powerful, open-source SummerBoard
  This tool lets you apply SummerBoard themes. Themes are taken from /Library/Themes (or, now, the older SummerBoard folder). Right now the tool is /very/ simplistic: I have spent about a day coding it so that we would have some stronger theme support on iPhone 2.x. After you install or uninstall this package you will have to /reboot/ (seriously, REBOOT) your phone to it to take effect.
  
@@ -12,5 +12,7 @@ Description: more powerful, open-source SummerBoard
  WinterBoard is /much/ more powerful than SummerBoard and lets you theme almost any graphic on the system. You can even easily theme .artwork files without having to hack their contents. Instructions on how this works will be posted soon on the More Information page.
 Name: WinterBoard
 Provides: theme-manager
+Conflicts: com.modmyifone.winterboardicon
+Replaces: com.modmyifone.winterboardicon
 Author: Jay Freeman (saurik) <saurik@saurik.com>
 Homepage: http://cydia.saurik.com/winterboard.html
index 66ba1fc42b60f9f4bb31a5529d49ad057d7526a3..4310cb7e9b707374bc294f384bc098f722cf3d97 100644 (file)
--- a/makefile
+++ b/makefile
@@ -23,6 +23,6 @@ package:
        cp -a Nature winterboard/Library/Themes/com.saurik.WinterBoard.Nature
        cp -a control preinst postinst prerm winterboard/DEBIAN
        cp -a Test.sh icon.png WinterBoard.dylib WinterBoard Info.plist ../pledit/pledit winterboard/Applications/WinterBoard.app
-       dpkg-deb -b winterboard winterboard_0.9.2500-1_iphoneos-arm.deb
+       dpkg-deb -b winterboard winterboard_0.9.2501-2_iphoneos-arm.deb
 
 .PHONY: all clean package