0
|
1 /** ===========================================================================
|
|
2 ** R-Package: cocoa
|
|
3 ** File: coca/src/package.m
|
|
4 ** Description: R package registry and initialization of NSAutoreleasePool
|
|
5 **
|
|
6 ** Copyright (C) 2009 Daniel Adler
|
|
7 **/
|
|
8 #include <Rinternals.h>
|
|
9 #include <R_ext/Rdynload.h>
|
|
10 #include <stdio.h>
|
|
11 #import <Foundation/NSAutoreleasePool.h>
|
|
12 #import <AppKit/NSApplication.h>
|
|
13 NSAutoreleasePool* pool;
|
|
14
|
|
15 void R_init_cocoa(DllInfo* info)
|
|
16 {
|
|
17 [[NSAutoreleasePool alloc] init];
|
|
18 NSApplicationLoad();
|
|
19 // [NSApplication sharedApplication];
|
|
20 // [NSApp run];
|
|
21 printf("init\n");
|
|
22
|
|
23 }
|
|
24
|
|
25 void R_unload_cocoa(DllInfo* info)
|
|
26 {
|
|
27 [pool drain];
|
|
28 }
|
|
29
|