mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-30 20:07:36 +00:00
Merge branch 'jake' into menus
This commit is contained in:
commit
652930d5aa
7 files changed
+142
-41
No files matched your search
+84
-13
@@ -96,6 +96,10 @@ CPRunContinuesResponse = -1002;
|
||||
CPDictionary _namedArgs;
|
||||
CPArray _args;
|
||||
CPString _fullArgsString;
|
||||
|
||||
CPImage _applicationIconImage;
|
||||
|
||||
CPPanel _aboutPanel;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -302,11 +306,88 @@ CPRunContinuesResponse = -1002;
|
||||
|
||||
- (void)terminate:(id)aSender
|
||||
{
|
||||
[[CPDocumentController sharedDocumentController] closeAllDocumentsWithDelegate:self
|
||||
didCloseAllSelector:@selector(_documentController:didCloseAll:context:)
|
||||
contextInfo:nil];
|
||||
if (![CPPlatform isBrowser])
|
||||
{
|
||||
[[CPDocumentController sharedDocumentController] closeAllDocumentsWithDelegate:self
|
||||
didCloseAllSelector:@selector(_documentController:didCloseAll:context:)
|
||||
contextInfo:nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[[CPApp mainWindow] platformWindow] _propagateCurrentDOMEvent:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setApplicationIconImage:(CPImage)anImage
|
||||
{
|
||||
_applicationIconImage = anImage;
|
||||
}
|
||||
|
||||
- (CPImage)applicationIconImage
|
||||
{
|
||||
if (_applicationIconImage)
|
||||
return _applicationIconImage;
|
||||
|
||||
var imagePath = [[CPBundle mainBundle] objectForInfoDictionaryKey:@"CPApplicationIcon"];
|
||||
if (imagePath)
|
||||
_applicationIconImage = [[CPImage alloc] initWithContentsOfFile:imagePath];
|
||||
|
||||
return _applicationIconImage;
|
||||
}
|
||||
|
||||
- (void)orderFrontStandardAboutPanel:(id)sender
|
||||
{
|
||||
[self orderFrontStandardAboutPanelWithOptions:nil];
|
||||
}
|
||||
|
||||
- (void)orderFrontStandardAboutPanelWithOptions:(CPDictionary)options
|
||||
{
|
||||
if (!_aboutPanel)
|
||||
{
|
||||
var mainInfo = [[CPBundle mainBundle] infoDictionary],
|
||||
applicationTitle = [options objectForKey:"ApplicationName"] || [mainInfo objectForKey:@"CPBundleName"],
|
||||
applicationIcon = [options objectForKey:@"ApplicationIcon"] || [self applicationIconImage],
|
||||
version = [options objectForKey:@"Version"] || [mainInfo objectForKey:@"CPBundleVersion"],
|
||||
applicationVersion = [options objectForKey:@"ApplicationVersion"] || [mainInfo objectForKey:@"CPBundleShortVersionString"],
|
||||
copyright = [options objectForKey:@"Copyright"] || [mainInfo objectForKey:@"CPHumanReadableCopyright"];
|
||||
|
||||
var aboutPanelController = [[CPWindowController alloc] initWithWindowCibName:@"AboutPanel"],
|
||||
aboutPanel = [aboutPanelController window],
|
||||
contentView = [aboutPanel contentView],
|
||||
imageView = [contentView viewWithTag:1],
|
||||
applicationLabel = [contentView viewWithTag:2],
|
||||
versionLabel = [contentView viewWithTag:3],
|
||||
copyrightLabel = [contentView viewWithTag:4],
|
||||
standardPath = [[CPBundle bundleForClass:[self class]] pathForResource:@"standardApplicationIcon.png"];
|
||||
|
||||
// FIXME move this into the CIB eventually
|
||||
[applicationLabel setFont:[CPFont boldSystemFontOfSize:14.0]];
|
||||
[applicationLabel setAlignment:CPCenterTextAlignment];
|
||||
[versionLabel setAlignment:CPCenterTextAlignment];
|
||||
[copyrightLabel setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[imageView setImage:applicationIcon || [[CPImage alloc] initWithContentsOfFile:standardPath
|
||||
size:CGSizeMake(256, 256)]];
|
||||
|
||||
[applicationLabel setStringValue:applicationTitle || ""];
|
||||
|
||||
if (version && applicationVersion)
|
||||
[versionLabel setStringValue:sprintf(@"Version %@ (%@)", applicationVersion, version)];
|
||||
else if (applicationVersion || version)
|
||||
[versionLabel setStringValue:sprintf(@"Version %@", applicationVersion || version)];
|
||||
else
|
||||
[versionLabel setStringValue:@""];
|
||||
|
||||
[copyrightLabel setStringValue:copyright || ""];
|
||||
[aboutPanel center];
|
||||
|
||||
_aboutPanel = aboutPanel;
|
||||
}
|
||||
|
||||
[_aboutPanel orderFront:self];
|
||||
}
|
||||
|
||||
|
||||
- (void)_documentController:(NSDocumentController *)docController didCloseAll:(BOOL)didCloseAll context:(Object)info
|
||||
{
|
||||
// callback method for terminate:
|
||||
@@ -559,16 +640,6 @@ CPRunContinuesResponse = -1002;
|
||||
[[CPColorPanel sharedColorPanel] orderFront:self];
|
||||
}
|
||||
|
||||
- (void)orderFrontStandardAboutPanel:(id)aSender
|
||||
{
|
||||
[self orderFrontStandardAboutPanelWithOptions:nil];
|
||||
}
|
||||
|
||||
- (void)orderFrontStandardAboutPanelWithOptions:(CPDictionary)aDictionary
|
||||
{
|
||||
// FIXME: Implement.
|
||||
}
|
||||
|
||||
// Posting Actions
|
||||
/*!
|
||||
Tries to perform the action with an argument. Performs
|
||||
|
||||
+1
-1
@@ -596,7 +596,7 @@ var CPViewFlags = { },
|
||||
|
||||
- (void)viewWithTag:(CPInteger)aTag
|
||||
{
|
||||
if ([self tag] === aTag)
|
||||
if ([self tag] == aTag)
|
||||
return self;
|
||||
|
||||
var index = 0,
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;K;21;CPCibObjectRecordsKeyD;K;6;CP$UIDd;1;4E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;6E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;7E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;8E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;2;10E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;2;11E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;2;12E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;2;13E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;2;14E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;2;15E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;17E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;19E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;23E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;37E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;50E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;52E;D;K;6;CP$UIDd;2;53E;D;K;6;CP$UIDd;2;54E;D;K;6;CP$UIDd;2;54E;D;K;6;CP$UIDd;2;54E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;56E;E;E;S;16;IBCocoaFrameworkd;3;461D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;42E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;16E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;2;57E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;18E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;2;58E;E;D;K;10;$classnameS;15;CibObjectRecordK;8;$classesA;S;15;CibObjectRecordS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;CibObjectRecordParentKeyD;K;6;CP$UIDd;1;0E;K;26;CibObjectRecordChildrenKeyD;K;6;CP$UIDd;2;59E;K;24;CibObjectRecordObjectKeyD;K;6;CP$UIDd;2;60E;K;23;CibObjectRecordLabelKeyD;K;6;CP$UIDd;2;61E;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;CibObjectRecordParentKeyD;K;6;CP$UIDd;1;0E;K;26;CibObjectRecordChildrenKeyD;K;6;CP$UIDd;2;62E;K;24;CibObjectRecordObjectKeyD;K;6;CP$UIDd;2;63E;K;23;CibObjectRecordLabelKeyD;K;6;CP$UIDd;1;0E;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;CibObjectRecordParentKeyD;K;6;CP$UIDd;2;42E;K;26;CibObjectRecordChildrenKeyD;K;6;CP$UIDd;2;64E;K;24;CibObjectRecordObjectKeyD;K;6;CP$UIDd;2;48E;K;23;CibObjectRecordLabelKeyD;K;6;CP$UIDd;2;54E;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;CibObjectRecordParentKeyD;K;6;CP$UIDd;1;0E;K;26;CibObjectRecordChildrenKeyD;K;6;CP$UIDd;2;65E;K;24;CibObjectRecordObjectKeyD;K;6;CP$UIDd;2;66E;K;23;CibObjectRecordLabelKeyD;K;6;CP$UIDd;1;0E;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;CibObjectRecordParentKeyD;K;6;CP$UIDd;1;0E;K;26;CibObjectRecordChildrenKeyD;K;6;CP$UIDd;2;67E;K;24;CibObjectRecordObjectKeyD;K;6;CP$UIDd;2;68E;K;23;CibObjectRecordLabelKeyD;K;6;CP$UIDd;1;0E;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;CibObjectRecordParentKeyD;K;6;CP$UIDd;2;42E;K;26;CibObjectRecordChildrenKeyD;K;6;CP$UIDd;2;69E;K;24;CibObjectRecordObjectKeyD;K;6;CP$UIDd;2;47E;K;23;CibObjectRecordLabelKeyD;K;6;CP$UIDd;2;54E;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;CibObjectRecordParentKeyD;K;6;CP$UIDd;1;0E;K;26;CibObjectRecordChildrenKeyD;K;6;CP$UIDd;2;70E;K;24;CibObjectRecordObjectKeyD;K;6;CP$UIDd;2;71E;K;23;CibObjectRecordLabelKeyD;K;6;CP$UIDd;1;0E;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;CibObjectRecordParentKeyD;K;6;CP$UIDd;1;0E;K;26;CibObjectRecordChildrenKeyD;K;6;CP$UIDd;2;72E;K;24;CibObjectRecordObjectKeyD;K;6;CP$UIDd;2;73E;K;23;CibObjectRecordLabelKeyD;K;6;CP$UIDd;1;0E;E;D;K;6;$classD;K;6;CP$UIDd;2;20E;K;24;CibObjectRecordParentKeyD;K;6;CP$UIDd;2;42E;K;26;CibObjectRecordChildrenKeyD;K;6;CP$UIDd;2;74E;K;24;CibObjectRecordObjectKeyD;K;6;CP$UIDd;2;46E;K;23;CibObjectRecoLine truncated
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -83,11 +83,11 @@ function compileWithResolvedFlags(aFilePath, objjcFlags, gccFlags)
|
||||
for (var index = 0; index < fragments.length; index++)
|
||||
{
|
||||
var fragment = fragments[index];
|
||||
|
||||
|
||||
if (IS_FILE(fragment))
|
||||
preprocessed += (IS_LOCAL(fragment) ? MARKER_IMPORT_LOCAL : MARKER_IMPORT_STD) + ';' + GET_PATH(fragment).length + ';' + GET_PATH(fragment);
|
||||
else
|
||||
{
|
||||
{
|
||||
var code = GET_CODE(fragment);
|
||||
|
||||
if (shouldCheckSyntax)
|
||||
@@ -99,23 +99,25 @@ function compileWithResolvedFlags(aFilePath, objjcFlags, gccFlags)
|
||||
catch (e)
|
||||
{
|
||||
var lines = code.split("\n"),
|
||||
PAD = 3;
|
||||
|
||||
print("Syntax error in "+GET_FILE(fragment).path+
|
||||
" on preprocessed line number "+e.lineNumber+"\n"+
|
||||
"\t"+lines.slice(Math.max(0, e.lineNumber - 1 - PAD), e.lineNumber+PAD).join("\n\t"));
|
||||
|
||||
OS.exit(1);
|
||||
PAD = 3,
|
||||
lineNumber = e.lineNumber || e.line,
|
||||
errorInfo = "Syntax error in "+GET_FILE(fragment).path+
|
||||
" on preprocessed line number "+lineNumber+"\n\n"+
|
||||
"\t"+lines.slice(Math.max(0, lineNumber - 1 - PAD), lineNumber+PAD).join("\n\t");
|
||||
|
||||
print(errorInfo);
|
||||
|
||||
throw errorInfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (shouldCompress)
|
||||
{
|
||||
code = compress("function(){" + code + '}', FILE.basename(aFilePath));
|
||||
|
||||
|
||||
code = code.substr("function(){".length, code.length - "function(){};\n\n".length);
|
||||
}
|
||||
|
||||
|
||||
preprocessed += MARKER_CODE + ';' + code.length + ';' + code;
|
||||
}
|
||||
}
|
||||
|
||||
+39
-13
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function prompt () {
|
||||
while true; do
|
||||
@@ -25,23 +25,39 @@ function path_instructions () {
|
||||
echo " export PATH=$INSTALL_DIRECTORY/bin:\$PATH"
|
||||
}
|
||||
|
||||
TEMPZIP="/tmp/narwhal.zip"
|
||||
if [ "--clone" = "$1" ]; then
|
||||
GITCLONE=1
|
||||
fi
|
||||
|
||||
INSTALL_DIRECTORY="/usr/local/narwhal"
|
||||
TEMPZIP="/tmp/narwhal.zip"
|
||||
|
||||
ORIGINAL_PATH="$PATH"
|
||||
|
||||
if ! which "narwhal"; then
|
||||
echo "================================================================================"
|
||||
echo "Narwhal JavaScript platform is required. Install it into \"$INSTALL_DIRECTORY\"?"
|
||||
echo "Narwhal JavaScript platform is required. Install it automatically?"
|
||||
if prompt; then
|
||||
echo "Downloading Narwhal..."
|
||||
curl -L -o "$TEMPZIP" "http://github.com/280north/narwhal/zipball/master"
|
||||
echo "Installing Narwhal..."
|
||||
unzip "$TEMPZIP" -d "$INSTALL_DIRECTORY"
|
||||
rm "$TEMPZIP"
|
||||
|
||||
mv $INSTALL_DIRECTORY/280north-narwhal-*/* $INSTALL_DIRECTORY/.
|
||||
rm -rf $INSTALL_DIRECTORY/280north-narwhal-*
|
||||
echo "================================================================================"
|
||||
echo "To use the default location, \"$INSTALL_DIRECTORY\", just hit enter/return, or enter another path:"
|
||||
read INSTALL_DIRECTORY_INPUT
|
||||
if [ "$INSTALL_DIRECTORY_INPUT" ]; then
|
||||
INSTALL_DIRECTORY="$INSTALL_DIRECTORY_INPUT"
|
||||
fi
|
||||
|
||||
if [ "$GITCLONE" ]; then
|
||||
echo "Cloning Narwhal..."
|
||||
git clone git://github.com/280north/narwhal.git "$INSTALL_DIRECTORY"
|
||||
else
|
||||
echo "Downloading Narwhal..."
|
||||
curl -L -o "$TEMPZIP" "http://github.com/280north/narwhal/zipball/master"
|
||||
echo "Installing Narwhal..."
|
||||
unzip "$TEMPZIP" -d "$INSTALL_DIRECTORY"
|
||||
rm "$TEMPZIP"
|
||||
|
||||
mv $INSTALL_DIRECTORY/280north-narwhal-*/* $INSTALL_DIRECTORY/.
|
||||
rm -rf $INSTALL_DIRECTORY/280north-narwhal-*
|
||||
fi
|
||||
|
||||
if ! which "narwhal"; then
|
||||
export PATH="$INSTALL_DIRECTORY/bin:$PATH"
|
||||
@@ -58,14 +74,24 @@ if ! which "narwhal"; then
|
||||
fi
|
||||
|
||||
echo "Installing necessary dependencies..."
|
||||
tusk install browserjs jake
|
||||
|
||||
if [ "$GITCLONE" ]; then
|
||||
tusk update
|
||||
tusk clone browserjs jake
|
||||
else
|
||||
tusk install browserjs jake
|
||||
fi
|
||||
|
||||
if [ `uname` = "Darwin" ]; then
|
||||
echo "================================================================================"
|
||||
echo "Would you like to install the JavaScriptCore engine for Narwhal?"
|
||||
echo "This is optional but will make building and running Objective-J much faster."
|
||||
if prompt; then
|
||||
tusk install narwhal-jsc
|
||||
if [ "$GITCLONE" ]; then
|
||||
tusk clone narwhal-jsc
|
||||
else
|
||||
tusk install narwhal-jsc
|
||||
fi
|
||||
pushd "$INSTALL_DIRECTORY/packages/narwhal-jsc"
|
||||
make webkit
|
||||
popd
|
||||
|
||||
+3
-2
@@ -203,8 +203,9 @@ global.subjake = function(/*Array<String>*/ directories, /*String*/ aTaskName)
|
||||
{
|
||||
if (FILE.isDirectory(aDirectory) && FILE.isFile(FILE.join(aDirectory, "Jakefile")))
|
||||
{
|
||||
OS.system("cd " + aDirectory + " && " + serializedENV() + " " + ARGV[0] + " " + aTaskName);
|
||||
//rake abort if ($? != 0)
|
||||
var returnCode = OS.system("cd " + aDirectory + " && " + serializedENV() + " " + ARGV[0] + " " + aTaskName);
|
||||
if (returnCode)
|
||||
OS.exit(returnCode);
|
||||
}
|
||||
else
|
||||
print("warning: subjake missing: " + aDirectory + " (this is not necessarily an error, " + aDirectory + " may be optional)");
|
||||
|
||||
Reference in new issue
Block a user