Skip to content

Commit

Permalink
xcodebuild fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcool420 committed Feb 6, 2011
1 parent 7e95211 commit 857c109
Show file tree
Hide file tree
Showing 23 changed files with 611 additions and 657 deletions.
Binary file modified Documentation/SMFramework.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion Makefile
@@ -1,4 +1,5 @@
GO_EASY_ON_ME=1
SDKVERSION=4.1
FW_DEVICE_IP=appletv.local
first: clean package install
include $(THEOS)/makefiles/common.mk
Expand All @@ -15,7 +16,7 @@ SMFramework_INSTALL_PATH = /Library/Frameworks
#SMFramework_BUNDLE_EXTENSION = framework
SMFramework_LDFLAGS = -undefined dynamic_lookup -framework UIKit -framework ImageIO#-L$(FW_PROJECT_DIR) -lBackRow
SMFramework_CFLAGS = -I../ATV2Includes
SUBPROJECTS = eventcatcher SMFHelper # rootlaunchd smfporttester
SUBPROJECTS = eventcatcher SMFHelper



Expand Down
5 changes: 3 additions & 2 deletions SMFClockController.h
Expand Up @@ -15,13 +15,14 @@
NSDictionary *textAttributes;
NSTimeZone *timeZone;
NSLocale *_currentlocale;
UIColor *color;
id color;
}
-(void)timerRun;
-(NSLocale *)currentlocale;
-(void)setCurrentlocale:(NSLocale *)l;
-(void)setTimeZone:(NSTimeZone*)tz;
-(NSTimeZone *)timeZone;
-(void)setColor:(UIColor *)c;

-(void)setColor:(id)c;
@property (retain) NSDictionary *textAttributes;
@end
53 changes: 27 additions & 26 deletions SMFCommonTools.m
Expand Up @@ -11,30 +11,30 @@
#import "SynthesizeSingleton.h"
#import <CoreGraphics/CoreGraphics.h>
static void daemonRunCode(int type, NSString *codeString){

CFMessagePortRef daemonPort = 0;
NSMutableDictionary *d = [[NSMutableDictionary alloc]init];
NSMutableArray *array = [[NSMutableArray alloc] init];

[d setObject:codeString forKey:@"command"];
CFDataRef data= CFPropertyListCreateData (
NULL,
(CFDictionaryRef)d,
kCFPropertyListXMLFormat_v1_0,
0,
NULL);
NSLog(@"sending info");
if (!daemonPort || !CFMessagePortIsValid(daemonPort)) {
NSLog(@"searching for port");
daemonPort = CFMessagePortCreateRemote(NULL, CFSTR("org.tomcool.lowtide.daemon"));
}
if (!daemonPort) return;
NSLog(@"found port");
// create and send message
CFMessagePortSendRequest(daemonPort, type, data, 1, 1, NULL, NULL);
if (data) {
CFRelease(data);
}
//
// CFMessagePortRef daemonPort = 0;
// NSMutableDictionary *d = [[NSMutableDictionary alloc]init];
//
// [d setObject:codeString forKey:@"command"];
// CFDataRef data= CFPropertyListCreateData (
// NULL,
// (CFDictionaryRef)d,
// kCFPropertyListXMLFormat_v1_0,
// 0,
// NULL);
// NSLog(@"sending info");
// if (!daemonPort || !CFMessagePortIsValid(daemonPort)) {
// NSLog(@"searching for port");
// daemonPort = CFMessagePortCreateRemote(NULL, CFSTR("org.tomcool.lowtide.daemon"));
// }
// if (!daemonPort) return;
// NSLog(@"found port");
// // create and send message
// CFMessagePortSendRequest(daemonPort, type, data, 1, 1, NULL, NULL);
// CFMessagePor
// if (data) {
// CFRelease(data);
// }
}

