Comparing version 2.0.0 to 2.1.0
@@ -0,1 +1,80 @@ | ||
// // This example adapted from Matt Gallagher's "Minimalist Cocoa Programming" | ||
// // blog article: | ||
// // http://cocoawithlove.com/2010/09/minimalist-cocoa-programming.html | ||
// var $ = require('../../../../') | ||
// var EventLoop = require('../../../EventLoop') | ||
// EventLoop.initObjC($) | ||
// | ||
// $.import('Cocoa') | ||
// | ||
// var pool = $.NSAutoreleasePool('alloc')('init') | ||
// , app = $.NSApplication('sharedApplication') | ||
// , evtLoop = new EventLoop() | ||
// | ||
// app('setActivationPolicy', $.NSApplicationActivationPolicyRegular) | ||
// | ||
// var menuBar = $.NSMenu('alloc')('init') | ||
// , appMenuItem = $.NSMenuItem('alloc')('init') | ||
// | ||
// menuBar('addItem', appMenuItem) | ||
// app('setMainMenu', menuBar) | ||
// | ||
// var appMenu = $.NSMenu('alloc')('init') | ||
// , appName = $('Hello NodeJS!') | ||
// , quitTitle = $('Quit "' + appName + '"') | ||
// , quitMenuItem = $.NSMenuItem('alloc')('initWithTitle', quitTitle | ||
// ,'action', 'terminate:' | ||
// ,'keyEquivalent', $('q')) | ||
// appMenu('addItem', quitMenuItem) | ||
// appMenuItem('setSubmenu', appMenu) | ||
// | ||
// var styleMask = $.NSTitledWindowMask | ||
// | $.NSResizableWindowMask | ||
// | $.NSClosableWindowMask | ||
// var window = $.NSWindow('alloc')('initWithContentRect', $.NSMakeRect(0,0,200,200) | ||
// ,'styleMask', styleMask | ||
// ,'backing', $.NSBackingStoreBuffered | ||
// ,'defer', false) | ||
// window('setAlphaValue', 0) | ||
// window('cascadeTopLeftFromPoint', $.NSMakePoint(20,20)) | ||
// window('setTitle', appName) | ||
// window('makeKeyAndOrderFront', window) | ||
// window('center') | ||
// window('setBackgroundColor', $.NSColor('greenColor')) | ||
// window('animator')('setAlphaValue',1) | ||
// | ||
// | ||
// | ||
// | ||
// var textV = $.NSTextView('alloc')('initWithFrame', $.NSMakeRect(0,100,100,100)); | ||
// textV('setAutoresizingMask', $.NSViewWidthSizable | $.NSViewMinYMargin) | ||
// window('contentView')('addSubview', textV) | ||
// | ||
// // AppDelegate.addMethod('textDidChange:', 'v@:@', function (self, _cmd, notif) { | ||
// // $.playTrumpet() | ||
// // }) | ||
// | ||
// | ||
// // set up the app delegate | ||
// var AppDelegate = $.NSObject.extend('AppDelegate') | ||
// AppDelegate.addMethod('applicationDidFinishLaunching:', 'v@:@', function (self, _cmd, notif) { | ||
// console.log('got applicationDidFinishLauching') | ||
// console.log(notif) | ||
// }) | ||
// AppDelegate.addMethod('applicationWillTerminate:', 'v@:@', function (self, _cmd, notif) { | ||
// console.log('got applicationWillTerminate') | ||
// console.log(notif) | ||
// }) | ||
// AppDelegate.register() | ||
// | ||
// var delegate = AppDelegate('alloc')('init') | ||
// app('setDelegate', delegate) | ||
// | ||
// app('activateIgnoringOtherApps', true) | ||
// app('finishLaunching') | ||
// | ||
// evtLoop.start() | ||
// This example adapted from Matt Gallagher's "Minimalist Cocoa Programming" | ||
@@ -5,15 +84,19 @@ // blog article: | ||
var $ = require('../../../../') | ||
var EventLoop = require('../../../EventLoop') | ||
EventLoop.initObjC($) | ||
$.import('Cocoa') | ||
$.framework('Cocoa') | ||
// $.framework('AtoZ') | ||
// $.import('AppKit') | ||
// $.import('AtoZ') | ||
var pool = $.NSAutoreleasePool('alloc')('init') | ||
, app = $.NSApplication('sharedApplication') | ||
, evtLoop = new EventLoop() | ||
var pool = $.NSAutoreleasePool('alloc')('init'), | ||
app = $.NSApplication('sharedApplication') | ||
// atoz = $.AtoZ | ||
// var z = atoz.methods() | ||
// $.NSLog(atoz('class')('globalPalette')('stringValue')) | ||
app('setActivationPolicy', $.NSApplicationActivationPolicyRegular) | ||
var menuBar = $.NSMenu('alloc')('init') | ||
, appMenuItem = $.NSMenuItem('alloc')('init') | ||
var menuBar = $.NSMenu('new'), | ||
appMenuItem = $.NSMenuItem('new') | ||
@@ -23,18 +106,17 @@ menuBar('addItem', appMenuItem) | ||
var appMenu = $.NSMenu('alloc')('init') | ||
, appName = $('Hello NodeJS!') | ||
, quitTitle = $('Quit "' + appName + '"') | ||
, quitMenuItem = $.NSMenuItem('alloc')('initWithTitle', quitTitle | ||
,'action', 'terminate:' | ||
,'keyEquivalent', $('q')) | ||
appMenu('addItem', quitMenuItem) | ||
appMenuItem('setSubmenu', appMenu) | ||
var appMenu = $.NSMenu('new'), | ||
appName = $('Hello NodeJS!'), | ||
quitTitle = $('Quit "' + appName + '"'), | ||
quitMenuItem = $.NSMenuItem('alloc')('initWithTitle', quitTitle, 'action', 'terminate:', 'keyEquivalent', $('q')), | ||
AppDelegate = $.NSObject.extend('AppDelegate') // set up the app delegate | ||
var styleMask = $.NSTitledWindowMask | ||
| $.NSResizableWindowMask | ||
| $.NSClosableWindowMask | ||
var window = $.NSWindow('alloc')('initWithContentRect', $.NSMakeRect(0,0,200,200) | ||
,'styleMask', styleMask | ||
,'backing', $.NSBackingStoreBuffered | ||
,'defer', false) | ||
appMenu('addItem', quitMenuItem) | ||
appMenuItem('setSubmenu', appMenu) | ||
var styleMask = $.NSTitledWindowMask | $.NSResizableWindowMask | $.NSClosableWindowMask | ||
var window = $.NSWindow('alloc')('initWithContentRect', $.NSMakeRect(0,0,200,200), | ||
'styleMask', styleMask, | ||
'backing', $.NSBackingStoreBuffered, | ||
'defer', false) | ||
window('setAlphaValue', 0) | ||
window('cascadeTopLeftFromPoint', $.NSMakePoint(20,20)) | ||
@@ -44,8 +126,17 @@ window('setTitle', appName) | ||
window('center') | ||
window('setBackgroundColor', $.NSColor('greenColor')) | ||
window('animator')('setAlphaValue',1) | ||
// set up the app delegate | ||
var AppDelegate = $.NSObject.extend('AppDelegate') | ||
var textV = $.NSTextView('alloc')('initWithFrame', $.NSMakeRect(0,100,100,100)); | ||
textV('setAutoresizingMask', $.NSViewWidthSizable | $.NSViewMinYMargin) | ||
window('contentView')('addSubview', textV) | ||
AppDelegate.addMethod('textDidChange:', 'v@:@', function (self, _cmd, notif) { | ||
$.playTrumpet() | ||
}) | ||
AppDelegate.addMethod('applicationDidFinishLaunching:', 'v@:@', function (self, _cmd, notif) { | ||
console.log('got applicationDidFinishLauching') | ||
console.log(notif) | ||
// console.log('got applicationDidFinishLauching') | ||
// console.log(notif) | ||
}) | ||
@@ -56,10 +147,35 @@ AppDelegate.addMethod('applicationWillTerminate:', 'v@:@', function (self, _cmd, notif) { | ||
}) | ||
AppDelegate.addMethod('windowDidMove:', 'v@:@', function (self, _cmd, notif) { | ||
var x = window('backgroundColor') | ||
window('setBackgroundColor', x == $.NSColor('purpleColor') ? $.NSColor('redColor') : $.NSColor('blueColor')) | ||
}) | ||
AppDelegate.addMethod('windowDidResize:', 'v@:@', function (self, _cmd, notif) { | ||
if ((notif('object')('width') % 100) < 10) { | ||
window('animator')('setBackgroundColor', $.AtoZ('globalPalette')('nextNormalObject')) | ||
// $.AZTalker('randomDicksonism') | ||
// ($.NSString('randomDicksonism')) | ||
} | ||
}) | ||
AppDelegate.register() | ||
var delegate = AppDelegate('alloc')('init') | ||
var delegate = AppDelegate('new') | ||
textV('setDelegate',delegate) | ||
app('setDelegate', delegate) | ||
window('setDelegate', delegate) | ||
app('activateIgnoringOtherApps', true) | ||
app('finishLaunching') | ||
// var azb = $.getenv('AZBUILD') | ||
// $.NSLog('%@','vageem') | ||
// console.error('vageem') | ||
// var array = $.NSMutableArray('alloc')('init') | ||
// array('addObject', $('Hello World!')) | ||
// console.log(array) | ||
evtLoop.start() | ||
// var jsString = 'a javascript String' | ||
// var nsString = $(jsString) | ||
// $.NSLog(nsString) | ||
// window('setBackgroundColor', $.NSColor('purpleColor') | ||
app('run') |
2.1.0 / 2015-12-16 | ||
================== | ||
* Update README.md | ||
* package: update "libxmljs" and use "memwatch-next" | ||
* package: add "license" field | ||
* package: update deps | ||
* travis: test more versions of node | ||
* enabled `/Library` + `$USER/Library` framework search paths | ||
* fixes for case-sensitive file systems | ||
* support complex ivar, e.g. HTTPMethod from CococaHTTPServer | ||
2.0.0 / 2015-04-09 | ||
@@ -3,0 +15,0 @@ ================== |
@@ -183,2 +183,3 @@ module.exports = (function() { | ||
if(basetype == '@' || basetype == '#') return createObject(val, basetype); | ||
else if (basetype[0] == '@') return createObject(val, '@'); | ||
else if (basetype == '@?') return createObject(createBlock(val, '@')); | ||
@@ -373,3 +374,3 @@ else if (basetype == '^?') return createUnwrapperFunction(val, type); | ||
var wrappedObj = (type == '@') ? new (require('./id'))(val) | ||
: new (require('./Class'))(val); | ||
: new (require('./class'))(val); | ||
@@ -376,0 +377,0 @@ var rtn = function() { return wrappedObj.msgSend(arguments,false); } |
@@ -27,3 +27,3 @@ module.exports = (function() { | ||
, Class = require('./class') | ||
, ID = require('./ID') | ||
, ID = require('./id') | ||
, join = path.join | ||
@@ -36,2 +36,4 @@ , basename = path.basename | ||
, '/System/Library/PrivateFrameworks' | ||
, '/Library/Frameworks' | ||
, process.env['HOME'] + '/Library/Frameworks' | ||
] | ||
@@ -38,0 +40,0 @@ , join = path.join |
@@ -16,3 +16,4 @@ { | ||
], | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"license": "MIT", | ||
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)", | ||
@@ -29,10 +30,10 @@ "repository": { | ||
"debug": "*", | ||
"ffi": "~1.3.0", | ||
"ref": "~1.0.1", | ||
"ref-struct": "~1.0.1" | ||
"ffi": "2", | ||
"ref": "~1.1.3", | ||
"ref-struct": "~1.0.2" | ||
}, | ||
"devDependencies": { | ||
"libxmljs": "~0.7.1", | ||
"libxmljs": "~0.14.3", | ||
"dox": "0.3.x", | ||
"memwatch": "*", | ||
"memwatch-next": "*", | ||
"highlight.js": "1", | ||
@@ -39,0 +40,0 @@ "jade": "0.25.x", |
@@ -9,3 +9,3 @@ NodObjC | ||
to use fashion. It uses the `BridgeSupport` files to dynamically generate an | ||
API from an Objective-C "Framework", and uses `node-ffi` to dynamically interact | ||
API from an Objective-C "Framework", and uses the node `ffi` module to dynamically interact | ||
with the Objective-C runtime. | ||
@@ -23,6 +23,6 @@ | ||
JavaScript! Applications are interpreted at runtime through the V8 engine, | ||
rather than compiled to a machine exectuable. This has the advantage of being | ||
rather than (pre)compiled to a (binary) machine exectuable. This has the advantage of being | ||
able to tweak code without having to recompile; excellent for rapid prototyping | ||
and development, or for those GUI applications where absolute speed is not a | ||
requirement (i.e. _most_). So what are you waiting for? Get to coding! | ||
and development (or for those GUI applications where absolute speed is not a | ||
requirement, i.e. _most_). So what are you waiting for? Get to coding! | ||
@@ -29,0 +29,0 @@ |
@@ -8,3 +8,3 @@ // V8 does not have an explicit way for memwatach to force garbage collection | ||
var assert = require('assert'); | ||
var memwatch = require('memwatch'); | ||
var memwatch = require('memwatch-next'); | ||
@@ -61,2 +61,2 @@ $.import('Foundation', 0); | ||
assert(failures == 0, failures + ' out of ' + tries + ' tests failed. The amount of leaked memory was: ' + failuresSize + ' bytes'); | ||
} | ||
} |
var $ = require('../'); | ||
var memwatch = require('memwatch'); | ||
var memwatch = require('memwatch-next'); | ||
var hd = new memwatch.HeapDiff(); | ||
@@ -32,2 +32,2 @@ var hrstart = ( process.hrtime ? process.hrtime() : Date.now() ) | ||
process.stdout.write(" time ["+((hrend - hrstart)/1000)+" s] \033[0m"); | ||
} | ||
} |
var $ = require('./archive/oldimport'); | ||
var memwatch = require('memwatch'); | ||
var memwatch = require('memwatch-next'); | ||
var hd = new memwatch.HeapDiff(); | ||
@@ -32,2 +32,2 @@ var hrstart = ( process.hrtime ? process.hrtime() : Date.now() ) | ||
process.stdout.write(" time ["+((hrend - hrstart)/1000)+" s] \033[0m"); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
844898
11427
11
+ Addedffi@2.3.0(transitive)
+ Addednan@2.22.0(transitive)
+ Addedref@1.1.3(transitive)
- Removedffi@1.3.2(transitive)
- Removednan@1.8.41.9.0(transitive)
- Removedref@1.0.2(transitive)
Updatedffi@2
Updatedref@~1.1.3
Updatedref-struct@~1.0.2