Permalink
Browse files

Merge branch 'lion' of https://github.com/itfrombit/nu into lion

  • Loading branch information...
2 parents 9adda50 + 27d5038 commit 955551d78d4cd7aec8ed9a5156914f4566d0981d @timburks committed Jun 19, 2011
Showing with 24 additions and 5 deletions.
  1. +1 −1 examples/NuAnywhere/NuConsole/Nukefile
  2. +3 −1 examples/NuAnywhere/NuInject/Nukefile
  3. +2 −2 nu/console.nu
  4. +18 −1 objc/NuHandler.m
View
2 examples/NuAnywhere/NuConsole/Nukefile
@@ -8,7 +8,7 @@
(set @cflags " -g -fobjc-gc")
-(if (isSnowLeopard)
+(if (or (isSnowLeopard) (isLion))
(then
(set @ldflags " -framework Cocoa -framework Nu -framework Carbon -framework mach_inject_bundle -all_load ")
(set @arch '("x86_64")))
View
4 examples/NuAnywhere/NuInject/Nukefile
@@ -9,7 +9,9 @@
(then
;; Make sure you download and build the mach_inject_bundle first
;; Get it at git://github.com/rentzsch/mach_star.git
- (set @cflags "-isysroot /Developer/SDKs/MacOSX10.6.sdk ")
+ (if (isSnowLeopard)
+ (then (set @cflags "-isysroot /Developer/SDKs/MacOSX10.6.sdk "))
+ (else (set @cflags "-isysroot /Developer/SDKs/MacOSX10.7.sdk ")))
(set @ldflags " -framework Cocoa -framework Nu -framework Carbon -framework mach_inject_bundle")
(set @arch '("x86_64")))
(else
View
4 nu/console.nu
@@ -110,7 +110,7 @@
styleMask:(+ NSTitledWindowMask NSClosableWindowMask NSMiniaturizableWindowMask NSResizableWindowMask NSUtilityWindowMask)
backing:NSBackingStoreBuffered
defer:NO))
- (set @console ((NuConsoleViewController alloc) initWithFrame: (list 0 0 (- (third ((self window) frame)) 17) (fourth ((self window) frame)))))
+ (set @console ((NuConsoleViewController alloc) initWithFrame: (list 0 0 (- (((self window) frame) objectAtIndex:2) 17) (((self window) frame) objectAtIndex:3))))
(self setMyShowConsole:NO)
(self addMenuItem)
(set @exitWhenClosed NO)
@@ -371,7 +371,7 @@
(- (NSRange) textView:(id) textview
willChangeSelectionFromCharacterRange:(NSRange) oldRange
toCharacterRange:(NSRange) newRange is
- (if (and (eq (second newRange) 0)
+ (if (and (eq (newRange second) 0)
(< (first newRange) @startOfInput))
(then oldRange)
(else newRange)))
View
19 objc/NuHandler.m
@@ -70,6 +70,23 @@ static id collect_arguments(struct handler_description *description, va_list ap)
CGRect x = va_arg(ap, CGRect);
[cursor setCar:get_nu_value_from_objc_value(&x, type)];
}
+#else
+ else if (!strcmp(type, "{_NSRect={_NSPoint=dd}{_NSSize=dd}}")) {
+ NSRect x = va_arg(ap, NSRect);
+ [cursor setCar:get_nu_value_from_objc_value(&x, type)];
+ }
+ else if (!strcmp(type, "{_NSPoint=dd}")) {
+ NSPoint x = va_arg(ap, NSPoint);
+ [cursor setCar:get_nu_value_from_objc_value(&x, type)];
+ }
+ else if (!strcmp(type, "{_NSSize=dd}")) {
+ NSSize x = va_arg(ap, NSSize);
+ [cursor setCar:get_nu_value_from_objc_value(&x, type)];
+ }
+ else if (!strcmp(type, "{_NSRange=QQ}")) {
+ NSRange x = va_arg(ap, NSRange);
+ [cursor setCar:get_nu_value_from_objc_value(&x, type)];
+ }
#endif
else {
NSLog(@"unsupported argument type %s, see objc/handler.m to add support for it", type);
@@ -141,7 +158,7 @@ static IMP handler_returning_void(void *userdata) {
#define MAKE_HANDLER_WITH_TYPE(type) \
static IMP handler_returning_ ## type (void* userdata) \
{ \
-return imp_implementationWithBlock(^(id receiver, ...) { \
+return imp_implementationWithBlock(^(id receiver, ...) { \
struct handler_description description; \
description.handler = NULL; \
description.description = userdata; \

0 comments on commit 955551d

Please sign in to comment.