@implementation SMFCommonTools
Expand All @@ -46,9 +46,10 @@ -(void)test
}
+(id)popupControlWithLines:(NSArray *)array andImage:(BRImage *)image
{
id ctrl =[[NSClassFromString(@"SMFPopupInfo") alloc] init];

if (image==nil)
return nil;
id ctrl =[[NSClassFromString(@"SMFPopupInfo") alloc] init];
NSDictionary *dict;
if (array==nil) {
dict = [NSDictionary dictionaryWithObjectsAndKeys:
Expand Down Expand Up @@ -85,7 +86,7 @@ +(void)showPopup:(id)popup withTimeout:(int)timeout withPosition:(PopupPosition)
timeout=8;
id manager = [BRPopUpManager sharedInstance];
if (manager==nil) {
[BRPopUpManager setSingleton:[[BRPopUpManager alloc]init]];
[BRPopUpManager setSingleton:[[[BRPopUpManager alloc]init]autorelease]];
}
[[BRPopUpManager sharedInstance] postPopUpWithControl:popup
identifier:@"SMFPopup"
Expand Down
2 changes: 1 addition & 1 deletion SMFEventConfiguration.m
Expand Up @@ -57,7 +57,7 @@ -(void)itemSelected:(long)selected
[k setPrimaryText:[_options objectAtIndex:selected]];
[k setEvent:[_options objectAtIndex:selected]];
[k setSecondaryText:@"Please press a key"];
[[self stack] pushController:k];
[[self stack] pushController:[k autorelease]];
}
@end
@implementation SMFKeySelectMenu
Expand Down
4 changes: 2 additions & 2 deletions SMFEventManager.m
Expand Up @@ -50,11 +50,11 @@ -(void)registerListener:(id<SMFEventDelegate>)listener forNames:(NSArray*)names

-(void)loadInformation
{
_remoteActionKeys=[(NSDictionary *) CFPreferencesCopyAppValue(remoteActionDict, eventsPlist)mutableCopy];
_remoteActionKeys=[ [ (NSDictionary *) CFPreferencesCopyAppValue(remoteActionDict, eventsPlist) autorelease]mutableCopy];
if (_remoteActionKeys==nil) {
_remoteActionKeys=[[NSMutableDictionary alloc]init];
}
_keys=[(NSDictionary *) CFPreferencesCopyAppValue(keyDict, eventsPlist)mutableCopy];
_keys=[[[(NSDictionary *)CFPreferencesCopyAppValue(keyDict, eventsPlist) autorelease] mutableCopy] autorelease];
if (_keys==nil) {
_keys=[[NSMutableDictionary alloc]init];
}
Expand Down
5 changes: 3 additions & 2 deletions SMFInvocationCenteredMenuController.m
Expand Up @@ -22,6 +22,7 @@ -(id)initWithTitles:(NSArray *)titles withInvocations:(NSArray *)invocations wit

[a setText:[titles objectAtIndex:i] withAttributes:[[BRThemeInfo sharedTheme]menuItemTextAttributes]];
[_items addObject:a];
[a release];
[_options addObject:[invocations objectAtIndex:i]];
}
return self;
Expand All @@ -32,11 +33,11 @@ -(void)itemSelected:(long)arg1
[(NSInvocation *)[_options objectAtIndex:arg1]invoke];
[[self stack]popController];
}
+(id)invocationsForObject:(id)target withSelectorVal:(NSString *)selectorString withArguments:(NSArray *)arguments
+(NSInvocation *)invocationsForObject:(id)target withSelectorVal:(NSString *)selectorString withArguments:(NSArray *)arguments
{

if (selectorString==nil) {
return @"none";
return [[[NSInvocation alloc] init] autorelease];
}
SEL theSelector;
NSMethodSignature *aSignature;
Expand Down
12 changes: 6 additions & 6 deletions SMFMenuController.h
Expand Up @@ -8,18 +8,18 @@
#import <Backrow/Backrow.h>
#import <Foundation/Foundation.h>
#import "SMFDefines.h"
@interface SMFMenuController : BRMenuController {
@interface SMFMenuController : BRMenuController <BRMenuListItemProvider> {
// int padding[32];
NSMutableArray *_items;
NSMutableArray *_options;
}

-(float)heightForRow:(long)row;
-(BOOL)rowSelectable:(long)row;
-(long)itemCount;
-(id)itemForRow:(long)row;
//-(float)heightForRow:(long)row;
//-(BOOL)rowSelectable:(long)row;
//-(long)itemCount;
//-(id)itemForRow:(long)row;
-(long)rowForTitle:(id)title;
-(id)titleForRow:(long)row;
//-(id)titleForRow:(long)row;
-(int)getSelection;
-(id)everyLoad;

Expand Down
1 change: 1 addition & 0 deletions SMFPasscodeController.m
Expand Up @@ -181,6 +181,7 @@ - (void) textDidEndEditing: (id) sender
if (key && domain) {
SMFPreferences *p = [[SMFPreferences alloc] initWithPersistentDomainName:domain];
[p setObject:[NSNumber numberWithInt:[[sender stringValue] intValue]] forKey:key];
[p release];
}
[[self stack] popController];
}
Expand Down
47 changes: 27 additions & 20 deletions SMFScreenCapture.m
Expand Up @@ -64,67 +64,74 @@ -(void)actionForEvent:(SMFEvent *)event
+(void)saveScreenToFile:(NSString *)path
{
CGSize screenSize = [BRWindow maxBounds];
CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
CGContextRef ctx = CGBitmapContextCreate(nil, screenSize.width, screenSize.height, 8, 4*(int)screenSize.width, colorSpaceRef, kCGImageAlphaPremultipliedLast);
CALayer *c = [[[[BRApplicationStackManager singleton] stack] peekController] layer];
CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();
CGContextRef ctx = CGBitmapContextCreate(nil, screenSize.width, screenSize.height, 8, 4*(int)screenSize.width, rgb, kCGImageAlphaPremultipliedLast);
CALayer *c = [[[[BRApplicationStackManager singleton] stack] peekController] layer];

CGColorRef col = CGColorCreate(rgb, (CGFloat[]){ 0, 0, 0, 1 });
c.backgroundColor=col;
[c renderInContext:ctx];

CGImageRef cgImage = CGBitmapContextCreateImage(ctx);
c.backgroundColor=nil;
UIImage *img2 = [UIImage imageWithCGImage:cgImage];
[UIImagePNGRepresentation(img2) writeToFile:path atomically:YES];
NSData *d = UIImagePNGRepresentation(img2);
[d writeToFile:path atomically:YES];
[d release];
CGImageRelease(cgImage);
CGColorRelease(col);
CGContextRelease(ctx);
CGColorSpaceRelease(rgb);

}
+(NSData *)pngScreenData
{

CGSize screenSize = [BRWindow maxBounds];
CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
CGContextRef ctx = CGBitmapContextCreate(nil, screenSize.width, screenSize.height, 8, 4*(int)screenSize.width, colorSpaceRef, kCGImageAlphaPremultipliedLast);
CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();
CGContextRef ctx = CGBitmapContextCreate(nil, screenSize.width, screenSize.height, 8, 4*(int)screenSize.width, rgb, kCGImageAlphaPremultipliedLast);
//CGContextTranslateCTM(ctx, 0.0, screenSize.height);
//CGContextScaleCTM(ctx, 1.0, -1.0);
CALayer *c = [[[[BRApplicationStackManager singleton] stack] peekController] layer];
CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();

CGColorRef col = CGColorCreate(rgb, (CGFloat[]){ 0, 0, 0, 1 });
c.backgroundColor=col;
[c renderInContext:ctx];

CGColorRelease(col);
CGColorSpaceRelease(rgb);
CGContextRelease(ctx);
CGImageRef cgImage = CGBitmapContextCreateImage(ctx);
c.backgroundColor=nil;

//CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("/var/mobile/Library/Preferences/image.bmp"), kCFURLPOSIXPathStyle, false);
//CFStringRef type = kUTTypeBMP; // or kUTTypeBMP if you like
// CGImageDestinationRef dest = CGImageDestinationCreateWithURL(url, type, 1, 0);
// CGImageDestinationAddImage(dest, cgImage, 0);

UIImage *img2 = [UIImage imageWithCGImage:cgImage];
CGImageRelease(cgImage);
//[UIImageJPEGRepresentation(img2,10.0) writeToFile:@"/var/mobile/Library/Preferences/image2.jpg" atomically:YES];
return UIImagePNGRepresentation(img2);
return [UIImagePNGRepresentation(img2) autorelease];
}
+(NSData *)controlPlaneData
{
CGSize screenSize = [BRWindow maxBounds];
CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
CGContextRef ctx = CGBitmapContextCreate(nil, screenSize.width, screenSize.height, 8, 4*(int)screenSize.width, colorSpaceRef, kCGImageAlphaPremultipliedLast);
CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();
CGContextRef ctx = CGBitmapContextCreate(nil, screenSize.width, screenSize.height, 8, 4*(int)screenSize.width, rgb, kCGImageAlphaPremultipliedLast);
//CGContextTranslateCTM(ctx, 0.0, screenSize.height);
//CGContextScaleCTM(ctx, 1.0, -1.0);
CALayer *c = [[[BRWindow window] _controlPlane] layer];//[[[[BRApplicationStackManager singleton] stack] peekController] layer];
CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();
CGColorRef col = CGColorCreate(rgb, (CGFloat[]){ 0, 0, 0, 1 });
c.backgroundColor=col;
[c renderInContext:ctx];

CGImageRef cgImage = CGBitmapContextCreateImage(ctx);
c.backgroundColor=nil;

CGColorRelease(col);
CGColorSpaceRelease(rgb);
CGContextRelease(ctx);
//CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("/var/mobile/Library/Preferences/image.bmp"), kCFURLPOSIXPathStyle, false);
//CFStringRef type = kUTTypeBMP; // or kUTTypeBMP if you like
// CGImageDestinationRef dest = CGImageDestinationCreateWithURL(url, type, 1, 0);
// CGImageDestinationAddImage(dest, cgImage, 0);
UIImage *img2 = [UIImage imageWithCGImage:cgImage];
//[UIImageJPEGRepresentation(img2,10.0) writeToFile:@"/var/mobile/Library/Preferences/image2.jpg" atomically:YES];
return UIImagePNGRepresentation(img2);
CGImageRelease(cgImage);

return [UIImagePNGRepresentation(img2) autorelease];
}
@end
4 changes: 2 additions & 2 deletions SMFViewMenuController.m
Expand Up @@ -14,7 +14,7 @@ @implementation SMFViewMenuController
+(SMFViewMenuController *)menuViewController
{
SMFViewMenuController *vc = [[SMFViewMenuController alloc] init];
SMFPhotoMethods *col = [SMFPhotoMethods photoCollectionForPath:@"/var/root/pieter"];
//SMFPhotoMethods *col = [SMFPhotoMethods photoCollectionForPath:@"/var/root/pieter"];
// BRMenuView *v = [[NSClassFromString(@"BRMarimbaMenuView") alloc] initWithMediaCollection:col];
BRMenuView *v = [[BRMenuView alloc]init];
vc.view = v;
Expand Down Expand Up @@ -73,7 +73,7 @@ - (void)list:(id)list willDisplayItemAtIndexPath:(id)indexPath{

} // 0x3166c4e1
- (id)list:(id)list willFocusItemAtIndexPath:(id)indexPath{

return nil;
} // 0x3166c4e5
- (void)list:(id)list willUnFocusItemAtIndexPath:(id)indexPath{

Expand Down
2 changes: 1 addition & 1 deletion SMFramework.h
Expand Up @@ -25,7 +25,7 @@
#import "SMFCenteredMenuController.h"
#import "SMFMediaPreview.h"
#import "SMFBaseAsset.h"
#import "SMFController.h"
//#import "SMFController.h"
#import "SMFFolderBrowser.h"
#import "SMFPasscodeController.h"
#import "SMFMenuItem.h"
Expand Down

0 comments on commit 857c109

Please sign in to comment.