Merge branch 'master' of github.com:cappuccino/cappuccino

This commit is contained in:
Alexander Ljungberg
2013-01-30 11:15:10 +00:00
6 changed files with 66 additions and 22 deletions
+11 -9
View File
@@ -915,11 +915,12 @@ CPRunContinuesResponse = -1002;
/*!
Fires a callback function when an event matching a given mask occurs.
@param aCallback - A js function to be fired.
@prarm aMask - An event mask for the next event.
@param anExpiration - The date for which this callback expires (not implemented).
@param aCallback A js function to be fired.
@prarm aMask An event mask for the next event.
@param anExpiration The date for which this callback expires (not implemented).
@param inMode (not implemented).
@param shouldDequeue (not implemented).
@param shouldDequeue YES to remove the event from the queue after calling the callback,
NO to deliver it normally.
*/
- (void)setCallback:(Function)aCallback forNextEventMatchingMask:(unsigned int)aMask untilDate:(CPDate)anExpiration inMode:(CPString)aMode dequeue:(BOOL)shouldDequeue
{
@@ -930,12 +931,13 @@ CPRunContinuesResponse = -1002;
Assigns a target and action for the next event matching a given event mask.
The callback method called will be passed the CPEvent when it fires.
@param aTarget - The target object for the callback.
@param aSelector - The selector which should be called on the target object.
@param aMask - The mask for a given event which should trigger the callback.
@param anExpiration - The date for which the callback expires (not implemented).
@param aTarget The target object for the callback.
@param aSelector The selector which should be called on the target object.
@param aMask The mask for a given event which should trigger the callback.
@param anExpiration The date for which the callback expires (not implemented).
@param aMode (not implemented).
@param shouldDequeue (not implemented).
@param shouldDequeue YES to remove the event from the queue after calling the callback,
NO to deliver it normally.
*/
- (void)setTarget:(id)aTarget selector:(SEL)aSelector forNextEventMatchingMask:(unsigned int)aMask untilDate:(CPDate)anExpiration inMode:(CPString)aMode dequeue:(BOOL)shouldDequeue
{
+4 -2
View File
@@ -1,8 +1,10 @@
require("../common.jake");
var framework = require("objective-j/jake").framework;
var BundleTask = require("objective-j/jake").BundleTask;
checkUlimit();
var framework = require("objective-j/jake").framework,
BundleTask = require("objective-j/jake").BundleTask;
$BUILD_PATH = FILE.join($BUILD_DIR, $CONFIGURATION, 'AppKit');
+8 -5
View File
@@ -317,7 +317,8 @@ var resizeTimer = nil;
// Make sure the pastboard element is blurred.
_DOMPasteboardElement.blur();
// Create a full screen div to protect against iframes and other elements from consuming events during tracking
// Create a full screen div to protect against iframes and other elements
// from consuming events during tracking
// FIXME: multiple windows
_DOMEventGuard = theDocument.createElement("div");
_DOMEventGuard.style.position = "absolute";
@@ -1275,7 +1276,7 @@ var resizeTimer = nil;
_DOMEventMode = YES;
_mouseIsDown = YES;
//fake a down and up event so that event tracking mode will work correctly
// Fake a down and up event so that event tracking mode will work correctly
[CPApp sendEvent:[CPEvent mouseEventWithType:_mouseDownIsRightClick ? CPRightMouseDown : CPLeftMouseDown location:location modifierFlags:modifierFlags
timestamp:timestamp windowNumber:windowNumber context:nil eventNumber:-1
clickCount:CPDOMEventGetClickCount(_lastMouseDown, timestamp, location) pressure:0]];
@@ -1322,13 +1323,15 @@ var resizeTimer = nil;
if (StopDOMEventPropagation && (!supportsNativeDragAndDrop || type !== "mousedown" && !isDragging))
CPDOMEventStop(aDOMEvent, self);
// if there are any tracking event listeners then show the event guard so we don't lose events to iframes
// TODO Actually check for tracking event listeners, not just any listener but _CPRunModalLoop.
// If there are any tracking event listeners (listening for CPLeftMouseDraggedMask)
// then show the event guard so we don't lose events to iframes
var hasTrackingEventListener = NO;
for (var i = 0; i < CPApp._eventListeners.length; i++)
{
if (CPApp._eventListeners[i]._callback !== _CPRunModalLoop)
var listener = CPApp._eventListeners[i];
if (listener._callback !== _CPRunModalLoop && (listener._mask & CPLeftMouseDraggedMask))
{
hasTrackingEventListener = YES;
break;
+24
View File
@@ -22,9 +22,33 @@
@import "Nib2Cib.j"
var OS = require("OS"),
stream = require("narwhal/term").stream;
function main(args)
{
checkUlimit();
var nib2cib = [[Nib2Cib alloc] initWithArgs:args];
[nib2cib run];
}
function checkUlimit()
{
var minUlimit = 1024,
p = OS.popen(["ulimit", "-n"]);
if (p.wait() === 0)
{
var limit = p.stdout.read().split("\n")[0];
if (Number(limit) < minUlimit)
{
stream.print("\0red(\0bold(WARNING:\0)\0) nib2cib may need to open more files than this terminal session currently allows (" + limit + "). Add the following line to your login configuration file (.bash_profile, .bashrc, etc.), start a new terminal session, then try again:\n");
stream.print("ulimit -n " + minUlimit);
OS.exit(1);
}
}
}
+19
View File
@@ -540,6 +540,25 @@ global.colorPrint = function(/* String */ message, /* String */ color)
stream.print(colorize(message, color));
};
var minUlimit = 1024;
global.checkUlimit = function()
{
var p = OS.popen(["ulimit", "-n"]);
if (p.wait() === 0)
{
var limit = p.stdout.read().split("\n")[0];
if (Number(limit) < minUlimit)
{
stream.print("\0red(\0bold(WARNING:\0)\0) Cappuccino may need to open more files than this terminal session currently allows (" + limit + "). Add the following line to your login configuration file (.bash_profile, .bashrc, etc.), start a new terminal session, then try again:\n");
stream.print("ulimit -n " + minUlimit);
OS.exit(1);
}
}
}
// built in tasks
-6
View File
@@ -1,9 +1,3 @@
if [ -z "$NARWHAL_ENGINE" ] && [ -d "$NARWHAL_HOME/packages/narwhal-jsc" ]; then
export NARWHAL_ENGINE=jsc
fi
if [ "$NARWHAL_ENGINE" == jsc ] && [ `ulimit -n` -lt 512 ]; then
# JSC and Narwhal together have some trouble closing files, leading to the Cappuccino
# build process crashing with a "popen error (pipe): Too many open files" error.
ulimit -n 512
fi