#include <UIKit/UIKit.h>
#include <objc/objc.h>
+#include <objc/runtime.h>
#include <sstream>
#include <ext/stdio_filebuf.h>
@end
/* }}} */
-#ifdef SRK_ASPEN
-#define UITable UITableView
+/* iPhoneOS 2.0 Compatibility {{{ */
+#ifdef __OBJC2__
+@interface UICGColor : NSObject {
+}
+
+- (id) initWithCGColor:(CGColorRef)color;
+@end
+
+@interface UIFont {
+}
+
+- (UIFont *) fontWithSize:(CGFloat)size;
+@end
+
+@interface NSObject (iPhoneOS)
+- (CGColorRef) cgColor;
+- (void) set;
+@end
+
+@implementation NSObject (iPhoneOS)
+
+- (CGColorRef) cgColor {
+ return (CGColorRef) self;
+}
+
+- (void) set {
+ [[[[objc_getClass("UICGColor") alloc] initWithCGColor:[self cgColor]] autorelease] set];
+}
+
+@end
+
+@interface UITextView (iPhoneOS)
+- (void) setTextSize:(float)size;
+@end
+
+@implementation UITextView (iPhoneOS)
+
+- (void) setTextSize:(float)size {
+ [self setFont:[[self font] fontWithSize:size]];
+}
+
+@end
#endif
+/* }}} */
OBJC_EXPORT const char *class_getName(Class cls);
UITextView *text([[[UITextView alloc] initWithFrame:CGRectMake(left, 3, 310 - left, 1000)] autorelease]);
[text setEditable:NO];
[text setTextSize:16];
- if (html)
+ /*if (html)
[text setHTML:value];
- else
+ else*/
[text setText:value];
[text setEnabled:NO];
- (void) packageTable:(id)table packageSelected:(Package *)package {
if (package == nil) {
+#ifndef __OBJC2__
[navbar_ setAccessoryView:accessory_ animate:(resetting_ ? NO : YES) goingBack:YES];
+#else
+ [navbar_ setAccessoryView:accessory_ animate:YES removeOnPop:NO];
+#endif
[package_ release];
package_ = nil;
[view_ release];
view_ = nil;
} else {
+#ifndef __OBJC2__
[navbar_ setAccessoryView:nil animate:YES goingBack:NO];
+#else
+ [navbar_ setAccessoryView:nil animate:YES removeOnPop:YES];
+#endif
_assert(package_ == nil);
_assert(view_ == nil);
[field_ setPaddingTop:5];
[field_ setDelegate:self];
+#ifndef __OBJC2__
UITextTraits *traits = [field_ textTraits];
[traits setEditingDelegate:self];
[traits setReturnKeyType:6];
+#endif
accessory_ = [[UIView alloc] initWithFrame:CGRectMake(6, 6, area.size.width, area.size.height + 30)];
[accessory_ addSubview:field_];
$(target)g++ -Wall -Werror -o $@ $< -framework Foundation -framework CoreFoundation -lobjc
Cydia: Cydia.mm *.h makefile
- $(target)g++ -fobjc-call-cxx-cdtors -g3 -O2 -Wall -Werror -o $@ $< -framework UIKit -framework IOKit -framework Foundation -framework CoreFoundation -framework CoreGraphics -framework GraphicsServices -lobjc -lapt-pkg -lpcre -fobjc-exceptions
+ $(target)g++ -fobjc-call-cxx-cdtors -g3 -O2 -Wall -Werror -o $@ $< -framework UIKit -framework IOKit -framework CoreFoundation -framework Foundation -framework CoreGraphics -framework GraphicsServices -lobjc -lapt-pkg -lpcre -fobjc-exceptions -I/apl/i20 -F$${PKG_ROOT}/System/Library/PrivateFrameworks
.PHONY: all clean test