├── .gitignore ├── project ├── build.properties └── plugins.sbt ├── docs ├── _layouts │ ├── none.html │ ├── page_print.html │ ├── default_print.html │ ├── post.html │ ├── page.html │ └── default.html ├── _data │ ├── terms.yml │ ├── definitions.yml │ ├── glossary.yml │ ├── strings.yml │ ├── tags.yml │ ├── alerts.yml │ ├── topnav.yml │ └── samplelist.yml ├── _includes │ ├── inline_image.html │ ├── callout.html │ ├── note.html │ ├── tip.html │ ├── important.html │ ├── warning.html │ ├── archive.html │ ├── image.html │ ├── footer.html │ ├── feedback.html │ ├── toc.html │ ├── disqus.html │ ├── taglogic.html │ ├── links.html │ ├── head_print.html │ ├── head.html │ ├── sidebar.html │ └── initialize_shuffle.html ├── css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── boxshadowproperties.css │ ├── modern-business.css │ ├── theme-green.css │ ├── theme-blue.css │ ├── printstyles.css │ └── syntax.css ├── Gemfile ├── runJekyll.sh ├── pages │ └── sncocoa │ │ ├── guide │ │ ├── snc_collections.md │ │ ├── snc_create_binding.md │ │ ├── snc_basic_interop.md │ │ └── snc_memory_management.md │ │ └── overview │ │ ├── snc_sbt_settings.md │ │ └── snc_get_started.md ├── js │ ├── jquery.ba-throttle-debounce.min.js │ ├── customscripts.js │ ├── toc.js │ └── jquery.navgoco.min.js └── _config.yml ├── foundation └── src │ ├── main │ └── scala │ │ └── cocoa │ │ └── foundation │ │ ├── Protocol.scala │ │ ├── NSMutableCopying.scala │ │ ├── NSFileSecurity.scala │ │ ├── NSSecureCoding.scala │ │ ├── NSCopying.scala │ │ ├── NSDiscardableContent.scala │ │ ├── convert │ │ ├── Decorators.scala │ │ ├── WrapAsScala.scala │ │ ├── DecorateAsScala.scala │ │ └── Wrappers.scala │ │ ├── NSPurgeableData.scala │ │ ├── NSCoding.scala │ │ ├── NSConverters.scala_ │ │ ├── NSEnumerator.scala │ │ ├── NSURLQueryItem.scala │ │ ├── NSMethodSignature.scala_ │ │ ├── NSProxy.scala_ │ │ ├── NSMutableIndexSet.scala │ │ ├── NSNotification.scala │ │ ├── NSValue.scala │ │ ├── NSInvocation.scala_ │ │ ├── NSNotificationCenter.scala │ │ ├── Macros.scala │ │ ├── NSMutableString.scala │ │ ├── NSMutableData.scala │ │ ├── NSError.scala │ │ ├── Foundation.scala │ │ ├── decorators.scala_ │ │ ├── NSDate.scala_ │ │ ├── NSLocale.scala │ │ ├── NSTimeZone.scala_ │ │ ├── NSMutableCharacterSet.scala │ │ ├── NSCharacterSet.scala │ │ ├── NSIndexSet.scala │ │ ├── NSURLComponents.scala │ │ ├── NSMutableArray.scala_ │ │ ├── NSMutableDictionary.scala │ │ └── NSNumber.scala │ └── test │ └── scala │ └── cocoa │ └── foundation │ └── test │ ├── NSDataTest.scala │ ├── NSErrorTest.scala │ ├── NSURLTest.scala │ ├── NSMutableDataTest.scala │ ├── NSCharacterSetTest.scala │ ├── NSURLComponentsTest.scala │ ├── NSMutableCharacterSetTest.scala │ ├── NSValueTest.scala │ ├── NSMutableStringTest.scala │ ├── NSObjectTest.scala │ ├── NSNumberTest.scala │ ├── NSStringTest.scala │ ├── NSMutableArrayTest.scala │ ├── NSDictionaryTest.scala │ └── NSArrayTest.scala ├── appkit └── src │ └── main │ └── scala │ └── cocoa │ └── appkit │ ├── NSTableCellView.scala_ │ ├── NSComboBoxDelegate.scala_ │ ├── NSComboBoxDataSource.scala_ │ ├── NSImageDelegate.scala │ ├── NSTextDelegate.scala │ ├── NSTextFieldDelegate.scala │ ├── NSController.scala │ ├── NSControlTextEditingDelegate.scala │ ├── AppKit.scala │ ├── NSLevelIndicator.scala_ │ ├── NSTableViewDataSource.scala_ │ ├── NSDatePicker.scala_ │ ├── NSObjectController.scala │ ├── NSTableColumn.scala_ │ ├── NSTableRowView.scala_ │ ├── NSComboBox.scala_ │ ├── NSTextViewDelegate.scala_ │ ├── NSArrayController.scala │ ├── NSTableViewDelegate.scala_ │ ├── NSImageRep.scala │ ├── NSAlert.scala │ ├── NSApplicationDelegate.scala │ └── NSTextField.scala ├── uikit └── src │ └── main │ └── scala │ └── cocoa │ └── uikit │ └── UIKit.scala ├── coredata └── src │ └── main │ └── scala │ └── cocoa │ └── coredata │ ├── NSManagedObjectID.scala │ ├── package.scala │ ├── NSManagedObjectModel.scala │ ├── NSPersistentContainer.scala │ ├── NSEntityDescription.scala │ └── NSManagedObject.scala ├── README.md ├── LICENSE └── test └── src ├── main └── scala │ └── Main.scala └── test └── scala └── objc └── test └── ScalaObjCTest.scala /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .idea/ 3 | _site/ 4 | -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.16 2 | -------------------------------------------------------------------------------- /docs/_layouts/none.html: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | {{content}} -------------------------------------------------------------------------------- /docs/_data/terms.yml: -------------------------------------------------------------------------------- 1 | apple: "apple - the fruit of a disiduous tree." -------------------------------------------------------------------------------- /docs/_data/definitions.yml: -------------------------------------------------------------------------------- 1 | #elephant: "This is a sample definition." 2 | 3 | -------------------------------------------------------------------------------- /docs/_includes/inline_image.html: -------------------------------------------------------------------------------- 1 | {{include.alt}} 2 | -------------------------------------------------------------------------------- /docs/css/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jokade/scalanative-cocoa/HEAD/docs/css/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /docs/_includes/callout.html: -------------------------------------------------------------------------------- 1 |
{{include.content}}
2 | -------------------------------------------------------------------------------- /docs/_data/glossary.yml: -------------------------------------------------------------------------------- 1 | #jekyll_platform: "Jekyll is a static site generator that builds sites using most modern web technologies." 2 | -------------------------------------------------------------------------------- /docs/css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jokade/scalanative-cocoa/HEAD/docs/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jokade/scalanative-cocoa/HEAD/docs/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jokade/scalanative-cocoa/HEAD/docs/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/css/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jokade/scalanative-cocoa/HEAD/docs/css/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'github-pages', group: :jekyll_plugins 4 | gem 'wdm', '>= 0.1.0' if Gem.win_platform? 5 | -------------------------------------------------------------------------------- /docs/_data/strings.yml: -------------------------------------------------------------------------------- 1 | 2 | 3 | # placed here for translation purposes 4 | search_placeholder_text: search... 5 | search_no_results_text: No results found. 6 | -------------------------------------------------------------------------------- /docs/_includes/note.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/_includes/tip.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_includes/important.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/runJekyll.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # see http://idratherbewriting.com/documentation-theme-jekyll/index.html for more information 3 | bundle exec jekyll serve 4 | 5 | -------------------------------------------------------------------------------- /docs/_includes/warning.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.8") 2 | 3 | addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1") 4 | 5 | addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") 6 | -------------------------------------------------------------------------------- /docs/pages/sncocoa/guide/snc_collections.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Collections 3 | keywords: 4 | summary: 5 | sidebar: sncocoa_sidebar 6 | permalink: snc_collections.html 7 | folder: sncocoa 8 | --- 9 | TBD 10 | 11 | {% include links.html %} 12 | -------------------------------------------------------------------------------- /docs/_includes/archive.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | type: archive 4 | --- 5 | 6 |
7 |

