From: Jay Freeman (saurik) Date: Wed, 7 May 2014 23:23:01 +0000 (-0700) Subject: Port build environment from tweak.mk to new cycc. X-Git-Tag: v0.9.3400~1 X-Git-Url: https://git.saurik.com/fiveicondock.git/commitdiff_plain/b9539b5b33c7cdf954f57917ea6a5440eb11c027 Port build environment from tweak.mk to new cycc. --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..63dc3ec --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.dylib +*.deb diff --git a/FiveIconDock.mm b/FiveIconDock.mm new file mode 100644 index 0000000..2bce488 --- /dev/null +++ b/FiveIconDock.mm @@ -0,0 +1,144 @@ +#include + +%apt Package: com.saurik.iphone.fid +%apt Author: Jay Freeman (saurik) + +%apt Name: Five Icon Dock +%apt Description: fits even more stuff right down there +%apt Depiction: http://cydia.saurik.com/info/com.saurik.iphone.fid/ +%apt Tag: purpose::extension, role::enduser + +%apt Depends: mobilesubstrate (>= 0.9.3005-1), firmware (>= 2.2), firmware (<< 3.0) | com.chpwn.iconsupport (>= 1.7.3-1) +%apt Conflicts: gsc.wildcat + +%bundle com.apple.springboard + +%flag -framework Foundation + +#import +#import +#import + +#import + +@interface ISIconSupport : NSObject { +} + ++ (ISIconSupport *) sharedInstance; +- (void) addExtension:(NSString *)name; + +@end + +@interface SBDockIconListView : NSObject { +} +- (NSArray *) icons; +@end + +MSClassHook(SBButtonBar) +MSClassHook(SBDockIconListView) +MSClassHook(SBIcon) +MSClassHook(SBIconModel) + +MSMetaClassHook(SBDockIconListView) +MSMetaClassHook(SBIconModel) + +__attribute__((__constructor__)) +static void MSFixClass() { + if ($SBIcon == nil) + $SBIcon = objc_getClass("SBIconView"); +} + +MSInstanceMessageHook1(float, SBButtonBar, leftMarginForIconRowArray, NSArray *, row) { + return [row indexOfObject:[NSNull null]] == NSNotFound ? 4 : MSOldCall(row); +} + +MSInstanceMessageHook0(int, SBButtonBar, maxIconColumns) { + return 5; +} + +MSClassMessageHook1(int, SBDockIconListView, iconColumnsForInterfaceOrientation, int, orientation) { + return 5; +} + +static unsigned $SBButtonBar$count(SBButtonBar *self) { + MSIvarHook(NSArray *, _iconMatrix); + NSArray *row([_iconMatrix objectAtIndex:0]); + unsigned count(0); + for (id icon in row) + if (icon != [NSNull null]) + ++count; + return count; +} + +MSInstanceMessageHook0(float, SBButtonBar, topIconPadding) { + return 313370 + $SBButtonBar$count(self); +} + +MSInstanceMessageHook1(void, SBIcon, setOrigin, CGPoint, origin) { + unsigned count(origin.y); + if (count < 313370) + goto set; + count -= 313370; + + if (count > 40) + origin.x = 256; + else if (count > 10 || count < 0) + goto set; + else if (count == 5) + origin.x = (origin.x - 4) / 76 * 63 + 4; + + origin.y = 11; + set: + MSOldCall(origin); +} + +MSInstanceMessageHook2(CGPoint, SBButtonBar, originForIconAtX,Y, int, x, int, y) { + CGPoint origin;//(MSOldCall(x, y, )); + //NSLog(@"f:%u,%u=(%f,%f)", x, y, origin.x, origin.y); + origin.y = 11; + + unsigned count($SBButtonBar$count(self)), gap; + unsigned space(320 - 60 * count); + + if (count >= 4) + gap = space / (count + 1); + else // I hate people who love Apple. + gap = 16; + + origin.x = (space - gap * (count - 1)) / 2 + (60 + gap) * x; + + return origin; +} + +// XXX: merge with previous function if possible, but not until after iPhone 4 +MSInstanceMessageHook2(CGPoint, SBDockIconListView, originForIconAtX,Y, int, x, int, y) { + CGPoint origin;//(MSOldCall(x, y, )); + //NSLog(@"f:%u,%u=(%f,%f)", x, y, origin.x, origin.y); + origin.y = 11; + + unsigned count([[self icons] count]), gap; + unsigned space(320 - 60 * count); + + if (count >= 4) + gap = space / (count + 1); + else // I hate people who love Apple. + gap = 16; + + origin.x = (space - gap * (count - 1)) / 2 + (60 + gap) * x; + + return origin; +} + +/*MSClassMessageHook0(int, SBIconModel, maxIconListCount) { + return 16; +}*/ + +MSInitialize { + NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]); + + if (dlopen("/Library/MobileSubstrate/DynamicLibraries/IconSupport.dylib", RTLD_GLOBAL | RTLD_LAZY) != NULL) + if (Class $ISIconSupport = objc_getClass("ISIconSupport")) + [[$ISIconSupport sharedInstance] addExtension:@"com.saurik.iphone.fid"]; + + [pool release]; +} diff --git a/Tweak.mm b/Tweak.mm deleted file mode 100644 index 0f83a4c..0000000 --- a/Tweak.mm +++ /dev/null @@ -1,133 +0,0 @@ -#include - -#import -#import -#import - -#import - -#import -#import -#import - -@interface ISIconSupport : NSObject { -} - -+ (ISIconSupport *) sharedInstance; -- (void) addExtension:(NSString *)name; - -@end - -@interface SBDockIconListView : NSObject { -} -- (NSArray *) icons; -@end - -MSClassHook(SBButtonBar) -MSClassHook(SBDockIconListView) -MSClassHook(SBIcon) -MSClassHook(SBIconModel) - -MSMetaClassHook(SBDockIconListView) -MSMetaClassHook(SBIconModel) - -__attribute__((__constructor__)) -static void MSFixClass() { - if ($SBIcon == nil) - $SBIcon = objc_getClass("SBIconView"); -} - -MSInstanceMessageHook1(float, SBButtonBar, leftMarginForIconRowArray, NSArray *, row) { - return [row indexOfObject:[NSNull null]] == NSNotFound ? 4 : MSOldCall(row); -} - -MSInstanceMessageHook0(int, SBButtonBar, maxIconColumns) { - return 5; -} - -MSClassMessageHook1(int, SBDockIconListView, iconColumnsForInterfaceOrientation, int, orientation) { - return 5; -} - -static unsigned $SBButtonBar$count(SBButtonBar *self) { - MSIvarHook(NSArray *, _iconMatrix); - NSArray *row([_iconMatrix objectAtIndex:0]); - unsigned count(0); - for (id icon in row) - if (icon != [NSNull null]) - ++count; - return count; -} - -MSInstanceMessageHook0(float, SBButtonBar, topIconPadding) { - return 313370 + $SBButtonBar$count(self); -} - -MSInstanceMessageHook1(void, SBIcon, setOrigin, CGPoint, origin) { - unsigned count(origin.y); - if (count < 313370) - goto set; - count -= 313370; - - if (count > 40) - origin.x = 256; - else if (count > 10 || count < 0) - goto set; - else if (count == 5) - origin.x = (origin.x - 4) / 76 * 63 + 4; - - origin.y = 11; - set: - MSOldCall(origin); -} - -MSInstanceMessageHook2(CGPoint, SBButtonBar, originForIconAtX,Y, int, x, int, y) { - CGPoint origin;//(MSOldCall(x, y, )); - //NSLog(@"f:%u,%u=(%f,%f)", x, y, origin.x, origin.y); - origin.y = 11; - - unsigned count($SBButtonBar$count(self)), gap; - unsigned space(320 - 60 * count); - - if (count >= 4) - gap = space / (count + 1); - else // I hate people who love Apple. - gap = 16; - - origin.x = (space - gap * (count - 1)) / 2 + (60 + gap) * x; - - return origin; -} - -// XXX: merge with previous function if possible, but not until after iPhone 4 -MSInstanceMessageHook2(CGPoint, SBDockIconListView, originForIconAtX,Y, int, x, int, y) { - CGPoint origin;//(MSOldCall(x, y, )); - //NSLog(@"f:%u,%u=(%f,%f)", x, y, origin.x, origin.y); - origin.y = 11; - - unsigned count([[self icons] count]), gap; - unsigned space(320 - 60 * count); - - if (count >= 4) - gap = space / (count + 1); - else // I hate people who love Apple. - gap = 16; - - origin.x = (space - gap * (count - 1)) / 2 + (60 + gap) * x; - - return origin; -} - -/*MSClassMessageHook0(int, SBIconModel, maxIconListCount) { - return 16; -}*/ - -MSInitialize { - NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]); - - if (dlopen("/Library/MobileSubstrate/DynamicLibraries/IconSupport.dylib", RTLD_GLOBAL | RTLD_LAZY) != NULL) - if (Class $ISIconSupport = objc_getClass("ISIconSupport")) - [[$ISIconSupport sharedInstance] addExtension:@"com.saurik.iphone.fid"]; - - [pool release]; -} diff --git a/Tweak.plist b/Tweak.plist deleted file mode 100644 index f94fd41..0000000 --- a/Tweak.plist +++ /dev/null @@ -1 +0,0 @@ -Filter = {Bundles = ("com.apple.springboard");}; diff --git a/control b/control deleted file mode 100644 index 1b19917..0000000 --- a/control +++ /dev/null @@ -1,12 +0,0 @@ -Package: com.saurik.iphone.fid -Priority: optional -Section: Tweaks -Maintainer: Jay Freeman (saurik) -Architecture: iphoneos-arm -Version: 0.9.3381-1 -Description: fits even more stuff right down there -Name: Five Icon Dock -Depends: mobilesubstrate (>= 0.9.3005-1), firmware (>= 2.2), firmware (<< 3.0) | com.chpwn.iconsupport (>= 1.7.3-1) -Conflicts: gsc.wildcat -Author: Jay Freeman (saurik) -Depiction: http://cydia.saurik.com/info/com.saurik.iphone.fid/ diff --git a/make.sh b/make.sh index 2d9cc22..c39f5dc 100755 --- a/make.sh +++ b/make.sh @@ -1,7 +1,2 @@ #!/bin/bash -set -e -export PKG_ARCH=${PKG_ARCH-iphoneos-arm} -PATH=/apl/n42/pre/bin:$PATH /apl/tel/exec.sh com.saurik.winterboard make "$@" -export CODESIGN_ALLOCATE=$(which arm-apple-darwin9-codesign_allocate) -/apl/tel/util/ldid -S *.dylib -make package +exec cycc -i2.0 -s -p FiveIconDock.mm diff --git a/makefile b/makefile deleted file mode 100644 index 43dade7..0000000 --- a/makefile +++ /dev/null @@ -1,2 +0,0 @@ -name := FiveIconDock -include ../tweak.mk