diff options
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/devdraw/macargv.m | 34 | ||||
-rw-r--r-- | src/cmd/devdraw/mkfile | 20 | ||||
-rw-r--r-- | src/cmd/devdraw/mkwsysrules.sh | 4 |
3 files changed, 44 insertions, 14 deletions
diff --git a/src/cmd/devdraw/macargv.m b/src/cmd/devdraw/macargv.m new file mode 100644 index 00000000..cf3e2282 --- /dev/null +++ b/src/cmd/devdraw/macargv.m @@ -0,0 +1,34 @@ +#import <Cocoa/Cocoa.h> + +#include <u.h> +#include <libc.h> + +AUTOFRAMEWORK(Cocoa) + +@interface appdelegate : NSObject @end + +void +main(void) +{ + if(OSX_VERSION < 100700) + [NSAutoreleasePool new]; + + [NSApplication sharedApplication]; + [NSApp setDelegate:[appdelegate new]]; + [NSApp run]; +} + +@implementation appdelegate +- (void)application:(id)arg openFiles:(NSArray*)file +{ + int i,n; + NSString *s; + + n = [file count]; + for(i=0; i<n; i++){ + s = [file objectAtIndex:i]; + print("%s\n", [s UTF8String]); + } + [NSApp terminate:self]; +} +@end diff --git a/src/cmd/devdraw/mkfile b/src/cmd/devdraw/mkfile index 1e7ac0bf..1194c79a 100644 --- a/src/cmd/devdraw/mkfile +++ b/src/cmd/devdraw/mkfile @@ -32,24 +32,20 @@ latin1.$O: latin1.h latin1.h: $PLAN9/lib/keyboard $O.mklatinkbd ./$O.mklatinkbd -r $PLAN9/lib/keyboard | sed 's/, }/ }/' >$target -CLEANFILES=latin1.h $O.mklatinkbd - -# Still in progress: Cocoa/Objective C version of devdraw +$O.macargv: $MACARGV + $LD -o $target $prereq %-objc.$O: %.m $CC $CFLAGS -o $target $stem.m -cocoa: devdraw.o latin1.o mouseswap.o winsize.o osx-draw.o cocoa-screen-objc.o cocoa-srv.o cocoa-thread.o - $LD -o $target $prereq +CLEANFILES=$O.macargv $O.mklatinkbd latin1.h +# old attempt devdraw-cocoa: devdraw.o latin1.o mouseswap.o winsize.o osx-screen-objc.o osx-draw.o osx-srv-objc.o osx-delegate-objc.o $LD -o $target $prereq -install-macargv: $O.macargv - install $O.macargv $PLAN9/bin/macargv - -$O.macargv: macargv.$O - $LD -o $target $prereq - -install: $MACARGV install: mklatinkbd.install +install:Q: + if [ $MACARGV ]; then + mk $MKFLAGS macargv.install + fi diff --git a/src/cmd/devdraw/mkwsysrules.sh b/src/cmd/devdraw/mkwsysrules.sh index 0554ff84..dde44c81 100644 --- a/src/cmd/devdraw/mkwsysrules.sh +++ b/src/cmd/devdraw/mkwsysrules.sh @@ -57,10 +57,10 @@ elif [ $WSYSTYPE = osx ]; then echo 'LDFLAGS=$LDFLAGS -F/System/Library/PrivateFrameworks' fi echo 'WSYSOFILES=$WSYSOFILES osx-screen-carbon-objc.o osx-draw.o osx-srv.o' - echo 'MACARGV=install-macargv' + echo 'MACARGV=macargv.o' elif [ $WSYSTYPE = osx-cocoa ]; then echo 'WSYSOFILES=$WSYSOFILES osx-draw.o cocoa-screen-objc.o cocoa-srv.o cocoa-thread.o' - echo 'MACARGV=install-macargv' + echo 'MACARGV=macargv-objc.o' elif [ $WSYSTYPE = nowsys ]; then echo 'WSYSOFILES=nowsys.o' fi |