public
Description: A popular sample Cocoa application rewritten in Nu. Original code by Aaron Hillegass, ported to Nu by Tim Burks.
Homepage: http://programming.nu/posts/2007/12/12/nupagepacker
Clone URL: git://github.com/timburks/nupagepacker.git
nupagepacker / nu / bridged.nu
100644 24 lines (23 sloc) 1.486 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
;; @file bridged.nu
;; @discussion Declarations of bridged constants and functions.
;;
;; @copyright Copyright (c) 2007 Tim Burks, Neon Design Technology, Inc.
 
(if nil ;; don't load BridgeSupport files, all the constants that we need are defined below.  
    ;; Switch on OS release.
    ;;(>= 9 ((((NSString stringWithShellCommand:"uname -r") componentsSeparatedByString:".") objectAtIndex:0) intValue))
    (then ;; Use Leopard BridgeSupport files
          (load "bridgesupport")
          (import AppKit)
          (import Quartz))
    (else ;; declare constants manually
          (global kPDFDisplaySinglePage 0)
          (global NSDragOperationCopy 1)
          (global NSPDFPboardType "Apple PDF pasteboard type")
          (global NSDragPboard "Apple CFPasteboard drag")
          (global NSRectClip (NuBridgedFunction functionWithName:"NSRectClip" signature:"v{_NSRect}"))
          (global NSIntersectionRect (NuBridgedFunction functionWithName:"NSIntersectionRect" signature:"{_NSRect}{_NSRect}{_NSRect}"))
          (global NSPointInRect (NuBridgedFunction functionWithName:"NSPointInRect" signature:"i{_NSPoint}{_NSRect}"))
          (global NSFilenamesPboardType "NSFilenamesPboardType")
          (global NSIntersectsRect (NuBridgedFunction functionWithName:"NSIntersectsRect" signature:"i{_NSRect}{_NSRect}"))
          (global NSInsetRect (NuBridgedFunction functionWithName:"NSInsetRect" signature:"{_NSRect}{_NSRect}ff"))
          (global NSSquareLineCapStyle 2)))