Skip to content

Commit

Permalink
Merge branch 'lion' of https://github.com/itfrombit/nu into lion
Browse files Browse the repository at this point in the history
  • Loading branch information
timburks committed Jun 19, 2011
2 parents 9adda50 + 27d5038 commit 955551d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/NuAnywhere/NuConsole/Nukefile
Expand Up @@ -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")))
Expand Down
4 changes: 3 additions & 1 deletion examples/NuAnywhere/NuInject/Nukefile
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions nu/console.nu
Expand Up @@ -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)
Expand Down Expand Up @@ -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)))
Expand Down
19 changes: 18 additions & 1 deletion objc/NuHandler.m
Expand Up @@ -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);
Expand Down Expand Up @@ -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; \
Expand Down

0 comments on commit 955551d

Please sign in to comment.