{{ page.title }}

8 |
9 |
10 | 11 | {{ content }} 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/Protocol.scala: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.foundation 3 | 4 | import scalanative.native._ 5 | import objc._ 6 | 7 | @ObjC 8 | class Protocol extends NSObject 9 | -------------------------------------------------------------------------------- /docs/pages/sncocoa/guide/snc_create_binding.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Creating Objective-C Bindings 3 | keywords: 4 | summary: 5 | sidebar: sncocoa_sidebar 6 | permalink: snc_create_binding.html 7 | folder: sncocoa 8 | --- 9 | 10 | TBD 11 | 12 | ### Mapping Selectors 13 | 14 | {% include links.html %} -------------------------------------------------------------------------------- /appkit/src/main/scala/cocoa/appkit/NSTableCellView.scala_: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.appkit 3 | 4 | import scalanative.native._ 5 | 6 | @ObjC 7 | class NSTableCellView extends NSView { 8 | def textField: NSTextField = extern 9 | } 10 | -------------------------------------------------------------------------------- /foundation/src/test/scala/cocoa/foundation/test/NSDataTest.scala: -------------------------------------------------------------------------------- 1 | package cocoa.foundation.test 2 | 3 | import utest._ 4 | import cocoa.foundation.NSData 5 | 6 | object NSDataTest extends TestSuite { 7 | val tests = Tests { 8 | /* 9 | 'class - { 10 | assert(NSData.className == "NSData") 11 | } 12 | */ 13 | } 14 | } -------------------------------------------------------------------------------- /foundation/src/test/scala/cocoa/foundation/test/NSErrorTest.scala: -------------------------------------------------------------------------------- 1 | package cocoa.foundation.test 2 | 3 | import utest._ 4 | import cocoa.foundation.NSError 5 | 6 | object NSErrorTest extends TestSuite { 7 | val tests = Tests { 8 | /* 9 | 'class - { 10 | assert(NSError.className == "NSError") 11 | } 12 | */ 13 | } 14 | } -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/NSMutableCopying.scala: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.foundation 3 | 4 | import scalanative.native._ 5 | import objc._ 6 | 7 | @ObjC 8 | trait NSMutableCopying { 9 | @inline def mutableCopyWithZone_(zone: NSZone): id = extern 10 | } 11 | 12 | -------------------------------------------------------------------------------- /foundation/src/test/scala/cocoa/foundation/test/NSURLTest.scala: -------------------------------------------------------------------------------- 1 | package cocoa.foundation.test 2 | 3 | import utest._ 4 | import cocoa.foundation._ 5 | 6 | object NSURLTest extends TestSuite { 7 | val tests = Tests { 8 | /* 9 | 'class - { 10 | assert(NSURL.className == "NSURL") 11 | 'URLWithString-{ 12 | } 13 | } 14 | */ 15 | } 16 | } -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/NSFileSecurity.scala: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.foundation 3 | 4 | import scala.language.experimental.macros 5 | import scalanative.native._ 6 | import objc._ 7 | 8 | @ObjC 9 | class NSFileSecurity extends NSObject with NSCopying with NSCoding { 10 | } 11 | -------------------------------------------------------------------------------- /foundation/src/test/scala/cocoa/foundation/test/NSMutableDataTest.scala: -------------------------------------------------------------------------------- 1 | package cocoa.foundation.test 2 | 3 | import utest._ 4 | import cocoa.foundation.NSMutableData 5 | 6 | object NSMutableDataTest extends TestSuite { 7 | val tests = Tests { 8 | /* 9 | 'class - { 10 | assert(NSMutableData.className == "NSMutableData") 11 | } 12 | */ 13 | } 14 | } -------------------------------------------------------------------------------- /foundation/src/test/scala/cocoa/foundation/test/NSCharacterSetTest.scala: -------------------------------------------------------------------------------- 1 | package cocoa.foundation.test 2 | 3 | import utest._ 4 | import cocoa.foundation.NSCharacterSet 5 | 6 | object NSCharacterSetTest extends TestSuite { 7 | val tests = Tests { 8 | /* 9 | 'class - { 10 | assert(NSCharacterSet.className == "NSCharacterSet") 11 | } 12 | */ 13 | } 14 | } -------------------------------------------------------------------------------- /foundation/src/test/scala/cocoa/foundation/test/NSURLComponentsTest.scala: -------------------------------------------------------------------------------- 1 | package cocoa.foundation.test 2 | 3 | import utest._ 4 | import cocoa.foundation.NSURLComponents 5 | 6 | object NSURLComponentsTest extends TestSuite { 7 | val tests = Tests { 8 | /* 9 | 'class - { 10 | assert(NSURLComponents.className == "NSURLComponents") 11 | } 12 | */ 13 | } 14 | } -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/NSSecureCoding.scala: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.foundation 3 | 4 | import scalanative.native._ 5 | import objc._ 6 | 7 | @ObjC 8 | trait NSSecureCoding extends NSCoding { 9 | } 10 | 11 | object NSSecureCoding { 12 | @inline def supportsSecureCoding(): BOOL = extern 13 | } 14 | 15 | -------------------------------------------------------------------------------- /docs/_includes/image.html: -------------------------------------------------------------------------------- 1 |
{% if {{include.url}} %}{% endif %}{{include.alt}}{% if {{include.url}} %}{% endif %}{% if {{include.caption}} %}
{{include.caption}}
{% endif %}
2 | -------------------------------------------------------------------------------- /docs/_layouts/page_print.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default_print 3 | comments: true 4 | --- 5 |
6 |

{{ page.title }}

7 |
8 | 9 |
10 | 11 | {% if page.summary %} 12 |
{{page.summary}}
13 | {% endif %} 14 | {{ content }} 15 |
16 | -------------------------------------------------------------------------------- /foundation/src/test/scala/cocoa/foundation/test/NSMutableCharacterSetTest.scala: -------------------------------------------------------------------------------- 1 | package cocoa.foundation.test 2 | 3 | import utest._ 4 | import cocoa.foundation.NSMutableCharacterSet 5 | 6 | object NSMutableCharacterSetTest extends TestSuite { 7 | val tests = Tests { 8 | /* 9 | 'class - { 10 | assert(NSMutableCharacterSet.className == "NSMutableCharacterSet") 11 | } 12 | */ 13 | } 14 | } -------------------------------------------------------------------------------- /docs/_data/tags.yml: -------------------------------------------------------------------------------- 1 | # Note: 2 | # If you are using the createtag script, don't leave an blank line at the end of this file. 3 | # In other words, the last line must be the last tag in the allowed-tags list. 4 | allowed-tags: 5 | - getting_started 6 | - content_types 7 | - navigation 8 | - formatting 9 | - publishing 10 | - single_sourcing 11 | - special_layouts 12 | - collaboration 13 | - news 14 | - troubleshooting 15 | - mobile 16 | -------------------------------------------------------------------------------- /foundation/src/test/scala/cocoa/foundation/test/NSValueTest.scala: -------------------------------------------------------------------------------- 1 | // Project: scalanative-cocoa 2 | // Module: 3 | // Description: 4 | package cocoa.foundation.test 5 | 6 | import utest._ 7 | import cocoa.foundation.NSValue 8 | import scalanative.native._ 9 | 10 | object NSValueTest extends TestSuite { 11 | val tests = Tests { 12 | /* 13 | 'class-{ 14 | assert( NSValue.className == "NSValue" ) 15 | } 16 | */ 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/NSCopying.scala: -------------------------------------------------------------------------------- 1 | // Project: scalanative-cocoa 2 | // Module: Foundation 3 | // Description: Generated with scala-obj-bindgen (with manual postprocessing) from: 4 | // objc/objc.h, objc/NSObject.h, objc/Protocol.h, Foundation/NSObject.h 5 | package cocoa.foundation 6 | 7 | import scalanative.native._ 8 | import objc._ 9 | 10 | @ObjC 11 | trait NSCopying { 12 | @inline def copyWithZone_(zone: NSZone): id = extern 13 | } 14 | 15 | -------------------------------------------------------------------------------- /foundation/src/test/scala/cocoa/foundation/test/NSMutableStringTest.scala: -------------------------------------------------------------------------------- 1 | // Project: scalanative-cocoa 2 | // Module: 3 | // Description: 4 | package cocoa.foundation.test 5 | 6 | import utest._ 7 | import scalanative.native._ 8 | import cocoa.foundation.NSMutableString 9 | 10 | object NSMutableStringTest extends TestSuite { 11 | val tests = Tests{ 12 | /* 13 | 'class-{ 14 | assert( NSMutableString.className == "NSMutableString" ) 15 | } 16 | */ 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/NSDiscardableContent.scala: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.foundation 3 | 4 | import scalanative.native._ 5 | import objc._ 6 | 7 | @ObjC 8 | trait NSDiscardableContent { 9 | @inline def beginContentAccess(): BOOL = extern 10 | @inline def endContentAccess(): Unit = extern 11 | @inline def discardContentIfPossible(): Unit = extern 12 | @inline def isContentDiscarded(): BOOL = extern 13 | } 14 | -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/convert/Decorators.scala: -------------------------------------------------------------------------------- 1 | // Project: scalanative-cocoa 2 | // Module: Foundation / Scala converters 3 | // Description: 4 | // Copyright (c) 2017. Distributed under the MIT License (see included LICENSE file). 5 | package cocoa.foundation.convert 6 | 7 | private[convert] trait Decorators { 8 | 9 | class AsScala[T](op: =>T) { 10 | /** Converts a Foundation collection to the corresponding Scala collection */ 11 | def asScala: T = op 12 | } 13 | } 14 | 15 | private[convert] object Decorators extends Decorators 16 | -------------------------------------------------------------------------------- /docs/_includes/footer.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /docs/_layouts/default_print.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% include head_print.html %} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 | {{content}} 18 |
19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/NSPurgeableData.scala: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.foundation 3 | 4 | import scala.language.experimental.macros 5 | import scalanative.native._ 6 | import objc._ 7 | 8 | @ObjC 9 | class NSPurgeableData extends NSMutableData with NSDiscardableContent { 10 | } 11 | 12 | @ObjCClass 13 | abstract class NSPurgeableDataClass extends NSObjectClass { 14 | } 15 | 16 | object NSPurgeableData extends NSPurgeableDataClass { 17 | override type InstanceType = NSPurgeableData 18 | } -------------------------------------------------------------------------------- /foundation/src/test/scala/cocoa/foundation/test/NSObjectTest.scala: -------------------------------------------------------------------------------- 1 | // Project: scalanative-cocoa 2 | // Module: 3 | // Description: 4 | package cocoa.foundation.test 5 | 6 | import cocoa.foundation.NSObject 7 | import utest._ 8 | 9 | object NSObjectTest extends TestSuite { 10 | val tests = Tests { 11 | /* 12 | 'class-{ 13 | assert( "NSObject" == NSObject.className ) 14 | assert( NSObject.version == 0 ) 15 | } 16 | 'alloc-{ 17 | val o = NSObject.alloc() 18 | assert( "NSObject" == o.className ) 19 | true 20 | } 21 | */ 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs/css/boxshadowproperties.css: -------------------------------------------------------------------------------- 1 | /* box-shadow fonts return errors with prince, so extracting here to put in web output only */ 2 | 3 | #search-demo-container ul#results-container { 4 | box-shadow: 2px 3px 2px #dedede; 5 | } 6 | 7 | 8 | hr.shaded { 9 | box-shadow: inset 0 6px 6px -6px rgba(0,0,0,0.5); 10 | } 11 | 12 | .videoThumbs img { 13 | box-shadow: 2px 2px 1px #f0f0f0; 14 | } 15 | 16 | .box { 17 | box-shadow: 2px 2px 4px #dedede; 18 | } 19 | 20 | @media (max-width: 1200px) { 21 | 22 | .navbar-collapse { 23 | box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); 24 | } 25 | -------------------------------------------------------------------------------- /foundation/src/test/scala/cocoa/foundation/test/NSNumberTest.scala: -------------------------------------------------------------------------------- 1 | // Project: scalanative-cocoa 2 | // Module: 3 | // Description: 4 | package cocoa.foundation.test 5 | 6 | import utest._ 7 | import cocoa.foundation.NSNumber 8 | 9 | object NSNumberTest extends TestSuite { 10 | val tests = Tests { 11 | /* 12 | 'class-{ 13 | assert( NSNumber.className == "NSNumber" ) 14 | 'apply-{ 15 | assert( NSNumber(42).intValue() == 42 ) 16 | // TODO: fails 17 | // assert( NSNumber(42.0).doubleValue() == 42.0 ) 18 | } 19 | } 20 | */ 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/NSCoding.scala: -------------------------------------------------------------------------------- 1 | // Project: scalanative-cocoa 2 | // Module: Foundation 3 | // Description: Generated with scala-obj-bindgen (with manual postprocessing) from: 4 | // objc/objc.h, objc/NSObject.h, objc/Protocol.h, Foundation/NSObject.h 5 | package cocoa.foundation 6 | 7 | import scalanative.native._ 8 | import objc._ 9 | 10 | import scala.scalanative.native.extern 11 | 12 | @ObjC 13 | trait NSCoding { 14 | @inline def encodeWithCoder_(aCoder: NSCoder): Unit = extern 15 | @inline def initWithCoder_(aDecoder: NSCoder): this.type = extern 16 | } 17 | -------------------------------------------------------------------------------- /uikit/src/main/scala/cocoa/uikit/UIKit.scala: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.uikit 3 | 4 | import scalanative.native._ 5 | import cocoa.foundation.{BOOL, NSString} 6 | 7 | @extern 8 | object UIKit { 9 | 10 | // def UIInterfaceOrientationIsPortrait(orientation: UIInterfaceOrientation): BOOL = extern 11 | // def UIInterfaceOrientationIsLandscape(orientation: UIInterfaceOrientation): BOOL = extern 12 | def UIApplicationMain(argc: CInt, argv: Ptr[CString], principalClassName: NSString, delegateClassName: NSString): CInt = extern 13 | } 14 | -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/convert/WrapAsScala.scala: -------------------------------------------------------------------------------- 1 | // Project: scalanative-cocoa 2 | // Module: 3 | // Description: 4 | // Copyright (c) 2017. Distributed under the MIT License (see included LICENSE file). 5 | package cocoa.foundation.convert 6 | 7 | import cocoa.foundation.{NSArray, NSDictionary, NSObject} 8 | import Wrappers._ 9 | 10 | object WrapAsScala { 11 | implicit def nsArrayAsScalaSeq[T<:NSObject](ns: NSArray[T]): Seq[T] = NSArrayWrapper(ns) 12 | implicit def nsDictionaryAsScalaMap[K<:NSObject, V<:NSObject](ns: NSDictionary[K,V]): Map[K,V] = 13 | NSDictionaryWrapper(ns) 14 | } 15 | -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/NSConverters.scala_: -------------------------------------------------------------------------------- 1 | // Project: scalanative-cocoa 2 | // Module: Foundation / Scala converters 3 | // Description: Decorators that allow converting between Scala and Foundation collections 4 | // Copyright (c) 2017. Distributed under the MIT License (see included LICENSE file). 5 | package cocoa.foundation 6 | 7 | import cocoa.foundation.convert.Wrappers 8 | 9 | /** 10 | * A collection of decorators that allow converting between Scala and Cocoa Foundation collections 11 | * using `asScala` and `asNS` methods. 12 | */ 13 | object NSConverters extends convert.DecorateAsScala 14 | -------------------------------------------------------------------------------- /coredata/src/main/scala/cocoa/coredata/NSManagedObjectID.scala: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.coredata 3 | 4 | import cocoa.foundation.{BOOL, NSCopying, NSObject, NSURL} 5 | 6 | import scala.language.experimental.macros 7 | import scalanative.native._ 8 | import objc._ 9 | 10 | @ObjC 11 | class NSManagedObjectID extends NSObject with NSCopying { 12 | @inline def URIRepresentation(): NSURL = extern 13 | // @inline def entity(): NSEntityDescription = extern 14 | // @inline def persistentStore(): NSPersistentStore = extern 15 | @inline def isTemporaryID(): BOOL = extern 16 | } 17 | -------------------------------------------------------------------------------- /docs/_includes/feedback.html: -------------------------------------------------------------------------------- 1 |
  • 2 | {% if site.feedback_text %} 3 | {% assign feedback_text = site.feedback_text %} 4 | {% else %} 5 | {% assign feedback_text = "Feedback" %} 6 | {% endif %} 7 | 8 | {% if site.feedback_link %} 9 | {{feedback_text}} 10 | {% else %} 11 | {{feedback_text}} 12 | {% endif %} 13 |
  • 14 | -------------------------------------------------------------------------------- /appkit/src/main/scala/cocoa/appkit/NSComboBoxDelegate.scala_: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.appkit 3 | 4 | import cocoa.foundation.NSNotification 5 | 6 | import scalanative.native._ 7 | 8 | /* 9 | @ObjC 10 | trait NSComboBoxDelegate extends NSTextFieldDelegate { 11 | @inline def comboBoxWillPopUp(notification: NSNotification): Unit = extern 12 | @inline def comboBoxWillDismiss(notification: NSNotification): Unit = extern 13 | @inline def comboBoxSelectionDidChange(notification: NSNotification): Unit = extern 14 | @inline def comboBoxSelectionIsChanging(notification: NSNotification): Unit = extern 15 | } 16 | */ 17 | -------------------------------------------------------------------------------- /appkit/src/main/scala/cocoa/appkit/NSComboBoxDataSource.scala_: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.appkit 3 | 4 | import cocoa.foundation.{NSInteger, NSObject, NSString, NSUInteger, id} 5 | 6 | import scalanative.native._ 7 | 8 | 9 | @ObjC 10 | trait NSComboBoxDataSource extends NSObject { 11 | @inline def numberOfItemsInComboBox(aComboBox: NSComboBox): NSInteger = extern 12 | @inline def comboBox(aComboBox: NSComboBox, index: NSInteger): id = extern 13 | @inline def comboBox(aComboBox: NSComboBox, string: NSString): NSUInteger = extern 14 | // @inline def comboBox(aComboBox: NSComboBox, string: NSString): NSString = extern 15 | } 16 | -------------------------------------------------------------------------------- /appkit/src/main/scala/cocoa/appkit/NSImageDelegate.scala: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.appkit 3 | 4 | import scala.language.experimental.macros 5 | import scalanative.native._ 6 | import objc._ 7 | import cocoa.foundation._ 8 | 9 | 10 | @ObjC 11 | trait NSImageDelegate extends NSObject { 12 | @inline def imageDidNotDraw_rect_(sender: NSImage, rect: NSRect): NSImage = extern 13 | @inline def image_rep_(image: NSImage, rep: NSImageRep): Unit = extern 14 | @inline def image_rep_rows_(image: NSImage, rep: NSImageRep, rows: NSInteger): Unit = extern 15 | @inline def image_rep_status_(image: NSImage, rep: NSImageRep, status: NSImageLoadStatus): Unit = extern 16 | } -------------------------------------------------------------------------------- /appkit/src/main/scala/cocoa/appkit/NSTextDelegate.scala: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.appkit 3 | 4 | import scalanative.native._ 5 | import objc._ 6 | import cocoa.foundation.{BOOL, NSNotification, NSObject} 7 | 8 | 9 | @ObjC 10 | trait NSTextDelegate extends NSObject { 11 | @inline def textShouldBeginEditing_(textObject: NSText): BOOL = extern 12 | @inline def textShouldEndEditing_(textObject: NSText): BOOL = extern 13 | @inline def textDidBeginEditing_(notification: NSNotification): Unit = extern 14 | @inline def textDidEndEditing_(notification: NSNotification): Unit = extern 15 | @inline def textDidChange_(notification: NSNotification): Unit = extern 16 | } 17 | 18 | -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/convert/DecorateAsScala.scala: -------------------------------------------------------------------------------- 1 | // Project: scalanative-cocoa 2 | // Module: Foundation / Scala converters 3 | // Description: 4 | // Copyright (c) 2017. Distributed under the MIT License (see included LICENSE file). 5 | package cocoa.foundation.convert 6 | 7 | import cocoa.foundation.{NSArray, NSDictionary, NSObject} 8 | import Decorators._ 9 | import WrapAsScala._ 10 | 11 | trait DecorateAsScala { 12 | 13 | implicit def nsArrayAsScalaConverter[T<:NSObject](ns: NSArray[T]): AsScala[Seq[T]] = 14 | new AsScala(nsArrayAsScalaSeq(ns)) 15 | 16 | implicit def nsDictionaryAsScalaConverter[K<:NSObject, V<:NSObject](ns: NSDictionary[K,V]): AsScala[Map[K,V]] = 17 | new AsScala(nsDictionaryAsScalaMap(ns)) 18 | } 19 | -------------------------------------------------------------------------------- /foundation/src/test/scala/cocoa/foundation/test/NSStringTest.scala: -------------------------------------------------------------------------------- 1 | // Project: scalanative-cocoa 2 | // Module: 3 | // Description: 4 | package cocoa.foundation.test 5 | 6 | import cocoa.foundation.NSString 7 | import cocoa.foundation.NSQuote 8 | import scalanative.native._ 9 | import utest._ 10 | 11 | object NSStringTest extends TestSuite { 12 | val tests = Tests { 13 | /* 14 | 'class-{ 15 | assert( NSString.className == "NSString" ) 16 | } 17 | 'string-{ 18 | assert( NSString.string().length().toInt == 0 ) 19 | } 20 | 'implicit-{ 21 | assert( fromCString(ns"hello".UTF8String()) == "hello" ) 22 | } 23 | 'RichNSString-{ 24 | assert( ns"hello".string == "hello" ) 25 | } 26 | 27 | */ 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /docs/js/jquery.ba-throttle-debounce.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery throttle / debounce - v1.1 - 3/7/2010 3 | * http://benalman.com/projects/jquery-throttle-debounce-plugin/ 4 | * 5 | * Copyright (c) 2010 "Cowboy" Ben Alman 6 | * Dual licensed under the MIT and GPL licenses. 7 | * http://benalman.com/about/license/ 8 | */ 9 | (function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this); -------------------------------------------------------------------------------- /docs/_includes/toc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 |
    22 | -------------------------------------------------------------------------------- /docs/pages/sncocoa/overview/snc_sbt_settings.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: sbt Settings 3 | keywords: 4 | summary: 5 | sidebar: sncocoa_sidebar 6 | permalink: snc_sbt_settings.html 7 | folder: sncocoa 8 | --- 9 | 10 | Add this to your `build.sbt`: 11 | ```scala 12 | libraryDependencies += "de.surfice" %%% "scalanative-cocoa-foundation" % "0.0.1-SNAPSHOT" 13 | 14 | addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full) 15 | 16 | resolvers += Resolver.sonatypeRepo("snapshots") 17 | ``` 18 | 19 | Replace `scalanative-cocoa-foundation` with `scalanative-cocoa-appkit` if you want to use AppKit. However, it's probably best to start with the template in that case (see below). 20 | 21 | SNCocoa requires scala-native 0.3.2. 22 | {% include links.html %} 23 | -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/NSEnumerator.scala: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 - 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.foundation 3 | 4 | import cocoa.foundation.NSFastEnumeration.NSFastEnumerationState 5 | 6 | import scala.language.experimental.macros 7 | import scalanative.native._ 8 | import objc._ 9 | 10 | @ObjC 11 | trait NSFastEnumeration { 12 | @inline def countByEnumeratingWithState_buffer_len_(state: NSFastEnumerationState, buffer: id, len: NSUInteger): NSUInteger = extern 13 | } 14 | 15 | object NSFastEnumeration { 16 | type NSFastEnumerationState = Ptr[Byte] 17 | } 18 | 19 | @ObjC 20 | abstract class NSEnumerator[T<:NSObject] extends NSObject with NSFastEnumeration { 21 | @inline def nextObject(): T = extern 22 | @inline def allObjects(): NSArray[T] = extern 23 | } 24 | -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/NSURLQueryItem.scala: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.foundation 3 | 4 | import scala.language.experimental.macros 5 | import scalanative.native._ 6 | import objc._ 7 | 8 | @ObjC 9 | class NSURLQueryItem extends NSObject with NSSecureCoding with NSCopying { 10 | @inline def initWithName_value_(name: NSString, value: NSString): NSURLQueryItem = extern 11 | @inline def name(): NSString = extern 12 | @inline def value(): NSString = extern 13 | } 14 | 15 | 16 | @ObjCClass 17 | abstract class NSURLQueryItemClass extends NSObjectClass { 18 | @inline def queryItemWithName(name: NSString, value: NSString): NSURLQueryItem = extern 19 | } 20 | 21 | object NSURLQueryItem extends NSURLQueryItemClass { 22 | override type InstanceType = NSURLQueryItem 23 | } -------------------------------------------------------------------------------- /foundation/src/main/scala/cocoa/foundation/NSMethodSignature.scala_: -------------------------------------------------------------------------------- 1 | package cocoa.foundation 2 | 3 | import scalanative.native._ 4 | 5 | import scala.language.experimental.macros 6 | 7 | 8 | @ObjC 9 | class NSMethodSignature extends NSObject { 10 | @inline def getArgumentTypeAtIndex(idx: NSUInteger): Ptr[CSignedChar] = extern 11 | @inline def isOneway(): BOOL = extern 12 | @inline def numberOfArguments(): NSUInteger = extern 13 | @inline def frameLength(): NSUInteger = extern 14 | @inline def methodReturnType(): Ptr[CSignedChar] = extern 15 | @inline def methodReturnLength(): NSUInteger = extern 16 | } 17 | 18 | @ObjCClass 19 | abstract class NSMethodSignatureClass extends { 20 | def __cls: id 21 | @inline def signatureWithObjCTypes(types: Ptr[CSignedChar]): NSMethodSignature = extern 22 | } 23 | 24 | object NSMethodSignature extends NSMethodSignatureClass { 25 | } -------------------------------------------------------------------------------- /appkit/src/main/scala/cocoa/appkit/NSTextFieldDelegate.scala: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018. Distributed under the MIT License (see included LICENSE file). 2 | package cocoa.appkit 3 | 4 | import cocoa.foundation.{BOOL, NSUInteger} 5 | 6 | import scala.language.experimental.macros 7 | import scalanative.native._ 8 | import objc._ 9 | 10 | 11 | @ObjC 12 | trait NSTextFieldDelegate extends NSControlTextEditingDelegate { 13 | // @inline def textField_textView_selectedRange_(textField: NSTextField, textView: NSTextView, selectedRange: NSRange): NSArray = extern 14 | // @inline def textField_textView_candidates_selectedRange_(textField: NSTextField, textView: NSTextView, candidates: NSTextCheckingResult, selectedRange: NSRange): NSArray[NSTextCheckingResult] = extern 15 | // @inline def textField_textView_index_(textField: NSTextField, textView: NSTextView, index: NSUInteger): BOOL = extern 16 | } 17 | -------------------------------------------------------------------------------- /foundation/src/test/scala/cocoa/foundation/test/NSMutableArrayTest.scala: -------------------------------------------------------------------------------- 1 | package cocoa.foundation.test 2 | 3 | import utest._ 4 | import cocoa.foundation.{NSMutableArray, NSNumber} 5 | 6 | object NSMutableArrayTest extends TestSuite { 7 | val tests = Tests { 8 | /* 9 | 'class - { 10 | assert(NSMutableArray.className == "NSMutableArray") 11 | 'array-{ 12 | val array = NSMutableArray.array[NSNumber]() 13 | assert( 14 | array.className == "__NSArrayM", 15 | array.count().toInt == 0 ) 16 | } 17 | } 18 | 'instance-{ 19 | 'addObject-{ 20 | val array = NSMutableArray.array[NSNumber]() 21 | assert( array.count().toInt == 0 ) 22 | array.addObject(NSNumber(42)) 23 | assert( 24 | array.count().toInt == 1)//, 25 | // array(0).intValue == 42 ) 26 | } 27 | } 28 | */ 29 | } 30 | } -------------------------------------------------------------------------------- /docs/_data/alerts.yml: -------------------------------------------------------------------------------- 1 | tip: '