Merge branch 'master' of https://github.com/cappuccino/cappuccino into preprocess

This commit is contained in:
Martin Carlberg committed 2013-05-13 16:38:39 +02:00
commit 7837277cbe
192 files changed
+19739 -7465

No files matched your search

+1
View File
@@ -11,5 +11,6 @@ xcuserdata/
!*.xcodeproj/project.pbxproj
*.xCodeSupport/
*.XcodeSupport/
*XcodeSupport/
*.sublime-project
*.sublime-workspace
+21 -16
View File
@@ -30,6 +30,7 @@
@import <Foundation/CPDate.j>
@import <Foundation/CPDateFormatter.j>
@import <Foundation/CPLocale.j>
@import <Foundation/CPTimeZone.j>
@class CPStepper
@class CPApp
@@ -68,8 +69,7 @@ CPEraDatePickerElementFlag = 0x0100;
CPFont _textFont @accessors(property=textFont);
CPLocale _locale @accessors(property=locale);
//CPCalendar _calendar @accessors(property=calendar);
//CPTimeZone _timeZone @accessors(property=timeZone);
CPDateFormatter _formatter @accessors(property=formatter);
CPTimeZone _timeZone @accessors(property=timeZone);
id _delegate @accessors(property=delegate);
unsigned _datePickerElements @accessors(property=datePickerElements);
CPInteger _datePickerMode @accessors(property=datePickerMode);
@@ -187,7 +187,6 @@ CPEraDatePickerElementFlag = 0x0100;
_datePickerElements = CPYearMonthDayDatePickerElementFlag | CPHourMinuteSecondDatePickerElementFlag;
_timeInterval = 0;
_implementedCDatePickerDelegateMethods = 0;
_formatter = [[CPDateFormatter alloc] init];
[self setObjectValue:[CPDate date]];
_minDate = [CPDate distantPast];
@@ -207,6 +206,9 @@ CPEraDatePickerElementFlag = 0x0100;
if (!_locale)
_locale = [CPLocale currentLocale];
if (!_timeZone)
_timeZone = [CPTimeZone systemTimeZone];
_datePickerTextfield = [[_CPDatePickerTextField alloc] initWithFrame:[self bounds] withDatePicker:self];
[_datePickerTextfield setDateValue:_dateValue];
@@ -265,18 +267,12 @@ CPEraDatePickerElementFlag = 0x0100;
#pragma mark -
#pragma mark Setter
/*! Return the objectValue of the datePicker. The objectValue is made with the current formatter of the datePicker
/*! Return the objectValue of the datePicker. The objectValue should take the timeZoneEffect
*/
- (void)objectValue
{
// try
// {
// return [_formatter stringFromDate:_dateValue];
// }
// catch(e)
// {
return _dateValue
// }
// TODO : add timeZone effect. How to do it because js ???
return _dateValue
}
/*! Set the objectValue ofhe datePier. It has to be a CPDate
@@ -328,8 +324,8 @@ CPEraDatePickerElementFlag = 0x0100;
[self willChangeValueForKey:@"dateValue"];
_dateValue = aDateValue;
[super setObjectValue:_dateValue];
[self didChangeValueForKey:@"dateValue"];
[self didChangeValueForKey:@"objectValue"];
[self didChangeValueForKey:@"dateValue"];
[self willChangeValueForKey:@"timeInterval"];
_timeInterval = (_datePickerMode == CPSingleDateMode)? 0 : aTimeInterval;
@@ -503,6 +499,18 @@ CPEraDatePickerElementFlag = 0x0100;
[self setNeedsLayout];
}
/*! Set the timeZone
@param aTimeZone
*/
- (void)setTimeZone:(CPTimeZone)aTimeZone
{
[self willChangeValueForKey:@"timeZone"];
_timeZone = aTimeZone;
[self didChangeValueForKey:@"timeZone"];
[self setNeedsLayout];
}
#pragma mark -
#pragma mark First responder methods
@@ -603,7 +611,6 @@ var CPDatePickerModeKey = @"CPDatePickerModeKey",
CPDatePickerElementsKey = @"CPDatePickerElementsKey",
CPDatePickerStyleKey = @"CPDatePickerStyleKey",
CPLocaleKey = @"CPLocaleKey",
CPFormatterKey = @"CPFormatterKey",
CPBorderedKey = @"CPBorderedKey",
CPDateValueKey = @"CPDateValueKey";
@@ -623,7 +630,6 @@ var CPDatePickerModeKey = @"CPDatePickerModeKey",
_datePickerElements = [aCoder decodeIntForKey:CPDatePickerElementsKey];
_datePickerStyle = [aCoder decodeIntForKey:CPDatePickerStyleKey];
_locale = [aCoder decodeObjectForKey:CPLocaleKey];
_formatter = [aCoder decodeObjectForKey:CPFormatterKey];
_dateValue = [aCoder decodeObjectForKey:CPDateValueKey];
_backgroundColor = [aCoder decodeObjectForKey:CPBackgroundColorKey];
_drawsBackground = [aCoder decodeBoolForKey:CPDrawsBackgroundKey];
@@ -646,7 +652,6 @@ var CPDatePickerModeKey = @"CPDatePickerModeKey",
[aCoder encodeObject:_dateValue forKey:CPDateValueKey];;
[aCoder encodeObject:_textFont forKey:CPTextFontKey];
[aCoder encodeObject:_locale forKey:CPLocaleKey];
[aCoder encodeObject:_formatter forKey:CPFormatterKey];
[aCoder encodeObject:_backgroundColor forKey:CPBackgroundColorKey];
[aCoder encodeObject:_drawsBackground forKey:CPDrawsBackgroundKey];
[aCoder encodeObject:_isBordered forKey:CPBorderedKey];
+4 -1
View File
@@ -132,7 +132,10 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su"
*/
- (void)setDateValue:(CPDate)aDateValue
{
[_monthView setMonthForDate:aDateValue];
var dateValue = [aDateValue copy];
[dateValue _dateWithTimeZone:[_datePicker timeZone]];
[_monthView setMonthForDate:dateValue];
[_headerView setMonthForDate:[_monthView monthDate]];
[self setNeedsLayout];
+8 -5
View File
@@ -125,7 +125,10 @@
{
[super layoutSubviews];
var bounds = [self bounds];
var bounds = [self bounds],
dateValue = [[_datePicker dateValue] copy];
[dateValue _dateWithTimeZone:[_datePicker timeZone]];
[self setBackgroundColor:[_datePicker valueForThemeAttribute:@"bezel-color-clock" inState:[_datePicker themeState]]];
[_middleHandLayer setBackgroundHandColor:[_datePicker valueForThemeAttribute:@"middle-hand-color" inState:[_datePicker themeState]]];
@@ -135,7 +138,7 @@
if ([_datePicker _isEnglishFormat])
{
if ([_datePicker dateValue].getHours() > 11)
if (dateValue.getHours() > 11)
[_PMAMTextField setStringValue:@"PM"]
else
[_PMAMTextField setStringValue:@"AM"];
@@ -149,9 +152,9 @@
[_PMAMTextField setHidden:YES];
}
[_hourHandLayer setRotationRadians:[self _hourPositionRadianForDate:[_datePicker dateValue]]];
[_minuteHandLayer setRotationRadians:[self _minutePositionRadianForDate:[_datePicker dateValue]]];
[_secondHandLayer setRotationRadians:[self _secondPositionRadianForDate:[_datePicker dateValue]]];
[_hourHandLayer setRotationRadians:[self _hourPositionRadianForDate:dateValue]];
[_minuteHandLayer setRotationRadians:[self _minutePositionRadianForDate:dateValue]];
[_secondHandLayer setRotationRadians:[self _secondPositionRadianForDate:dateValue]];
// Check if we have to display the hand second
if (([_datePicker datePickerElements] & CPHourMinuteSecondDatePickerElementFlag) == CPHourMinuteSecondDatePickerElementFlag)
+12 -6
View File
@@ -22,6 +22,7 @@
@import "CPControl.j"
@import "CPFont.j"
@import "CPTextField.j"
@import "CPStepper.j"
@import <Foundation/CPArray.j>
@import <Foundation/CPObject.j>
@@ -30,7 +31,6 @@
@import <Foundation/CPLocale.j>
@class CPDatePicker
@class CPStepper
@global CPSingleDateMode
@global CPRangeDateMode
@@ -139,7 +139,10 @@ var CPZeroKeyCode = 48,
*/
- (void)setDateValue:(CPDate)aDateValue
{
[_datePickerElementView setDateValue:aDateValue];
var dateValue = [aDateValue copy];
[dateValue _dateWithTimeZone:[_datePicker timeZone]];
[_datePickerElementView setDateValue:dateValue];
}
/*! Set the widget enabled or not
@@ -648,16 +651,19 @@ var CPZeroKeyCode = 48,
- (void)_datePickerElementTextFieldAMPMChangedNotification:(CPNotification)aNotification
{
var value = [[aNotification object] stringValue],
dateValue = [[_datePicker dateValue] copy];
dateValue = [[_datePicker dateValue] copy],
d = [dateValue copy];
[d _dateWithTimeZone:[_datePicker timeZone]];
if ([value isEqualToString:@"PM"])
{
if (dateValue.getHours() <= 11)
if (d.getHours() <= 11)
dateValue.setHours(dateValue.getHours() + 12);
}
else
{
if (dateValue.getHours() > 11)
if (d.getHours() > 11)
dateValue.setHours(dateValue.getHours() - 12);
}
@@ -1498,4 +1504,4 @@ var CPMonthDateType = 0,
[self unsetThemeState:CPThemeStateSelected];
}
@end
@end
+15 -6
View File
@@ -721,16 +721,25 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
/*!
@ignore
Select or deselect rows, this is overridden because we need to change the color or the outline control.
Select or deselect rows, this is overridden because we need to change the color of the outline control.
*/
- (void)_performSelection:(BOOL)select forRow:(CPInteger)rowIndex context:(id)context
- (void)_setSelectedRowIndexes:(CPIndexSet)rows
{
[super _performSelection:select forRow:rowIndex context:context];
if (_disclosureControlsForRows.length)
{
var indexes = [_selectedRowIndexes copy];
[indexes removeIndexesInRange:CPMakeRange(_disclosureControlsForRows.length, _itemsForRows.length - _disclosureControlsForRows.length)];
[[_disclosureControlsForRows objectsAtIndexes:indexes] makeObjectsPerformSelector:@selector(unsetThemeState:) withObject:CPThemeStateSelected];
}
var control = _disclosureControlsForRows[rowIndex],
selector = select ? @"setThemeState:" : @"unsetThemeState:";
[super _setSelectedRowIndexes:rows];
[control performSelector:CPSelectorFromString(selector) withObject:CPThemeStateSelected];
if (_disclosureControlsForRows.length)
{
var indexes = [_selectedRowIndexes copy];
[indexes removeIndexesInRange:CPMakeRange(_disclosureControlsForRows.length, _itemsForRows.length - _disclosureControlsForRows.length)];
[[_disclosureControlsForRows objectsAtIndexes:indexes] makeObjectsPerformSelector:@selector(setThemeState:) withObject:CPThemeStateSelected];
}
}
/*!
+11 -4
View File
@@ -5258,12 +5258,19 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
if (_implementedDelegateMethods & CPTableViewDelegate_tableView_shouldSelectRow_)
{
var shouldSelect = [_delegate tableView:self shouldSelectRow:i];
while (![_delegate tableView:self shouldSelectRow:i] && (i < [self numberOfRows] && i > 0))
shouldGoUpward ? i-- : i++; //check to see if the row can be selected if it can't be then see if the next row can be selected
/* If shouldSelect returns NO it means this row cannot be selected.
The proper behaviour is to then try to see if the next/previous
row(s) can be selected, until we hit the first one that can be.
*/
while (!shouldSelect && (i < [self numberOfRows] && i > 0))
{
shouldGoUpward ? --i : ++i; //check to see if the row can be selected. If it can't be then see if the next row can be selected.
shouldSelect = [_delegate tableView:self shouldSelectRow:i];
}
// If the index still can be selected after the loop then just return.
if (![_delegate tableView:self shouldSelectRow:i])
if (!shouldSelect)
return;
}
+8 -1
View File
@@ -2757,14 +2757,21 @@ CPTexturedBackgroundWindowMask
}
// The sheet starts hidden just above the top of a clip rect
// TODO : Make properly for the -1 in endY
var sheetFrame = [sheet frame],
sheetShadowFrame = sheet._hasShadow ? [sheet._shadowView frame] : sheetFrame,
frame = [self frame],
originX = frame.origin.x + FLOOR((frame.size.width - sheetFrame.size.width) / 2),
startFrame = CGRectMake(originX, -sheetShadowFrame.size.height, sheetFrame.size.width, sheetFrame.size.height),
endY = [_windowView bodyOffset] - [[self contentView] frame].origin.y,
endY = -1 + [_windowView bodyOffset] - [[self contentView] frame].origin.y,
endFrame = CGRectMake(originX, endY, sheetFrame.size.width, sheetFrame.size.height);
if (_toolbar && [_windowView showsToolbar] && [self isFullPlatformWindow])
{
endY += [[_toolbar _toolbarView] frameSize].height;
endFrame = CGRectMake(originX, endY, sheetFrame.size.width, sheetFrame.size.height);
}
// Move the sheet offscreen before ordering front so it doesn't appear briefly
[sheet setFrameOrigin:CGPointMake(0, -13000)];
+35 -8
View File
@@ -29,6 +29,8 @@ var _CPStandardWindowViewDividerViewHeight = 1.0;
@implementation _CPTexturedWindowHeadView : CPView
{
BOOL _isSheet @accessors(setter=setSheet:);
_CPWindowView _parentView;
CPView _gradientView;
CPView _solidView;
@@ -66,10 +68,11 @@ var _CPStandardWindowViewDividerViewHeight = 1.0;
[super layoutSubviews];
var gradientHeight = [[CPTheme defaultTheme] valueForAttributeWithName:@"gradient-height" forClass:_CPStandardWindowView],
bounds = [self bounds];
bounds = [self bounds],
bezelHeadColor = [[CPTheme defaultTheme] valueForAttributeWithName:_isSheet ? @"bezel-head-sheet-color" : @"bezel-head-color" inState:[_parentView themeState] forClass:_CPStandardWindowView];
[_gradientView setFrame:CGRectMake(0.0, 0.0, CGRectGetWidth(bounds), gradientHeight)];
[_gradientView setBackgroundColor:[[CPTheme defaultTheme] valueForAttributeWithName:@"bezel-head-color" inState:[_parentView themeState] forClass:_CPStandardWindowView]];
[_gradientView setBackgroundColor:bezelHeadColor];
[_solidView setFrame:CGRectMake(0.0, gradientHeight, CGRectGetWidth(bounds), CGRectGetHeight(bounds) - gradientHeight)];
[_solidView setBackgroundColor:[[CPTheme defaultTheme] valueForAttributeWithName:@"solid-color" forClass:_CPStandardWindowView]];
@@ -97,6 +100,7 @@ var _CPStandardWindowViewDividerViewHeight = 1.0;
CPButton _minimizeButton;
BOOL _isDocumentEdited;
BOOL _isSheet;
}
+ (CPString)defaultThemeClass
@@ -110,6 +114,7 @@ var _CPStandardWindowViewDividerViewHeight = 1.0;
@"gradient-height": [CPNull null],
@"solid-color": [CPNull null],
@"bezel-head-color": [CPNull null],
@"bezel-head-sheet-color": [CPNull null],
@"divider-color": [CPColor blackColor],
@"body-color": [CPColor whiteColor],
@"title-bar-height": 32,
@@ -224,7 +229,14 @@ var _CPStandardWindowViewDividerViewHeight = 1.0;
width = CGRectGetWidth(bounds),
headHeight = [self toolbarMaxY];
if (_isSheet && _toolbarView && [self showsToolbar])
{
headHeight = [_toolbarView frameSize].height;
[_toolbarView setFrameOrigin:CGPointMake(0.0, 0.0)];
}
[_headView setFrameSize:CGSizeMake(width, headHeight)];
[_dividerView setFrame:CGRectMake(0.0, headHeight, width, _CPStandardWindowViewDividerViewHeight)];
var dividerMinY = 0,
@@ -312,12 +324,26 @@ var _CPStandardWindowViewDividerViewHeight = 1.0;
{
[super _enableSheet:enable inWindow:parentWindow];
[_headView setHidden:enable];
[_dividerView setHidden:enable];
_isSheet = enable;
[_headView setSheet:enable];
if (_toolbarView && [self showsToolbar])
{
[_headView setHidden:NO];
[_dividerView setHidden:NO];
}
else
{
[_headView setHidden:enable];
[_dividerView setHidden:enable];
}
[_closeButton setHidden:enable];
[_minimizeButton setHidden:enable];
[_titleField setHidden:enable];
[[self window] setMovable:!enable];
if (enable)
{
[_bodyView setBackgroundColor:[[CPTheme defaultTheme] valueForAttributeWithName:@"body-color" forClass:_CPDocModalWindowView]];
@@ -333,12 +359,13 @@ var _CPStandardWindowViewDividerViewHeight = 1.0;
var theWindow = [self window],
frame = [theWindow frame],
dividerHeight = [_dividerView frame].size.height,
dy;
dy = [self toolbarMaxY] + dividerHeight;
if (_toolbarView && [self showsToolbar])
dy = [[CPTheme defaultTheme] valueForAttributeWithName:@"gradient-height" forClass:_CPStandardWindowView];
if (enable)
dy = -[_headView frame].size.height;
else
dy = [self toolbarMaxY] + dividerHeight;
dy = -dy;
var newHeight = CGRectGetHeight(frame) + dy,
newWidth = CGRectGetWidth(frame);
+3 -1
View File
@@ -742,7 +742,9 @@ _CPWindowViewResizeSlop = 3;
- (BOOL)showsToolbar
{
return YES;
var styleMaskWindow = [[self window] styleMask];
return styleMaskWindow & CPBorderlessWindowMask || styleMaskWindow & CPTitledWindowMask || styleMaskWindow & CPHUDBackgroundWindowMask || styleMaskWindow & CPBorderlessBridgeWindowMask;
}
- (CGSize)toolbarOffset
+1
View File
@@ -2687,6 +2687,7 @@ var themedButtonValues = nil,
[
[@"gradient-height", 31.0],
[@"bezel-head-color", bezelHeadColor],
[@"bezel-head-sheet-color", solidColor],
[@"solid-color", solidColor],
[@"title-font", [CPFont boldSystemFontOfSize:CPFontCurrentSystemSize]],
Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 993 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

+9
View File
@@ -2070,6 +2070,14 @@ var themedButtonValues = nil,
height: 1.0
}),
bezelSheetHeadColor = PatternColor(
"window-standard-head-sheet-solid{position}.png",
{
positions: "full",
width: 5.0,
height: 1.0
}),
bezelColor = PatternColor(
"window-standard{position}.png",
{
@@ -2104,6 +2112,7 @@ var themedButtonValues = nil,
[@"bezel-head-color", bezelHeadColor["inactive"], CPThemeStateNormal],
[@"bezel-head-color", bezelHeadColor["@"], CPThemeStateKeyWindow],
[@"bezel-head-color", bezelHeadColor["@"], CPThemeStateMainWindow],
[@"bezel-head-sheet-color", bezelSheetHeadColor],
[@"solid-color", solidColor],
[@"title-font", [CPFont boldSystemFontOfSize:CPFontCurrentSystemSize]],
File diff suppressed because it is too large. Load diff
+6 -3
View File
@@ -469,11 +469,14 @@ var _CPKeyedUnarchiverDecodeObjectAtIndex = function(self, anIndex)
if (!theClass)
theClass = CPClassFromString(className);
if (!theClass && (self._delegateSelectors & CPKeyedUnarchiverDelegate_unarchiver_cannotDecodeObjectOfClassName_originalClasses_))
theClass = [_delegate unarchiver:self cannotDecodeObjectOfClassName:className originalClasses:classes];
if (!theClass &&
(self._delegateSelectors & CPKeyedUnarchiverDelegate_unarchiver_cannotDecodeObjectOfClassName_originalClasses_))
{
theClass = [self._delegate unarchiver:self cannotDecodeObjectOfClassName:className originalClasses:classes];
}
if (!theClass)
[CPException raise:CPInvalidUnarchiveOperationException reason:@"-[CPKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (" + className + @")"];
[CPException raise:CPInvalidUnarchiveOperationException format:@"-[CPKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (%@)", className];
var savedPlistObject = self._plistObject;
+8
View File
@@ -160,6 +160,14 @@ var NumberRegex = new RegExp('(-)?(\\d*)(\\.(\\d*))?');
}
}
+ (CPString)localizedStringFromNumber:(CPNumber)num numberStyle:(CPNumberFormatterStyle)localizationStyle
{
var formatter = [[CPNumberFormatter alloc] init];
[formatter setNumberStyle:localizationStyle];
return [formatter stringFromNumber:num];
}
- (CPNumber)numberFromString:(CPString)aString
{
if (_generatesDecimalNumbers)
+630
View File
@@ -0,0 +1,630 @@
/* CPTimeZone.j
* Foundation
*
* Created by Alexandre Wilhelm
* Copyright 2012 <alexandre.wilhelmfr@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPObject.j"
@import "CPString.j"
@import "CPDate.j"
@import "CPLocale.j"
CPTimeZoneNameStyleStandard = 0;
CPTimeZoneNameStyleShortStandard = 1;
CPTimeZoneNameStyleDaylightSaving = 2;
CPTimeZoneNameStyleShortDaylightSaving = 3;
CPTimeZoneNameStyleGeneric = 4;
CPTimeZoneNameStyleShortGeneric = 5;
CPSystemTimeZoneDidChangeNotification = @"CPSystemTimeZoneDidChangeNotification";
var abbreviationDictionary,
timeDifferenceFromUTC,
knownTimeZoneNames,
defaultTimeZone,
localTimeZone,
systemTimeZone,
timeZoneDataVersion,
localizedName;
/*!
@class CPTimeZone
@ingroup foundation
@brief CPTimeZone is a class to define the behvior of time zone object (like CPDatePicker)
*/
@implementation CPTimeZone : CPObject
{
CPData _data @accessors(property=data, readonly);
CPInteger _secondsFromGMT @accessors(property=secondFromGMT, readonly);
CPString _abbreviation @accessors(property=abbreviation, readonly);
CPString _name @accessors(property=name, readonly);
}
/*! Initialize the default value of the class
*/
+ (void)initialize
{
if (self !== [CPTimeZone class])
return;
knownTimeZoneNames = [
@"America/Halifax",
@"America/Juneau",
@"America/Juneau",
@"America/Argentina/Buenos_Aires",
@"America/Halifax",
@"Asia/Dhaka",
@"America/Sao_Paulo",
@"America/Sao_Paulo",
@"Europe/London",
@"Africa/Harare",
@"America/Chicago",
@"Europe/Paris",
@"Europe/Paris",
@"America/Santiago",
@"America/Santiago",
@"America/Bogota",
@"America/Chicago",
@"Africa/Addis_Ababa",
@"America/New_York",
@"Europe/Istanbul",
@"Europe/Istanbul",
@"America/New_York",
@"GMT",
@"Asia/Dubai",
@"Asia/Hong_Kong",
@"Pacific/Honolulu",
@"Asia/Bangkok",
@"Asia/Tehran",
@"Asia/Calcutta",
@"Asia/Tokyo",
@"Asia/Seoul",
@"America/Denver",
@"Europe/Moscow",
@"Europe/Moscow",
@"America/Denver",
@"Pacific/Auckland",
@"Pacific/Auckland",
@"America/Los_Angeles",
@"America/Lima",
@"Asia/Manila",
@"Asia/Karachi",
@"America/Los_Angeles",
@"Asia/Singapore",
@"UTC",
@"Africa/Lagos",
@"Europe/Lisbon",
@"Europe/Lisbon",
@"Asia/Jakarta"
];
abbreviationDictionary = @{
@"ADT" : @"America/Halifax",
@"AKDT" : @"America/Juneau",
@"AKST" : @"America/Juneau",
@"ART" : @"America/Argentina/Buenos_Aires",
@"AST" : @"America/Halifax",
@"BDT" : @"Asia/Dhaka",
@"BRST" : @"America/Sao_Paulo",
@"BRT" : @"America/Sao_Paulo",
@"BST" : @"Europe/London",
@"CAT" : @"Africa/Harare",
@"CDT" : @"America/Chicago",
@"CEST" : @"Europe/Paris",
@"CET" : @"Europe/Paris",
@"CLST" : @"America/Santiago",
@"CLT" : @"America/Santiago",
@"COT" : @"America/Bogota",
@"CST" : @"America/Chicago",
@"EAT" : @"Africa/Addis_Ababa",
@"EDT" : @"America/New_York",
@"EEST" : @"Europe/Istanbul",
@"EET" : @"Europe/Istanbul",
@"EST" : @"America/New_York",
@"GMT" : @"GMT",
@"GST" : @"Asia/Dubai",
@"HKT" : @"Asia/Hong_Kong",
@"HST" : @"Pacific/Honolulu",
@"ICT" : @"Asia/Bangkok",
@"IRST" : @"Asia/Tehran",
@"IST" : @"Asia/Calcutta",
@"JST" : @"Asia/Tokyo",
@"KST" : @"Asia/Seoul",
@"MDT" : @"America/Denver",
@"MSD" : @"Europe/Moscow",
@"MSK" : @"Europe/Moscow",
@"MST" : @"America/Denver",
@"NZDT" : @"Pacific/Auckland",
@"NZST" : @"Pacific/Auckland",
@"PDT" : @"America/Los_Angeles",
@"PET" : @"America/Lima",
@"PHT" : @"Asia/Manila",
@"PKT" : @"Asia/Karachi",
@"PST" : @"America/Los_Angeles",
@"SGT" : @"Asia/Singapore",
@"UTC" : @"UTC",
@"WAT" : @"Africa/Lagos",
@"WEST" : @"Europe/Lisbon",
@"WET" : @"Europe/Lisbon",
@"WIT" : @"Asia/Jakarta"
};
timeDifferenceFromUTC = @{
@"ADT" : -180,
@"AKDT" : -480,
@"AKST" : -540,
@"ART" : -180,
@"AST" : -240,
@"BDT" : 360,
@"BRST" : -120,
@"BRT" : -180,
@"BST" : 60,
@"CAT" : 120,
@"CDT" : -300,
@"CEST" : 120,
@"CET" : 60,
@"CLST" : -180,
@"CLT" : -240,
@"COT" : -300,
@"CST" : -360,
@"EAT" : 180,
@"EDT" : -240,
@"EEST" : 180,
@"EET" : 120,
@"EST" : -300,
@"GMT" : 0,
@"GST" : 240,
@"HKT" : 480,
@"HST" : -600,
@"ICT" : 420,
@"IRST" : 210,
@"IST" : 330,
@"JST" : 540,
@"KST" : 540,
@"MDT" : -300,
@"MSD" : 240,
@"MSK" : 240,
@"MST" : -420,
@"NZDT" : 900,
@"NZST" : 900,
@"PDT" : -420,
@"PET" : -300,
@"PHT" : 480,
@"PKT" : 300,
@"PST" : -480,
@"SGT" : 480,
@"UTC" : 0,
@"WAT" : -540,
@"WEST" : 60,
@"WET" : 0,
@"WIT" : 540
};
var englishLocalizedName = @{
@"EDT" : [@"Eastern Standard Time", @"EST", @"Eastern Daylight Time", @"EDT", @"Eastern Time", @"ET"],
@"GMT" : [@"GMT", @"GMT", @"GMT", @"GMT", @"GMT", @"GMT"],
@"AST" : [@"Atlantic Standard Time", @"AST", @"Atlantic Daylight Time", @"ADT", @"Atlantic Time", @"AT"],
@"IRST" : [@"Iran Standard Time", @"GMT+03:30", @"Iran Daylight Time", @"GMT+03:30", @"Iran Time", @"Iran Time"],
@"ICT" : [@"Indochina Time", @"GMT+07:00", @"GMT+07:00", @"GMT+07:00", @"Indochina Time", @"Thailand Time"],
@"PET" : [@"Peru Standard Time", @"GMT-05:00", @"Peru Summer Time", @"GMT-05:00", @"Peru Standard Time", @"Peru Time"],
@"KST" : [@"Korean Standard Time", @"GMT+09:00", @"Korean Daylight Time", @"GMT+09:00", @"Korean Standard Time", @"South Korea Time"],
@"PST" : [@"Pacific Standard Time", @"PST", @"Pacific Daylight Time", @"PDT", @"Pacific Time", @"PT"],
@"CDT" : [@"Central Standard Time", @"CST", @"Central Daylight Time", @"CDT", @"Central Time", @"CT"],
@"EEST" : [@"Eastern European Standard Time", @"GMT+02:00", @"Eastern European Summer Time", @"GMT+03:00", @"Eastern European Time", @"Turkey Time"],
@"NZDT" : [@"New Zealand Standard Time", @"GMT+12:00", @"New Zealand Daylight Time", @"GMT+13:00", @"New Zealand Time", @"New Zealand Time (Auckland)"],
@"WEST" : [@"Western European Standard Time", @"GMT", @"Western European Summer Time", @"GMT+01:00", @"Western European Time", @"Portugal Time (Lisbon)"],
@"EAT" : [@"East Africa Time", @"GMT+03:00", @"GMT+03:00", @"GMT+03:00", @"East Africa Time", @"Ethiopia Time"],
@"HKT" : [@"Hong Kong Standard Time", @"GMT+08:00", @"Hong Kong Summer Time", @"GMT+08:00", @"Hong Kong Standard Time", @"Hong Kong SAR China Time"],
@"IST" : [@"India Standard Time", @"GMT+05:30", @"GMT+05:30", @"GMT+05:30", @"India Standard Time", @"India Time"],
@"MDT" : [@"Mountain Standard Time", @"MST", @"Mountain Daylight Time", @"MDT", @"Mountain Time", @"MT"],
@"NZST" : [@"New Zealand Standard Time", @"GMT+12:00", @"New Zealand Daylight Time", @"GMT+13:00", @"New Zealand Time", @"New Zealand Time (Auckland)"],
@"WIT" : [@"Western Indonesia Time", @"GMT+07:00", @"GMT+07:00", @"GMT+07:00", @"Western Indonesia Time", @"Indonesia Time (Jakarta)"],
@"ADT" : [@"Atlantic Standard Time", @"AST", @"Atlantic Daylight Time", @"ADT", @"Atlantic Time", @"AT"],
@"BST" : [@"Greenwich Mean Time", @"GMT", @"British Summer Time", @"GMT+01:00", @"United Kingdom Time", @"United Kingdom Time"],
@"ART" : [@"Argentina Standard Time", @"GMT-03:00", @"Argentina Summer Time", @"GMT-03:00", @"Argentina Standard Time", @"Argentina Time (Buenos Aires)"],
@"CAT" : [@"Central Africa Time", @"GMT+02:00", @"GMT+02:00", @"GMT+02:00", @"Central Africa Time", @"Zimbabwe Time"],
@"GST" : [@"Gulf Standard Time", @"GMT+04:00", @"GMT+04:00", @"GMT+04:00", @"Gulf Standard Time", @"United Arab Emirates Time"],
@"PDT" : [@"Pacific Standard Time", @"PST", @"Pacific Daylight Time", @"PDT", @"Pacific Time", @"PT"],
@"SGT" : [@"Singapore Standard Time", @"GMT+08:00", @"GMT+08:00", @"GMT+08:00", @"Singapore Standard Time", @"Singapore Time"],
@"COT" : [@"Colombia Standard Time", @"GMT-05:00", @"Colombia Summer Time", @"GMT-05:00", @"Colombia Standard Time", @"Colombia Time"],
@"PKT" : [@"Pakistan Standard Time", @"GMT+05:00", @"Pakistan Summer Time", @"GMT+05:00", @"Pakistan Standard Time", @"Pakistan Time"],
@"EET" : [@"Eastern European Standard Time", @"GMT+02:00", @"Eastern European Summer Time", @"GMT+03:00", @"Eastern European Time", @"Turkey Time"],
@"UTC" : [@"GMT", @"GMT", @"GMT", @"GMT", @"GMT", @"GMT"],
@"WAT" : [@"West Africa Standard Time", @"GMT+01:00", @"West Africa Summer Time", @"GMT+01:00", @"West Africa Standard Time", @"Nigeria Time"],
@"EST" : [@"Eastern Standard Time", @"EST", @"Eastern Daylight Time", @"EDT", @"Eastern Time", @"ET"],
@"JST" : [@"Japan Standard Time", @"GMT+09:00", @"Japan Daylight Time", @"GMT+09:00", @"Japan Standard Time", @"Japan Time"],
@"CLST" : [@"Chile Standard Time", @"GMT-04:00", @"Chile Summer Time", @"GMT-04:00", @"Chile Time", @"Chile Time (Santiago)"],
@"CET" : [@"Central European Standard Time", @"GMT+01:00", @"Central European Summer Time", @"GMT+02:00", @"Central European Time", @"France Time"],
@"BDT" : [@"Bangladesh Standard Time", @"GMT+06:00", @"Bangladesh Summer Time", @"GMT+06:00", @"Bangladesh Standard Time", @"Bangladesh Time"],
@"MSK" : [@"Moscow Standard Time", @"GMT+04:00", @"Moscow Summer Time", @"GMT+04:00", @"Moscow Standard Time", @"Russia Time (Moscow)"],
@"AKDT" : [@"Alaska Standard Time", @"AKST", @"Alaska Daylight Time", @"AKDT", @"Alaska Time", @"AKT"],
@"CLT" : [@"Chile Standard Time", @"GMT-04:00", @"Chile Summer Time", @"GMT-04:00", @"Chile Time", @"Chile Time (Santiago)"],
@"AKST" : [@"Alaska Standard Time", @"AKST", @"Alaska Daylight Time", @"AKDT", @"Alaska Time", @"AKT"],
@"BRST" : [@"Brasilia Standard Time", @"GMT-03:00", @"Brasilia Summer Time", @"GMT-03:00", @"Brasilia Time", @"Brazil Time (Sao Paulo)"],
@"BRT" : [@"Brasilia Standard Time", @"GMT-03:00", @"Brasilia Summer Time", @"GMT-03:00", @"Brasilia Time", @"Brazil Time (Sao Paulo)"],
@"CEST" : [@"Central European Standard Time", @"GMT+01:00", @"Central European Summer Time", @"GMT+02:00", @"Central European Time", @"France Time"],
@"CST" : [@"Central Standard Time", @"CST", @"Central Daylight Time", @"CDT", @"Central Time", @"CT"],
@"HST" : [@"Hawaii-Aleutian Standard Time", @"HST", @"Hawaii-Aleutian Daylight Time", @"HDT", @"Hawaii-Aleutian Standard Time", @"HST"],
@"MSD" : [@"Moscow Standard Time", @"GMT+04:00", @"Moscow Summer Time", @"GMT+04:00", @"Moscow Standard Time", @"Russia Time (Moscow)"],
@"MST" : [@"Mountain Standard Time", @"MST", @"Mountain Daylight Time", @"MDT", @"Mountain Time", @"MT"],
@"PHT" : [@"Philippine Standard Time", @"GMT+08:00", @"Philippine Summer Time", @"GMT+08:00", @"Philippine Standard Time", @"Philippines Time"],
@"WET" : [@"Western European Standard Time", @"GMT", @"Western European Summer Time", @"GMT+01:00", @"Western European Time", @"Portugal Time (Lisbon)"]
};
var date = [CPDate date],
abbreviation = String(String(date).split("(")[1]).split(")")[0];
localTimeZone = [self timeZoneWithAbbreviation:abbreviation];
systemTimeZone = [self timeZoneWithAbbreviation:abbreviation];
defaultTimeZone = [self timeZoneWithAbbreviation:abbreviation];
localizedName = @{
@"en" : englishLocalizedName,
@"fr" : @{},
@"de" : @{},
@"es" : @{}
};
timeZoneDataVersion = nil;
}
#pragma mark -
#pragma mark Class constructor
/*! Returns a time zone from the given abbreviation.
Returns nil if the given abbreviation doesn't match with any abbreviations
@param abbreviation the given abreviation
@return a new instance of CPTimeZone
*/
+ (id)timeZoneWithAbbreviation:(CPString)abbreviation
{
if (![abbreviationDictionary containsKey:abbreviation])
return nil;
return [[CPTimeZone alloc] _initWithName:[abbreviationDictionary valueForKey:abbreviation] abbreviation:abbreviation];
}
/*! Return a time zone from the given timeZone name
Returns nil if the given timeZone name doesn't match with any abbreviations
Raises an exception if tzName is nil
@param tzName the timeZone name
@return a new instance of CPTimeZone
*/
+ (id)timeZoneWithName:(CPString)tzName
{
return [[CPTimeZone alloc] initWithName:tzName];
}
/*! Return a time zone from the given timeZone name and data
Returns nil if the given timeZone name doesn't match with any abbreviations
Raises an exception if tzName is nil
@param tzName the timeZone name
@param data the data
@return a new instance of CPTimeZone
*/
+ (id)timeZoneWithName:(CPString)tzName data:(CPData)data
{
return [[CPTimeZone alloc] initWithName:tzName data:data];
}
/*! Return a time zone from the given seconds
Returns nil if the number of seconds doesn't match with any offset
@param seconds the number of seconds
@return a new instance of CPTimeZone
*/
+ (id)timeZoneForSecondsFromGMT:(CPInteger)seconds
{
var minutes = seconds / 60,
keys = [timeDifferenceFromUTC keyEnumerator],
key,
abbreviation = nil;
while (key = [keys nextObject])
{
var value = [timeDifferenceFromUTC valueForKey:key];
if (value == minutes)
{
abbreviation = key;
break;
}
}
if (!abbreviation)
return nil;
return [self timeZoneWithAbbreviation:abbreviation];
}
/*! @ignore
*/
+ (id)_timeZoneFromString:(CPString)aTimeZoneString style:(NSTimeZoneNameStyle)style locale:(CPLocale)_locale
{
if ([abbreviationDictionary containsKey:aTimeZoneString])
return [self timeZoneWithAbbreviation:aTimeZoneString];
var dict = [localizedName valueForKey:[_locale objectForKey:CPLocaleLanguageCode]];
keys = [dict keyEnumerator],
key;
while (key = [keys nextObject])
{
var value = [[dict valueForKey:key] objectAtIndex:style];
if ([value isEqualToString:aTimeZoneString])
return [self timeZoneWithAbbreviation:key];
}
return nil;
}
/*! @ignore
*/
+ (CPArray)_namesForStyle:(NSTimeZoneNameStyle)style locale:(CPLocale)aLocale
{
var array = [CPArray array],
dict = [localizedName valueForKey:[aLocale objectForKey:CPLocaleLanguageCode]];
keys = [dict keyEnumerator],
key;
while (key = [keys nextObject])
[array addObject:[[dict valueForKey:key] objectAtIndex:style]];
return array;
}
#pragma mark -
#pragma mark Class accessors
/*! Return the timeZoneDataVersion (not yet implemented)
*/
+ (CPString)timeZoneDataVersion
{
// TODO : don't know what to do ^^
return timeZoneDataVersion;
}
/*! Return the localTimeZone
*/
+ (CPTimeZone)localTimeZone
{
return localTimeZone;
}
/*! Return the defaultTimeZone
*/
+ (CPTimeZone)defaultTimeZone
{
return defaultTimeZone;
}
/*! Set the defaultTimeZone
@param aTimeZone the defaultTimeZone
*/
+ (void)setDefaultTimeZone:(CPTimeZone)aTimeZone
{
defaultTimeZone = aTimeZone;
}
/*! Reset the systemTimeZone
This will send the notification CPSystemTimeZoneDidChangeNotification
*/
+ (void)resetSystemTimeZone
{
var date = [CPDate date],
abbreviation = String(String(date).split("(")[1]).split(")")[0];
systemTimeZone = [self timeZoneWithAbbreviation:abbreviation];
[[CPNotification defaultCenter] postNotificationName:CPSystemTimeZoneDidChangeNotification object:systemTimeZone];
}
/*! Return the systemTimeZone
*/
+ (CPTimeZone)systemTimeZone
{
return systemTimeZone;
}
/*! Return the abbreviationDictionary
*/
+ (CPDictionary)abbreviationDictionary
{
return abbreviationDictionary;
}
/*! Set the abbreviationDictionary
@param dict
*/
+ (void)setAbbreviationDictionary:(CPDictionary)dict
{
abbreviationDictionary = dict;
}
/*! Return the knownTimeZoneNames
*/
+ (CPArray)knownTimeZoneNames
{
return knownTimeZoneNames;
}
#pragma mark -
#pragma mark Consructors
/*! Init a new time zone with the given time zone name and abbreviation
Returns nil if tzName doesn't match with any timeZoneNames or if abbreviation is nil
Raises an exception if tzName is nil
@param tzName the timeZone name
@param abbreviation the abbreviation
@return a new timeZone
*/
- (id)_initWithName:(CPString)tzName abbreviation:(CPString)abbreviation
{
if (!tzName)
[CPException raise:CPInvalidArgumentException reason:"Invalid value provided for tzName"];
if (![knownTimeZoneNames containsObject:tzName] || !abbreviation)
return nil;
if (self = [super init])
{
_name = tzName;
_abbreviation = abbreviation;
}
return self;
}
/*! Init a new time zone from the given timeZone name
Returns nil if the given timeZone name doesn't match with any abbreviations
Raises an exception if tzName is nil
@param tzName the timeZone name
@return a new instance of CPTimeZone
*/
- (id)initWithName:(CPString)tzName
{
if (!tzName)
[CPException raise:CPInvalidArgumentException reason:"Invalid value provided for tzName"];
if (![knownTimeZoneNames containsObject:tzName])
return nil;
if (self = [super init])
{
_name = tzName;
var keys = [abbreviationDictionary keyEnumerator],
key;
while (key = [keys nextObject])
{
var value = [abbreviationDictionary valueForKey:key];
if ([value isEqualToString:_name])
{
_abbreviation = key;
break;
}
}
}
return self;
}
/*! Return a time zone from the given timeZone name and data
Returns nil if the given timeZone name doesn't match with any abbreviations
Raises an exception if tzName is nil
@param tzName the timeZone name
@param data the data
@return a new instance of CPTimeZone
*/
- (id)initWithName:(CPString)tzName data:(CPData)data
{
if (self = [self initWithName:tzName])
{
_data = data;
}
return self;
}
#pragma mark -
#pragma mark Methods for CPDate
/*! Returns the abbreviation from a date
Returns nil if the date is nil
@return the abbreviation
*/
- (CPString)abbreviationForDate:(CPDate)date
{
if (!date)
return nil;
return String(String(date).split("(")[1]).split(")")[0];
}
/*! Returns the number of seconds from GMT for the given date
Returns nil if the date is nil
@param date
@return the number of seconds
*/
- (CPInteger)secondsFromGMTForDate:(CPDate)date
{
if (!date)
return nil;
var abbreviation = String(String(date).split("(")[1]).split(")")[0];
return [timeDifferenceFromUTC valueForKey:abbreviation] * 60;
}
/*! Returns the number of seconds from GMT
@return the number of seconds
*/
- (CPInteger)secondsFromGMT
{
return [timeDifferenceFromUTC valueForKey:_abbreviation] * 60;
}
#pragma mark -
#pragma mark Compars methods
/*! Returns a bool to compare tow timeZones.
This is made by the compare of the name and the data of the timeZones
@return a bool
*/
- (BOOL)isEqualToTimeZone:(CPTimeZone)aTimeZone
{
return [[aTimeZone name] isEqualToString:_name] && [aTimeZone data] == _data
}
#pragma mark -
#pragma mark Description
/*! Returns the description of the timeZone
The pattern of the description is : 'name of the timeZone' ('abbreviation of the timeZone') offset 'the timeDifferenceFromGMT'
@return the description
*/
- (CPString)description
{
return [CPString stringWithFormat:@"%s (%s) offset %i", _name, _abbreviation, [self secondsFromGMT]];
}
#pragma mark -
#pragma mark Localized methods
/*! Return a localized string from the given style and locale
@param style the style
@param locale the locale
@return a string
*/
- (CPString)localizedName:(NSTimeZoneNameStyle)style locale:(CPLocale)locale
{
if (style > 5)
return nil;
return [[[localizedName valueForKey:[locale objectForKey:CPLocaleLanguageCode]] valueForKey:_abbreviation] objectAtIndex:style];
}
@end
+1
View File
@@ -69,6 +69,7 @@
@import "CPSortDescriptor.j"
@import "CPString.j"
@import "CPTimer.j"
@import "CPTimeZone.j"
@import "CPUndoManager.j"
@import "CPURL.j"
@import "CPURLConnection.j"
File diff suppressed because it is too large. Load diff
+4
View File
@@ -30,6 +30,8 @@
[self assert:@"123,456" equals:[numberFormatter stringFromNumber:[CPNumber numberWithInt:123456]]];
[self assert:@"1,234,567" equals:[numberFormatter stringFromNumber:[CPNumber numberWithInt:1234567]]];
[self assert:@"1,234,567" equals:[CPNumberFormatter localizedStringFromNumber:[CPNumber numberWithInt:1234567] numberStyle:CPNumberFormatterDecimalStyle]];
[self assert:@"-1" equals:[numberFormatter stringFromNumber:[CPNumber numberWithInt:-1]]];
[self assert:@"-12" equals:[numberFormatter stringFromNumber:[CPNumber numberWithInt:-12]]];
[self assert:@"-123" equals:[numberFormatter stringFromNumber:[CPNumber numberWithInt:-123]]];
@@ -38,6 +40,8 @@
[self assert:@"-123,456" equals:[numberFormatter stringFromNumber:[CPNumber numberWithInt:-123456]]];
[self assert:@"-1,234,567" equals:[numberFormatter stringFromNumber:[CPNumber numberWithInt:-1234567]]];
[self assert:@"-1,234,567" equals:[CPNumberFormatter localizedStringFromNumber:[CPNumber numberWithInt:-1234567] numberStyle:CPNumberFormatterDecimalStyle]];
[numberFormatter setGroupingSeparator:@" "];
[self assert:@"1" equals:[numberFormatter stringFromNumber:[CPNumber numberWithInt:1]]];
[self assert:@"12" equals:[numberFormatter stringFromNumber:[CPNumber numberWithInt:12]]];
+298
View File
@@ -0,0 +1,298 @@
/* CPTimeZoneTest.j
* Foundation
*
* Created by Alexandre Wilhelm
* Copyright 2012 <alexandre.wilhelmfr@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/Foundation.j>
@import <OJUnit/OJTestCase.j>
@implementation CPTimeZoneTest : OJTestCase
{
CPLocale _locale;
CPData _data;
CPDate _date;
}
- (void)setUp
{
_locale = [[CPLocale alloc] initWithLocaleIdentifier:@"en_US"];
_data = [CPData dataWithRawString:@"Data with string"];
_date = [[CPDate alloc] initWithString:@"2011-10-05 16:34:38 +0900"];
}
- (void)tearDown
{
}
- (void)testTimeZoneWithAbbreviation
{
var timeZone = [CPTimeZone timeZoneWithAbbreviation:@"PDT"];
[self assert:[timeZone name] equals:@"America/Los_Angeles"];
[self assert:[timeZone abbreviation] equals:@"PDT"];
[self assert:[timeZone secondsFromGMT] equals:(-420 * 60)];
[self assert:[timeZone description] equals:@"America/Los_Angeles (PDT) offset -25200"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleStandard locale:_locale] equals:@"Pacific Standard Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortStandard locale:_locale] equals:@"PST"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleDaylightSaving locale:_locale] equals:@"Pacific Daylight Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortDaylightSaving locale:_locale] equals:@"PDT"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleGeneric locale:_locale] equals:@"Pacific Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortGeneric locale:_locale] equals:@"PT"];
}
- (void)testTimeZoneWithWrongAbbreviation
{
var timeZone = [CPTimeZone timeZoneWithAbbreviation:@"PDTezdez"];
[self assert:timeZone equals:nil];
}
- (void)testTimeZoneWithName
{
var timeZone = [CPTimeZone timeZoneWithName:@"America/Los_Angeles"];
[self assert:[timeZone name] equals:@"America/Los_Angeles"];
[self assert:[timeZone abbreviation] equals:@"PDT"];
[self assert:[timeZone secondsFromGMT] equals:(-420 * 60)];
[self assert:[timeZone description] equals:@"America/Los_Angeles (PDT) offset -25200"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleStandard locale:_locale] equals:@"Pacific Standard Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortStandard locale:_locale] equals:@"PST"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleDaylightSaving locale:_locale] equals:@"Pacific Daylight Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortDaylightSaving locale:_locale] equals:@"PDT"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleGeneric locale:_locale] equals:@"Pacific Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortGeneric locale:_locale] equals:@"PT"];
}
- (void)testTimeZoneWithWrongName
{
var timeZone = [CPTimeZone timeZoneWithName:@"America/Los_Angelesezdez"];
[self assert:timeZone equals:nil];
}
- (void)testexceptionTimeZoneWithNilNameWithData
{
try
{
var timeZone = [CPTimeZone timeZoneWithName:nil];
[self fail:"Invalid value provided for tzName"];
}
catch (e)
{
}
}
- (void)testTimeZoneWithNameWithData
{
var timeZone = [CPTimeZone timeZoneWithName:@"America/Los_Angeles" data:_data];
[self assert:[timeZone name] equals:@"America/Los_Angeles"];
[self assert:[timeZone abbreviation] equals:@"PDT"];
[self assert:[timeZone secondsFromGMT] equals:(-420 * 60)];
[self assert:[timeZone data] equals:_data];
[self assert:[timeZone description] equals:@"America/Los_Angeles (PDT) offset -25200"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleStandard locale:_locale] equals:@"Pacific Standard Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortStandard locale:_locale] equals:@"PST"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleDaylightSaving locale:_locale] equals:@"Pacific Daylight Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortDaylightSaving locale:_locale] equals:@"PDT"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleGeneric locale:_locale] equals:@"Pacific Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortGeneric locale:_locale] equals:@"PT"];
}
- (void)testTimeZoneWithWrongNameWithData
{
var timeZone = [CPTimeZone timeZoneWithName:@"America/Los_Angelesezdez" data:_data];
[self assert:timeZone equals:nil];
}
- (void)testexceptionTimeZoneWithNilNameWithData
{
try
{
var timeZone = [CPTimeZone timeZoneWithName:nil data:_data];
[self fail:"Invalid value provided for tzName"];
}
catch (e)
{
}
}
- (void)testTimeZoneWithSecondsFromGMT
{
var timeZone = [CPTimeZone timeZoneForSecondsFromGMT:(-600 * 60)];
[self assert:[timeZone name] equals:@"Pacific/Honolulu"];
[self assert:[timeZone abbreviation] equals:@"HST"];
[self assert:[timeZone secondsFromGMT] equals:(-600 * 60)];
[self assert:[timeZone description] equals:@"Pacific/Honolulu (HST) offset -36000"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleStandard locale:_locale] equals:@"Hawaii-Aleutian Standard Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortStandard locale:_locale] equals:@"HST"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleDaylightSaving locale:_locale] equals:@"Hawaii-Aleutian Daylight Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortDaylightSaving locale:_locale] equals:@"HDT"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleGeneric locale:_locale] equals:@"Hawaii-Aleutian Standard Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortGeneric locale:_locale] equals:@"HST"];
}
- (void)testTimeZoneWithWrongSecondsFromGMT
{
var timeZone = [CPTimeZone timeZoneForSecondsFromGMT:(-421 * 60)];
[self assert:timeZone equals:nil];
}
- (void)testInitTimeZoneWithName
{
var timeZone = [[CPTimeZone alloc] initWithName:@"America/Los_Angeles"];
[self assert:[timeZone name] equals:@"America/Los_Angeles"];
[self assert:[timeZone abbreviation] equals:@"PDT"];
[self assert:[timeZone secondsFromGMT] equals:(-420 * 60)];
[self assert:[timeZone description] equals:@"America/Los_Angeles (PDT) offset -25200"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleStandard locale:_locale] equals:@"Pacific Standard Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortStandard locale:_locale] equals:@"PST"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleDaylightSaving locale:_locale] equals:@"Pacific Daylight Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortDaylightSaving locale:_locale] equals:@"PDT"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleGeneric locale:_locale] equals:@"Pacific Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortGeneric locale:_locale] equals:@"PT"];
}
- (void)testInitTimeZoneWithWrongName
{
var timeZone = [[CPTimeZone alloc] initWithName:@"America/Los_Angelesezdez"];
[self assert:timeZone equals:nil];
}
- (void)testexceptionInitTimeZoneWithNilName
{
try
{
var timeZone = [[CPTimeZone alloc] initWithName:nil];
[self fail:"Invalid value provided for tzName"];
}
catch (e)
{
}
}
- (void)testInitTimeZoneWithNameWithData
{
var timeZone = [[CPTimeZone alloc] initWithName:@"America/Los_Angeles" data:_data];
[self assert:[timeZone name] equals:@"America/Los_Angeles"];
[self assert:[timeZone abbreviation] equals:@"PDT"];
[self assert:[timeZone secondsFromGMT] equals:(-420 * 60)];
[self assert:[timeZone data] equals:_data];
[self assert:[timeZone description] equals:@"America/Los_Angeles (PDT) offset -25200"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleStandard locale:_locale] equals:@"Pacific Standard Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortStandard locale:_locale] equals:@"PST"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleDaylightSaving locale:_locale] equals:@"Pacific Daylight Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortDaylightSaving locale:_locale] equals:@"PDT"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleGeneric locale:_locale] equals:@"Pacific Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortGeneric locale:_locale] equals:@"PT"];
}
- (void)testInitTimeZoneWithWrongNameWithData
{
var timeZone = [[CPTimeZone alloc] initWithName:@"America/Los_Angelesezdez" data:_data];
[self assert:timeZone equals:nil];
}
- (void)testexceptionInitTimeZoneWithNilNameWithData
{
try
{
var timeZone = [[CPTimeZone alloc] initWithName:nil data:_data];
[self fail:"Invalid value provided for tzName"];
}
catch (e)
{
}
}
- (void)testAbbreviationWithDate
{
var timeZone = [CPTimeZone localTimeZone],
abbreviation = [timeZone abbreviationForDate:_date];
[self assert:abbreviation equals:String(String(_date).split("(")[1]).split(")")[0]];
}
- (void)testAbbreviationWithNilDate
{
var timeZone = [CPTimeZone localTimeZone],
abbreviation = [timeZone abbreviationForDate:nil];
[self assert:abbreviation equals:nil];
}
- (void)testSecondsFromGMTForDate
{
var timeZone = [CPTimeZone localTimeZone],
seconds = [timeZone secondsFromGMTForDate:_date];
[self assert:seconds equals:(_date.getTimezoneOffset() * -60)];
}
- (void)testSecondsFromGMTForDateWithNilDate
{
var timeZone = [CPTimeZone localTimeZone],
seconds = [timeZone secondsFromGMTForDate:nil];
[self assert:seconds equals:nil];
}
- (void)testSecondsFromGMT
{
var timeZone = [[CPTimeZone alloc] initWithName:@"America/Los_Angeles"];
[self assert:[timeZone secondsFromGMT] equals:(-420 * 60)];
}
- (void)testDescription
{
var timeZone = [[CPTimeZone alloc] initWithName:@"America/Los_Angeles"];
[self assert:[timeZone description] equals:@"America/Los_Angeles (PDT) offset -25200"];
}
- (void)testLocalizedName
{
var timeZone = [[CPTimeZone alloc] initWithName:@"America/Los_Angeles"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleStandard locale:_locale] equals:@"Pacific Standard Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortStandard locale:_locale] equals:@"PST"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleDaylightSaving locale:_locale] equals:@"Pacific Daylight Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortDaylightSaving locale:_locale] equals:@"PDT"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleGeneric locale:_locale] equals:@"Pacific Time"];
[self assert:[timeZone localizedName:CPTimeZoneNameStyleShortGeneric locale:_locale] equals:@"PT"];
}
- (void)testEqualTrueToTimeZone
{
var timeZone1 = [[CPTimeZone alloc] initWithName:@"America/Los_Angeles"],
timeZone2 = [[CPTimeZone alloc] initWithName:@"America/Los_Angeles"];
[self assert:[timeZone1 isEqualToTimeZone:timeZone2] equals:YES];
}
- (void)testEqualFalseToTimeZone
{
var timeZone1 = [[CPTimeZone alloc] initWithName:@"America/Los_Angeles"],
timeZone2 = [[CPTimeZone alloc] initWithName:@"Pacific/Honolulu"];
[self assert:[timeZone1 isEqualToTimeZone:timeZone2] equals:NO];
}
@end
+75 -2
View File
@@ -12,6 +12,7 @@
{
CPWindow wind;
CPWindow sheet;
CPWindow secondSheet;
CPTextField textField;
}
@@ -21,10 +22,19 @@
[wind setMinSize:CGSizeMake(300, 200)];
[wind setTitle:@"Untitled"];
sheet = [[CPWindow alloc] initWithContentRect:CGRectMake(0, 0, 300, 100) styleMask:CPDocModalWindowMask | CPResizableWindowMask];
sheet = [[CPWindow alloc] initWithContentRect:CGRectMake(50, 50, 300, 100) styleMask:CPTitledWindowMask | CPResizableWindowMask];
[sheet setMinSize:CGSizeMake(300, 100)];
[sheet setMaxSize:CGSizeMake(600, 300)];
secondSheet = [[CPWindow alloc] initWithContentRect:CGRectMake(50, 50, 300, 50) styleMask:CPTitledWindowMask | CPResizableWindowMask];
[secondSheet setMinSize:CGSizeMake(300, 100)];
[secondSheet setMaxSize:CGSizeMake(600, 300)];
toolbar = [CPToolbar new];
[toolbar setDisplayMode:CPToolbarDisplayModeIconAndLabel]
[toolbar setDelegate:self];
[secondSheet setToolbar:toolbar];
var sheetContent = [sheet contentView];
textField = [[CPTextField alloc] initWithFrame:CGRectMake(10, 30, 280, 30)];
@@ -51,19 +61,50 @@
[sheetContent addSubview:okButton];
[sheetContent addSubview:cancelButton];
var secondSheetContent = [secondSheet contentView];
var okButton2 = [[CPButton alloc] initWithFrame:CGRectMake(180, 25, 50, buttonHeight)];
[okButton2 setTitle:"OK"];
[okButton2 setTarget:self];
[okButton2 setTag:1];
[okButton2 setAction:@selector(closeSecondSheet:)];
[okButton2 setAutoresizingMask:CPViewMinXMargin | CPViewMinYMargin];
var cancelButton2 = [[CPButton alloc] initWithFrame:CGRectMake(70, 25, 100, buttonHeight)];
[cancelButton2 setTitle:"Cancel"];
[cancelButton2 setTarget:self];
[cancelButton2 setTag:0];
[cancelButton2 setAction:@selector(closeSecondSheet:)];
[cancelButton2 setAutoresizingMask:CPViewMinXMargin | CPViewMinYMargin];
[secondSheetContent addSubview:okButton2];
[secondSheetContent addSubview:cancelButton2];
var displayButton = [[CPButton alloc] initWithFrame:CGRectMake(200, 150, 100, buttonHeight)];
[displayButton setTitle:"Display Sheet"];
[displayButton setTarget:self];
[displayButton setAction:@selector(displaySheet:)];
[[wind contentView] addSubview:displayButton];
var displayButton = [[CPButton alloc] initWithFrame:CGRectMake(160, 180, 180, buttonHeight)];
[displayButton setTitle:"Display Sheet with toolbar"];
[displayButton setTarget:self];
[displayButton setAction:@selector(displaySheetWithToolBar:)];
[[wind contentView] addSubview:displayButton];
[wind orderFront:self]
}
- (void)displaySheetWithToolBar:(id)sender
{
[CPApp beginSheet:secondSheet modalForWindow:wind modalDelegate:self didEndSelector:@selector(didEndSheet:returnCode:contextInfo:) contextInfo:nil];
}
- (void)displaySheet:(id)sender
{
[textField setStringValue:""];
[sheet makeFirstResponder:textField];
[sheet setToolbar:nil];
[CPApp beginSheet:sheet modalForWindow:wind modalDelegate:self didEndSelector:@selector(didEndSheet:returnCode:contextInfo:) contextInfo:nil];
}
@@ -73,14 +114,46 @@
[CPApp endSheet:sheet returnCode:[sender tag]];
}
- (void)closeSecondSheet:(id)sender
{
[CPApp endSheet:secondSheet returnCode:0];
}
- (void)didEndSheet:(CPWindow)aSheet returnCode:(int)returnCode contextInfo:(id)contextInfo
{
var str = [textField stringValue];
[sheet orderOut:self];
[aSheet orderOut:self];
if (returnCode == CPOKButton && [str length] > 0)
[wind setTitle:str];
}
- (CPArray)toolbarDefaultItemIdentifiers:(CPToolbar)toolbar
{
return ["item1", "item2"];
}
- (CPArray)toolbarAllowedItemIdentifiers:(CPToolbar)toolbar
{
return ["item1", "item2"];
}
- (CPToolbarItem)toolbar:(CPToolbar)toolbar itemForItemIdentifier:(CPString)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag
{
var toolbarItem = [[CPToolbarItem alloc] initWithItemIdentifier:itemIdentifier];
if (itemIdentifier == "item1")
{
[toolbarItem setLabel:@"Color"];
[toolbarItem setImage:[[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:@"CPImageNameColorPanel.png"] size:CGSizeMake(26, 29)]];
return toolbarItem;
}
else if (itemIdentifier == "item2")
{
[toolbarItem setLabel:@"Small New"];
[toolbarItem setImage:[[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:@"New.png"] size:CGSizeMake(16, 16)]];
return toolbarItem;
}
}
@end
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 B

@@ -0,0 +1,42 @@
/*
* AppController.j
* CPDateFormatterTest
*
* Created by You on April 9, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@implementation AppController : CPObject
{
@outlet CPWindow theWindow;
@outlet CPDatePicker datePicker;
@outlet CPTextField labelDateFormatter;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
}
- (void)awakeFromCib
{
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
// In this case, we want the window from Cib to become our full browser window
[theWindow setFullPlatformWindow:YES];
[[datePicker formatter] setTimeZone:[CPTimeZone timeZoneForSecondsFromGMT:60 * 60 * 2]];
[datePicker setDateValue:[CPDate date]];
}
- (@action)datePickerAction:(id)sender
{
[labelDateFormatter setStringValue:[[sender formatter] stringFromDate:[sender dateValue]]];
}
@end
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Main cib file base name</key>
<string>MainMenu.cib</string>
<key>CPBundleName</key>
<string>CPDateFormatterTest</string>
</dict>
</plist>
+94
View File
@@ -0,0 +1,94 @@
/*
* Jakefile
* CPDateFormatterTest
*
* Created by You on April 9, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
var ENV = require("system").env,
FILE = require("file"),
JAKE = require("jake"),
task = JAKE.task,
FileList = JAKE.FileList,
app = require("cappuccino/jake").app,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
OS = require("os");
app ("CPDateFormatterTest", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "CPDateFormatterTest.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("CPDateFormatterTest");
task.setIdentifier("com.yourcompany.CPDateFormatterTest");
task.setVersion("1.0");
task.setAuthor("Your Company");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("CPDateFormatterTest");
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
task.setResources(new FileList("Resources/**"));
task.setIndexFilePath("index.html");
task.setInfoPlistPath("Info.plist");
task.setNib2CibFlags("-R Resources/");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O");
});
task ("default", ["CPDateFormatterTest"], function()
{
printResults(configuration);
});
task ("build", ["default"]);
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
});
task ("run", ["debug"], function()
{
OS.system(["open", FILE.join("Build", "Debug", "CPDateFormatterTest", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "CPDateFormatterTest", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "CPDateFormatterTest"));
OS.system(["press", "-f", FILE.join("Build", "Release", "CPDateFormatterTest"), FILE.join("Build", "Deployment", "CPDateFormatterTest")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "CPDateFormatterTest"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "CPDateFormatterTest"), FILE.join("Build", "Desktop", "CPDateFormatterTest", "CPDateFormatterTest.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "CPDateFormatterTest", "CPDateFormatterTest.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "CPDateFormatterTest"));
print("----------------------------");
}
@@ -0,0 +1 @@
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;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;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;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;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;20E;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;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;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;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;54E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;83E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;100E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;104E;D;K;6;CP$UIDd;3;105E;D;K;6;CP$UIDd;3;106E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;109E;D;K;6;CP$UIDd;3;110E;D;K;6;CP$UIDd;3;111E;D;K;6;CP$UIDd;3;112E;D;K;6;CP$UIDd;3;113E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;117E;D;K;6;CP$UIDd;3;118E;D;K;6;CP$UIDd;3;119E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;3;121E;D;K;6;CP$UIDd;3;122E;D;K;6;CP$UIDd;3;124E;D;K;6;CP$UIDd;3;126E;D;K;6;CP$UIDd;3;128E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;130E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;131E;D;K;6;CP$UIDd;3;133E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;113E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;3;119E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;3;124E;D;K;6;CP$UIDd;3;126E;D;K;6;CP$UIDd;3;128E;D;K;6;CP$UIDd;3;126E;D;K;6;CP$UIDd;3;130E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;3;128E;E;E;DLine truncated
File diff suppressed because it is too large. Load diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<!--
index-debug.html
CPDateFormatterTest
Created by You on April 9, 2013.
Copyright 2013, Your Company All rights reserved.
-->
<head>
<meta charset="utf-8">
<!--[if lte IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
<![endif]-->
<!--[if gte IE 9]>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<![endif]-->
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon" href="Resources/icon.png">
<link rel="apple-touch-startup-image" href="Resources/default.png">
<title>CPDateFormatterTest</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
</script>
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
<script type="text/javascript">
objj_msgSend_reset();
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
//objj_msgSend_decorate(objj_backtrace_decorator);
// Uncomment to supress exceptions that take place inside a message
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
// Uncomment to enable runtime type checking:
//objj_msgSend_decorate(objj_typecheck_decorator);
// Uncomment (along with both above) to print backtraces on type check errors:
//objj_typecheck_prints_backtrace = true;
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
//CPLogUnregister(CPLogDefault);
// Uncomment to enable a specific logger:
//CPLogRegister(CPLogConsole);
//CPLogRegister(CPLogPopup);
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
// the class name of the view that created them. Comment this or set to false to disable.
appkit_tag_dom_elements = true;
</script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading CPDateFormatterTest...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino-project.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
@@ -0,0 +1,82 @@
<!DOCTYPE html>
<html lang="en">
<!--
index.html
CPDateFormatterTest
Created by You on April 9, 2013.
Copyright 2013, Your Company All rights reserved.
-->
<head>
<meta charset="utf-8">
<!--[if lte IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
<![endif]-->
<!--[if gte IE 9]>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<![endif]-->
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon" href="Resources/icon.png">
<link rel="apple-touch-startup-image" href="Resources/default.png">
<title>CPDateFormatterTest</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
</script>
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading CPDateFormatterTest...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino-project.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
/*
* AppController.j
* CPDateFormatterTest
*
* Created by You on April 9, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
@@ -1 +1 @@
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;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;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;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;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;20E;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;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;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;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;55E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;79E;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;80E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;100E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;104E;D;K;6;CP$UIDd;3;105E;D;K;6;CP$UIDd;3;106E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;109E;D;K;6;CP$UIDd;3;110E;D;K;6;CP$UIDd;3;111E;D;K;6;CP$UIDd;3;112E;D;K;6;CP$UIDd;3;113E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;117E;D;K;6;CP$UIDd;3;118E;D;K;6;CP$UIDd;3;119E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;3;121E;D;K;6;CP$UIDd;3;122E;D;K;6;CP$UIDd;3;123E;D;K;6;CP$UIDd;3;124E;D;K;6;CP$UIDd;3;125E;D;K;6;CP$UIDd;3;126E;D;K;6;CP$UIDd;3;127E;D;K;6;CP$UIDd;3;128E;D;K;6;CP$UIDd;3;129E;D;K;6;CP$UIDd;3;130E;D;K;6;CP$UIDd;3;131E;D;K;6;CP$UIDd;3;132E;D;K;6;CP$UIDd;3;133E;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;135E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;137E;D;K;6;CP$UIDd;3;138E;D;K;6;CP$UIDd;3;139E;D;K;6;CP$UIDd;3;140E;D;K;6;CP$UIDd;3;141E;D;K;6;CP$UIDd;3;142E;D;K;6;CP$UIDd;3;143E;D;K;6;CP$UIDd;3;144E;D;K;6;CP$UIDd;3;145E;D;K;6;CP$UIDd;3;146E;D;K;6;CP$UIDd;3;147E;D;K;6;CP$UIDd;3;148E;D;K;6;CP$UIDd;3;150E;D;K;6;CP$UIDd;3;151E;D;K;6;CP$UIDd;3;153E;D;K;6;CP$UIDd;3;155E;D;K;6;CP$UIDd;3;157E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;159E;D;K;6;CP$UIDd;3;161E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;162E;D;K;6;CP$UIDd;3;163E;D;K;6;CP$UIDd;3;164E;D;K;6;CP$UIDd;3;165E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;166E;D;K;6;CP$UIDd;3;167E;D;K;6;CP$UIDd;3;168E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;169E;D;K;6;CP$UIDd;3;170E;D;K;6;CP$UIDd;3;171E;D;K;6;CP$UIDd;3;172E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;173E;D;K;6;CP$UIDd;3;174E;D;K;6;CP$UIDd;3;175E;D;K;6;CP$UIDd;3;177E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;178E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;179E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;181E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;182E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;183E;D;K;6;CP$UIDd;3;184E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;185E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;186E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;187E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;188E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;189E;D;K;6;CP$UIDd;3;190E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;191E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;192E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;193E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;194E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;195E;D;K;6;CP$UIDd;1;0E;DLine truncated
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;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;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;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;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;19E;D;K;6;CP$UIDd;2;20E;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;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;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;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;55E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;57E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;79E;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;80E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;100E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;104E;D;K;6;CP$UIDd;3;105E;D;K;6;CP$UIDd;3;106E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;109E;D;K;6;CP$UIDd;3;110E;D;K;6;CP$UIDd;3;111E;D;K;6;CP$UIDd;3;112E;D;K;6;CP$UIDd;3;113E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;117E;D;K;6;CP$UIDd;3;118E;D;K;6;CP$UIDd;3;119E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;3;121E;D;K;6;CP$UIDd;3;122E;D;K;6;CP$UIDd;3;123E;D;K;6;CP$UIDd;3;124E;D;K;6;CP$UIDd;3;125E;D;K;6;CP$UIDd;3;126E;D;K;6;CP$UIDd;3;127E;D;K;6;CP$UIDd;3;128E;D;K;6;CP$UIDd;3;129E;D;K;6;CP$UIDd;3;130E;D;K;6;CP$UIDd;3;131E;D;K;6;CP$UIDd;3;132E;D;K;6;CP$UIDd;3;133E;D;K;6;CP$UIDd;3;134E;D;K;6;CP$UIDd;3;135E;D;K;6;CP$UIDd;3;136E;D;K;6;CP$UIDd;3;137E;D;K;6;CP$UIDd;3;138E;D;K;6;CP$UIDd;3;139E;D;K;6;CP$UIDd;3;140E;D;K;6;CP$UIDd;3;141E;D;K;6;CP$UIDd;3;142E;D;K;6;CP$UIDd;3;143E;D;K;6;CP$UIDd;3;144E;D;K;6;CP$UIDd;3;145E;D;K;6;CP$UIDd;3;146E;D;K;6;CP$UIDd;3;147E;D;K;6;CP$UIDd;3;148E;D;K;6;CP$UIDd;3;150E;D;K;6;CP$UIDd;3;151E;D;K;6;CP$UIDd;3;153E;D;K;6;CP$UIDd;3;155E;D;K;6;CP$UIDd;3;157E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;159E;D;K;6;CP$UIDd;3;161E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;162E;D;K;6;CP$UIDd;3;163E;D;K;6;CP$UIDd;3;164E;D;K;6;CP$UIDd;3;165E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;166E;D;K;6;CP$UIDd;3;167E;D;K;6;CP$UIDd;3;168E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;169E;D;K;6;CP$UIDd;3;170E;D;K;6;CP$UIDd;3;171E;D;K;6;CP$UIDd;3;172E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;173E;D;K;6;CP$UIDd;3;174E;D;K;6;CP$UIDd;3;175E;D;K;6;CP$UIDd;3;177E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;178E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;179E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;181E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;182E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;183E;D;K;6;CP$UIDd;3;184E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;185E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;186E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;187E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;188E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;189E;D;K;6;CP$UIDd;3;190E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;191E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;192E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;193E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;194E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;195E;D;K;6;CP$UIDd;1;0E;DLine truncated
+43
View File
@@ -0,0 +1,43 @@
/*
* AppController.j
* CPTimeZone
*
* Created by You on April 16, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@implementation AppController : CPObject
{
@outlet CPWindow theWindow;
@outlet CPDatePicker datePicker;
@outlet CPPopUpButton popUpButton;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
}
- (void)awakeFromCib
{
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
// In this case, we want the window from Cib to become our full browser window
[theWindow setFullPlatformWindow:YES];
[datePicker setDateValue:[CPDate date]];
[popUpButton addItemsWithTitles:[CPTimeZone knownTimeZoneNames]];
[datePicker setTimeZone:[CPTimeZone timeZoneWithName:[[CPTimeZone knownTimeZoneNames] firstObject]]];
}
- (@action)changedTimeZone:(id)sender
{
[datePicker setTimeZone:[CPTimeZone timeZoneWithName:[[CPTimeZone knownTimeZoneNames] objectAtIndex:[sender selectedIndex ]]]];
}
@end
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Main cib file base name</key>
<string>MainMenu.cib</string>
<key>CPBundleName</key>
<string>CPTimeZone</string>
<key>CPBundleVersion</key>
<string>1.0</string>
<key>CPHumanReadableCopyright</key>
<string>Copyright © 2013, Your Company All rights reserved.</string>
</dict>
</plist>
+93
View File
@@ -0,0 +1,93 @@
/*
* Jakefile
* CPTimeZone
*
* Created by You on April 16, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
var ENV = require("system").env,
FILE = require("file"),
JAKE = require("jake"),
task = JAKE.task,
FileList = JAKE.FileList,
app = require("cappuccino/jake").app,
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
OS = require("os");
app ("CPTimeZone", function(task)
{
task.setBuildIntermediatesPath(FILE.join("Build", "CPTimeZone.build", configuration));
task.setBuildPath(FILE.join("Build", configuration));
task.setProductName("CPTimeZone");
task.setIdentifier("com.yourcompany.CPTimeZone");
task.setVersion("1.0");
task.setAuthor("Your Company");
task.setEmail("feedback @nospam@ yourcompany.com");
task.setSummary("CPTimeZone");
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
task.setResources(new FileList("Resources/**"));
task.setIndexFilePath("index.html");
task.setInfoPlistPath("Info.plist");
if (configuration === "Debug")
task.setCompilerFlags("-DDEBUG -g");
else
task.setCompilerFlags("-O");
});
task ("default", ["CPTimeZone"], function()
{
printResults(configuration);
});
task ("build", ["default"]);
task ("debug", function()
{
ENV["CONFIGURATION"] = "Debug";
JAKE.subjake(["."], "build", ENV);
});
task ("release", function()
{
ENV["CONFIGURATION"] = "Release";
JAKE.subjake(["."], "build", ENV);
});
task ("run", ["debug"], function()
{
OS.system(["open", FILE.join("Build", "Debug", "CPTimeZone", "index.html")]);
});
task ("run-release", ["release"], function()
{
OS.system(["open", FILE.join("Build", "Release", "CPTimeZone", "index.html")]);
});
task ("deploy", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Deployment", "CPTimeZone"));
OS.system(["press", "-f", FILE.join("Build", "Release", "CPTimeZone"), FILE.join("Build", "Deployment", "CPTimeZone")]);
printResults("Deployment")
});
task ("desktop", ["release"], function()
{
FILE.mkdirs(FILE.join("Build", "Desktop", "CPTimeZone"));
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "CPTimeZone"), FILE.join("Build", "Desktop", "CPTimeZone", "CPTimeZone.app"));
printResults("Desktop")
});
task ("run-desktop", ["desktop"], function()
{
OS.system([FILE.join("Build", "Desktop", "CPTimeZone", "CPTimeZone.app", "Contents", "MacOS", "NativeHost"), "-i"]);
});
function printResults(configuration)
{
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "CPTimeZone"));
print("----------------------------");
}
@@ -0,0 +1 @@
280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;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;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;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;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;20E;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;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;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;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;54E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;83E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;100E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;104E;D;K;6;CP$UIDd;3;105E;D;K;6;CP$UIDd;3;106E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;109E;D;K;6;CP$UIDd;3;110E;D;K;6;CP$UIDd;3;111E;D;K;6;CP$UIDd;3;112E;D;K;6;CP$UIDd;3;113E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;117E;D;K;6;CP$UIDd;3;118E;D;K;6;CP$UIDd;3;119E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;3;121E;D;K;6;CP$UIDd;3;122E;D;K;6;CP$UIDd;3;124E;D;K;6;CP$UIDd;3;126E;D;K;6;CP$UIDd;3;128E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;130E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;131E;D;K;6;CP$UIDd;3;132E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;113E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;3;119E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;3;124E;D;K;6;CP$UIDd;3;126E;D;K;6;CP$UIDd;3;128E;D;K;6;CP$UIDd;3;126E;D;K;6;CP$UIDd;3;130E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;3;130E;E;E;DLine truncated
File diff suppressed because it is too large. Load diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

+112
View File
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<!--
index-debug.html
CPTimeZone
Created by You on April 16, 2013.
Copyright 2013, Your Company All rights reserved.
-->
<head>
<meta charset="utf-8">
<!--[if lte IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
<![endif]-->
<!--[if gte IE 9]>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<![endif]-->
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon" href="Resources/icon.png">
<link rel="apple-touch-startup-image" href="Resources/default.png">
<title>CPTimeZone</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
</script>
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
<script type="text/javascript">
objj_msgSend_reset();
// DEBUG OPTIONS:
// Uncomment to enable printing of backtraces on exceptions:
//objj_msgSend_decorate(objj_backtrace_decorator);
// Uncomment to supress exceptions that take place inside a message
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
// Uncomment to enable runtime type checking:
//objj_msgSend_decorate(objj_typecheck_decorator);
// Uncomment (along with both above) to print backtraces on type check errors:
//objj_typecheck_prints_backtrace = true;
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
//CPLogUnregister(CPLogDefault);
// Uncomment to enable a specific logger:
//CPLogRegister(CPLogConsole);
//CPLogRegister(CPLogPopup);
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
// the class name of the view that created them. Comment this or set to false to disable.
appkit_tag_dom_elements = true;
</script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading CPTimeZone...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino-project.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
+82
View File
@@ -0,0 +1,82 @@
<!DOCTYPE html>
<html lang="en">
<!--
index.html
CPTimeZone
Created by You on April 16, 2013.
Copyright 2013, Your Company All rights reserved.
-->
<head>
<meta charset="utf-8">
<!--[if lte IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
<![endif]-->
<!--[if gte IE 9]>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<![endif]-->
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon" href="Resources/icon.png">
<link rel="apple-touch-startup-image" href="Resources/default.png">
<title>CPTimeZone</title>
<script type="text/javascript">
OBJJ_MAIN_FILE = "main.j";
</script>
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
<style type="text/css">
body{margin:0; padding:0;}
#container {position: absolute; top:50%; left:50%;}
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
</style>
<!--[if lt IE 7]>
<STYLE type="text/css">
#container { position: relative; top: 50%; }
#content { position: relative;}
</STYLE>
<![endif]-->
</head>
<body style="">
<div id="cappuccino-body">
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
<script type="text/javascript">
document.write("<div id='container'><p id='content'>" +
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
"Loading CPTimeZone...</p></div>");
</script>
<noscript>
<div id="container">
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino-project.org/noscript">Show me how to enable JavaScript</a></p>
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
</ul>
</div>
</div>
</noscript>
</div>
</div>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
/*
* AppController.j
* CPTimeZone
*
* Created by You on April 16, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import "AppController.j"
function main(args, namedArgs)
{
CPApplicationMain(args, namedArgs);
}
@@ -11,14 +11,15 @@
@implementation AppController : CPObject
{
CPImage iconImage;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];
contentView = [theWindow contentView],
tableView = [[CPTableView alloc] initWithFrame:CGRectMake(0.0, 0.0, 400.0, 400.0)];
tableView = [[CPTableView alloc] initWithFrame:CGRectMake(0.0, 0.0, 400.0, 400.0)];
[tableView setAllowsMultipleSelection:YES];
[tableView setAllowsColumnSelection:YES];
@@ -28,7 +29,7 @@
[tableView setDelegate:self];
[tableView setDataSource:self];
var iconView = [[CPImageView alloc] initWithFrame:CGRectMake(16,16,0,0)];
var iconView = [[CPImageView alloc] initWithFrame:CGRectMake(16, 16, 0, 0)];
[iconView setImageScaling:CPImageScaleNone];
var iconColumn = [[CPTableColumn alloc] initWithIdentifier:"icons"];
[iconColumn setWidth:32.0];
@@ -36,7 +37,7 @@
[iconColumn setDataView:iconView];
[tableView addTableColumn:iconColumn];
iconImage = [[CPImage alloc] initWithContentsOfFile:"http://cappuccino-project.org/images/favicon.png" size:CGSizeMake(16,16)];
iconImage = [[CPImage alloc] initWithContentsOfFile:"http://www.cappuccino-project.org/img/favicon.ico" size:CGSizeMake(16, 16)];
for (var i = 1; i <= 5; i++)
@@ -68,7 +69,7 @@
[tableView setDelegate:self];
[tableView setDataSource:self];
var iconView = [[CPImageView alloc] initWithFrame:CGRectMake(16,16,0,0)];
var iconView = [[CPImageView alloc] initWithFrame:CGRectMake(16, 16, 0, 0)];
[iconView setImageScaling:CPImageScaleNone];
var iconColumn = [[CPTableColumn alloc] initWithIdentifier:"icons"];
[iconColumn setWidth:32.0];
@@ -76,9 +77,6 @@
[iconColumn setDataView:iconView];
[tableView addTableColumn:iconColumn];
iconImage = [[CPImage alloc] initWithContentsOfFile:"http://cappuccino-project.org/images/favicon.png" size:CGSizeMake(16,16)];
for (var i = 1; i <= 5; i++)
{
var column = [[CPTableColumn alloc] initWithIdentifier:String(i)];
-5
View File
@@ -1,5 +0,0 @@
.DS_Store
*.mode1v3
*.pbxuser
*.perspectivev3
build
-76
View File
@@ -1,76 +0,0 @@
/*
* This file is a part of program XcodeCapp
* Copyright (C) 2011 Antoine Mercadal (<primalmotion@archipelproject.org>)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import <CoreServices/CoreServices.h>
#import "PRHEmptyGrowlDelegate.h"
#import "TNXCodeCapp.h"
#import "TNErrorDataView.h"
@interface AppController : NSObject <NSMenuDelegate, NSTableViewDataSource, NSTableViewDelegate>
{
IBOutlet NSMenu *statusMenu;
IBOutlet NSMenuItem *menuItemOpenXCode;
IBOutlet NSMenuItem *menuItemStartStop;
IBOutlet NSPanel *errorsPanel;
IBOutlet NSTableView *errorsTable;
IBOutlet NSPanel *aboutWindow;
IBOutlet NSWindow *helpWindow;
IBOutlet NSTextView *helpTextView;
IBOutlet NSTextField *labelVersion;
IBOutlet NSPopUpButton *buttonPreferencesAPIMode;
IBOutlet NSButton *checkBoxPreferencesReactMode;
IBOutlet NSUserDefaultsController *preferencesController;
IBOutlet TNXCodeCapp *__strong xcc;
IBOutlet NSWindow *windowDebug;
IBOutlet NSMenuItem *menuDebug;
IBOutlet NSMenuItem *menuHistory;
IBOutlet TNErrorDataView *dataViewError;
NSImage *_iconActive;
NSImage *_iconInactive;
NSImage *_iconWorking;
NSStatusItem *_statusItem;
PRHEmptyGrowlDelegate *growlDelegateRef;
NSData *_archivedDataView;
}
@property BOOL supportsFileModeListening;
@property (strong) TNXCodeCapp *xcc;
+ (AppController *)sharedAppController;
- (BOOL)validateMenuItem:(NSMenuItem*)menuItem;
- (void)registerDefaults;
- (void)growlWithTitle:(NSString *)aTitle message:(NSString *)aMessage;
- (void)openCenteredWindow:(NSWindow *)aWindow;
- (void)_prepareHistoryMenu;
- (IBAction)chooseFolder:(id)aSender;
- (IBAction)openErrors:(id)sender;
- (IBAction)clearErrors:(id)sender;
- (IBAction)openXCode:(id)aSender;
- (IBAction)stopListener:(id)aSender;
- (IBAction)openHelp:(id)aSender;
- (IBAction)openAbout:(id)aSender;
- (IBAction)updatePreferences:(id)aSender;
- (IBAction)switchProject:(id)aSender;
- (IBAction)clearProjectHistory:(id)aSender;
@end
-443
View File
@@ -1,443 +0,0 @@
/*
* This file is a part of program XcodeCapp
* Copyright (C) 2011 Antoine Mercadal (<primalmotion@archipelproject.org>)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <AppKit/NSApplication.h>
#import "AppController.h"
#include "macros.h"
AppController *SharedAppControllerInstance = nil;
float heightForStringDrawing(NSString *myString, NSFont *myFont, float myWidth)
{
NSTextStorage *textStorage = [[NSTextStorage alloc] initWithString:myString];
NSTextContainer *textContainer = [[NSTextContainer alloc] initWithContainerSize:NSMakeSize(myWidth, FLT_MAX)];
NSLayoutManager *layoutManager = [[NSLayoutManager alloc] init];
[layoutManager addTextContainer:textContainer];
[textStorage addLayoutManager:layoutManager];
[textStorage addAttribute:NSFontAttributeName value:myFont range:NSMakeRange(0, [textStorage length])];
[textContainer setLineFragmentPadding:0.0];
(void) [layoutManager glyphRangeForTextContainer:textContainer];
return [layoutManager usedRectForTextContainer:textContainer].size.height;
}
@implementation AppController
@synthesize supportsFileModeListening;
@synthesize xcc;
+ (AppController *)sharedAppController
{
return SharedAppControllerInstance;
}
#pragma mark -
#pragma mark Initialization
/*!
Called when NIB is ready
*/
- (void)awakeFromNib
{
SharedAppControllerInstance = self;
_archivedDataView = [NSKeyedArchiver archivedDataWithRootObject:dataViewError];
if (!growlDelegateRef)
growlDelegateRef = [[PRHEmptyGrowlDelegate alloc] init];
[GrowlApplicationBridge setGrowlDelegate:growlDelegateRef];
NSBundle *bundle = [NSBundle mainBundle];
[labelVersion setStringValue:[NSString stringWithFormat:@"Version %@", [bundle objectForInfoDictionaryKey:@"CFBundleVersion"]]];
[self registerDefaults];
_iconInactive = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"xcodecapp-icon-inactive" ofType:@"png"]];
_iconActive = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"xcodecapp-icon-active" ofType:@"png"]];
_iconWorking = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"xcodecapp-icon-working" ofType:@"png"]];
[_iconActive setSize:NSMakeSize(14.0, 16.0)];
[_iconInactive setSize:NSMakeSize(14.0, 16.0)];
[_iconWorking setSize:NSMakeSize(14.0, 16.0)];
_statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
[_statusItem setMenu:statusMenu];
[_statusItem setImage:_iconInactive];
[_statusItem setHighlightMode:YES];
[statusMenu setDelegate:self];
if ([[NSUserDefaults standardUserDefaults] integerForKey:@"FirstLaunch"])
{
[[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithInt:0] forKey:@"FirstLaunch"];
[self openHelp:self];
}
[xcc setDelegate:self];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(XCodeCappConversionDidStart:) name:XCCConversionStartNotification object:xcc];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(XCodeCappConversionDidStop:) name:XCCConversionStopNotification object:xcc];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(XCodeCappPopulateProject:) name:XCCDidPopulateProjectNotification object:xcc];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(XCodeCappListeningDidStart:) name:XCCListeningStartNotification object:xcc];
[helpTextView setTextContainerInset:NSSizeFromCGSize(CGSizeMake(10.0, 10.0))];
[xcc start];
[self _prepareHistoryMenu];
}
/*!
Checks if aplication should show the debug window
*/
- (void)applicationDidFinishLaunching:(NSNotification *)notif
{
CGEventRef event = CGEventCreate(NULL);
CGEventFlags modifiers = CGEventGetFlags(event);
CFRelease(event);
if (modifiers & kCGEventFlagMaskAlternate)
{
[statusMenu insertItem:menuDebug atIndex:6];
}
}
/*!
Register the application defaults
*/
- (void)registerDefaults
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSNumber *streamEventIdSinceNow = [NSNumber numberWithUnsignedLongLong:kFSEventStreamEventIdSinceNow];
NSMutableDictionary *appDefaults = [NSMutableDictionary new];
[appDefaults setObject:streamEventIdSinceNow forKey:@"lastEventId"];
[appDefaults setObject:[NSNumber numberWithInt:1] forKey:@"FirstLaunch"];
[appDefaults setObject:[NSNumber numberWithInt:0] forKey:@"XCCAPIMode"];
[appDefaults setObject:[NSNumber numberWithInt:1] forKey:@"XCCReactMode"];
[appDefaults setObject:[NSNumber numberWithInt:1] forKey:@"XCCReopenLastProject"];
[appDefaults setObject:[[NSArray alloc] init] forKey:@"XCCProjectHistory"];
[defaults registerDefaults:appDefaults];
}
#pragma mark -
#pragma mark Notification handlers
/*!
Handle cleaning operation when application will stop.
It will stop the FSEvent listener, and store the last event id
*/
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)app
{
[xcc clear];
return NSTerminateNow;
}
/*!
Called when XCC start a conversion
@param aNotification the notification
*/
- (void)XCodeCappConversionDidStart:(NSNotification *)aNotification
{
[_statusItem setImage:_iconWorking];
}
/*!
Called when XCC finish a conversion
@param aNotification the notification
*/
- (void)XCodeCappConversionDidStop:(NSNotification *)aNotification
{
[_statusItem setImage:_iconActive];
if ([errorsPanel isVisible])
[errorsTable reloadData];
}
/*!
Called when XCC has populated a project
@param aNotification the notification
*/
- (void)XCodeCappPopulateProject:(NSNotification *)aNotification
{
[self growlWithTitle:@"Project loaded" message:[[[aNotification userInfo] objectForKey:@"URL"] path]];
}
/*!
Called when XCC start a to listen to a project
@param aNotification the notification
*/
- (void)XCodeCappListeningDidStart:(NSNotification *)aNotification
{
[_statusItem setImage:_iconActive];
[menuItemStartStop setTitle:[NSString stringWithFormat:@"Stop Listening to “%@”", [xcc currentProjectName]]];
[menuItemStartStop setAction:@selector(stopListener:)];
[self growlWithTitle:@"Listening to project" message:[[xcc currentProjectURL] path]];
}
#pragma mark -
#pragma mark Utilities
/*!
Simple growl wrapper
@param aTitle the growl title
@param aMessage the growl message
*/
- (void)growlWithTitle:(NSString *)aTitle message:(NSString *)aMessage
{
[GrowlApplicationBridge notifyWithTitle:aTitle
description:aMessage
notificationName:@"DefaultNotifications"
iconData:nil
priority:0
isSticky:NO
clickContext:nil];
}
/*!
Prepare the history menu
*/
- (void)_prepareHistoryMenu
{
NSMenu *menu = [[NSMenu alloc] init];
NSArray *projectHistory = [[NSUserDefaults standardUserDefaults] objectForKey:@"XCCProjectHistory"];
for(int i = 0; i < [projectHistory count]; i++)
{
NSString *itemTitle = [[projectHistory objectAtIndex:i] lastPathComponent];
NSString *projectPath = [[projectHistory objectAtIndex:i] stringByStandardizingPath];
NSString *currentProjectPath = [[[xcc currentProjectURL] path] stringByStandardizingPath];
NSMenuItem *item = [menu addItemWithTitle:itemTitle action:@selector(switchProject:) keyEquivalent:@""];
[item setRepresentedObject:projectPath];
if ([currentProjectPath isEqualToString:projectPath])
[item setAction:nil];
}
[menu addItem:[NSMenuItem separatorItem]];
[menu addItemWithTitle:@"Clear history" action:@selector(clearProjectHistory:) keyEquivalent:@""];
[menuHistory setEnabled:([projectHistory count]) ? YES : NO];
[menuHistory setSubmenu:menu];
}
#pragma mark -
#pragma mark Actions
/*!
Save preferences
@param aSender the sender of the action
*/
- (IBAction)updatePreferences:(id)aSender
{
[preferencesController save:aSender];
NSLog(@"Preferences change notified");
[xcc configure];
}
/*!
Open the folder chooser and eventually start to listen
@param aSender the sender of the action
*/
- (IBAction)chooseFolder:(id)aSender
{
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseDirectories:YES];
[openPanel setCanCreateDirectories:YES];
[openPanel setTitle:@"Choose Cappuccino Project"];
[openPanel setCanChooseFiles:NO];
if ([openPanel runModal] != NSFileHandlingPanelOKButton)
return;
NSString *projectPath = [NSString stringWithFormat:@"%@/", [[[openPanel URLs] objectAtIndex:0] path]];
NSMutableArray *projectHistory = [NSMutableArray arrayWithArray:[[NSUserDefaults standardUserDefaults] objectForKey:@"XCCProjectHistory"]];
if ([projectHistory containsObject:[projectPath stringByStandardizingPath]])
[projectHistory removeObject:[projectPath stringByStandardizingPath]];
[projectHistory insertObject:[projectPath stringByStandardizingPath] atIndex:0];
[[NSUserDefaults standardUserDefaults] setObject:projectHistory forKey:@"XCCProjectHistory"];
[xcc listenProjectAtPath:projectPath];
[self _prepareHistoryMenu];
}
/*!
Stop listening to a project
@param aSender the sender of the action
*/
- (IBAction)stopListener:(id)aSender
{
[xcc clear];
[_statusItem setImage:_iconInactive];
[menuItemStartStop setTitle:@"Listen to Project…"];
[menuItemStartStop setAction:@selector(chooseFolder:)];
[self _prepareHistoryMenu];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"LastOpenedPath"];
}
- (IBAction)switchProject:(id)aSender
{
NSString *newPath = [aSender representedObject];
[self stopListener:aSender];
[xcc listenProjectAtPath:newPath];
[self _prepareHistoryMenu];
}
- (IBAction)clearProjectHistory:(id)aSender
{
[[NSUserDefaults standardUserDefaults] setObject:[NSArray array] forKey:@"XCCProjectHistory"];
[self _prepareHistoryMenu];
}
/*!
Open the xCode support project in xCode
@param aSender the sender of the action
*/
- (IBAction)openXCode:(id)aSender
{
if (![xcc currentProjectURL])
return;
DLog(@"Opening Xcode project at URL: '%@'", [[xcc XCodeSupportProject] path]);
system([[NSString stringWithFormat:@"open \"%@\"", [[xcc XCodeSupportProject] path]] UTF8String]);
}
/*!
Open the errors window
@param aSender the sender of the action
*/
- (IBAction)openErrors:(id)aSender
{
[self openCenteredWindow:errorsPanel];
}
/*!
Clear all errors in errors table
@param aSender the sender of the action
*/
- (IBAction)clearErrors:(id)sender
{
[[xcc errorList] removeAllObjects];
[errorsTable reloadData];
}
/*!
Open the help file
@param aSender the sender of the action
*/
- (IBAction)openHelp:(id)aSender
{
[helpTextView readRTFDFromFile:[[NSBundle mainBundle] pathForResource:@"help" ofType:@"rtfd"]];
[self openCenteredWindow:helpWindow];
}
/*!
Open the about window
@param aSender the sender of the action
*/
- (IBAction)openAbout:(id)aSender
{
[self openCenteredWindow:aboutWindow];
}
/*!
Open the preferences window
@param aSender the sender of the action
*/
- (IBAction)openPreferences:(id)aSender
{
[self openCenteredWindow:windowDebug];
}
/*!
Open a centered window.
*/
- (void)openCenteredWindow:(NSWindow *)aWindow
{
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
[aWindow center];
[aWindow makeKeyAndOrderFront:nil];
}
#pragma mark -
#pragma mark Delegates
- (BOOL)validateMenuItem:(NSMenuItem *)aMenuItem
{
if (aMenuItem == menuItemOpenXCode)
return !![xcc currentProjectURL];
return YES;
}
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
{
return [[xcc errorList] count];
}
- (id)tableView:(NSTableView*)aTableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
return [[xcc errorList] objectAtIndex:row];
}
- (void)tableViewColumnDidResize:(NSNotification *)tableView
{
[errorsTable noteHeightOfRowsWithIndexesChanged:
[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [[xcc errorList] count])]];
}
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
return [NSKeyedUnarchiver unarchiveObjectWithData:_archivedDataView];
}
- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)aRow
{
NSString *content = [[[xcc errorList] objectAtIndex:aRow] objectForKey:@"message"];
NSFont *currentFont = [[dataViewError fieldMessage] font];
float height = heightForStringDrawing(content, currentFont, [tableView frame].size.width);
return height + 31;
}
@end
Binary file not shown.
File diff suppressed because it is too large. Load diff
Binary file not shown.
-63
View File
@@ -1,63 +0,0 @@
/*
* This file is a part of program xcodecapp-cocoa
* Copyright (C) 2011 Antoine Mercadal (primalmotion@archipelproject.org)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import "FSEventCallback.h"
/*!
This is the FSEvent callback
*/
void fsevents_callback(ConstFSEventStreamRef streamRef,
void *userData,
size_t numEvents,
void *eventPaths,
const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId eventIds[])
{
TNXCodeCapp *xcc = (TNXCodeCapp *)userData;
size_t i;
for(i = 0; i < numEvents; i++)
{
NSString *path = [(NSArray *)eventPaths objectAtIndex:i];
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
// kFSEventStreamEventFlagItemIsFile = 0x00010000
if (!(eventFlags[i] & 0x00010000)
|| [xcc isPathMatchingIgnoredPaths:path]
|| (![xcc isXIBFile:path] && ![xcc isObjJFile:path] && ![xcc isXCCIgnoreFile:path]))
continue;
// kFSEventStreamEventFlagItemRemoved = 0x00000200
if (eventFlags[i] & 0x00000200)
{
[xcc handleFileRemoval:path];
}
else
{
NSLog(@"this file has been modified or created");
[xcc handleFileModification:path notify:YES];
}
#else
NSArray *subpaths = [[[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:NULL];
for(NSString *currentPath in subpaths)
[xcc handleFileModification:currentPath notify:YES];
#endif
[xcc updateLastEventId:eventIds[i]];
}
}
-40
View File
@@ -1,40 +0,0 @@
/*
* This file is a part of program XcodeCapp
* Copyright (C) 2011 Antoine Mercadal (<primalmotion@archipelproject.org>)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef xcodecapp_cocoa_FSEventCallback_h
#define xcodecapp_cocoa_FSEventCallback_h
#import "TNXCodeCapp.h"
#import <Cocoa/Cocoa.h>
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_6
# define kFSEventStreamCreateFlagFileEvents 0x00000010
# define kFSEventStreamEventFlagItemIsFile 0x00010000
# define kFSEventStreamEventFlagItemRemoved 0x00000200
# define kFSEventStreamEventFlagItemCreated 0x00000200
# define kFSEventStreamEventFlagItemModified 0x00001000
# define kFSEventStreamEventFlagItemInodeMetaMod 0x00000400
# define kFSEventStreamEventFlagItemRenamed 0x00000800
# define kFSEventStreamEventFlagItemFinderInfoMod 0x00002000
# define kFSEventStreamEventFlagItemChangeOwner 0x00004000
# define kFSEventStreamEventFlagItemXattrMod 0x00008000
#endif
void fsevents_callback(ConstFSEventStreamRef, void*, size_t, void*, const FSEventStreamEventFlags*, const FSEventStreamEventId*);
#endif
-117
View File
@@ -1,117 +0,0 @@
/*
* This file is a part of program XcodeCapp
* Copyright (C) 2011 Antoine Mercadal (<primalmotion@archipelproject.org>)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import "AppController.h"
#import "FSEventCallback.h"
#import "macros.h"
/*!
This is the FSEvent callback for 10.7
*/
void fsevents_callback(ConstFSEventStreamRef streamRef,
void *userData,
size_t numEvents,
void *eventPaths,
const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId eventIds[])
{
TNXCodeCapp *xcc = (__bridge TNXCodeCapp *)userData;
BOOL useFileBasedListening = [xcc supportsFileBasedListening];
size_t i;
for (i = 0; i < numEvents; i++)
{
[xcc updateLastEventId:eventIds[i]];
FSEventStreamEventFlags flags = eventFlags[i];
NSString *path = [[(__bridge NSArray *)eventPaths objectAtIndex:i] stringByStandardizingPath];
if (useFileBasedListening)
{
BOOL conditionIsFile = flags & kFSEventStreamEventFlagItemIsFile;
BOOL conditionIsDirectory = NO;
BOOL conditionIsIgnored = [xcc isPathMatchingIgnoredPaths:path];
BOOL conditionIsValidFile = [xcc isXIBFile:path] || [xcc isObjJFile:path] || [xcc isXCCIgnoreFile:path];
BOOL conditionPathExists = [[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&conditionIsDirectory];
if (conditionIsIgnored)
continue;
if (conditionIsFile && !conditionIsValidFile)
continue;
// Events are not so reliable. For example, moving a folder to the trash is not
// a deletion. In order to simplify the code, we simply tidyUp the project when we receive
// an event.
[xcc tidyShadowedFiles];
if (conditionIsDirectory)
continue;
if (!conditionPathExists)
{
DLog(@"File removed: %@", path);
[xcc handleFileRemoval:path];
}
else
{
DLog(@"File modified/added: %@", path);
[xcc handleFileModification:path notify:YES];
}
}
else
{
// We should drop support for Snow Leopard soon.
BOOL isDir = NO;
[[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDir];
// If for some reasons the path is not a directory,
// we don't want to deal with it in this mode.
if (!isDir)
continue;
[xcc tidyShadowedFiles];
NSArray *subpaths = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:NULL];
for (NSString *subpath in subpaths)
{
NSString *fullPath = [[NSString stringWithFormat:@"%@/%@", path, subpath] stringByStandardizingPath];
if ([xcc isPathMatchingIgnoredPaths:fullPath]
|| (![xcc isXIBFile:fullPath] && ![xcc isObjJFile:fullPath] && ![xcc isXCCIgnoreFile:fullPath]))
continue;
NSDate *lastModifiedDate = [xcc lastModificationDateForPath:fullPath];
NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:fullPath error:nil];
NSDate *fileModDate = [fileAttributes objectForKey:NSFileModificationDate];
if ([fileModDate compare:lastModifiedDate] == NSOrderedDescending)
{
[xcc updateLastModificationDate:fileModDate forPath:fullPath];
[xcc handleFileModification:fullPath notify:YES];
}
}
}
}
[xcc updateUserDefaultsWithLastEventId];
}
Binary file not shown.
@@ -1,6 +0,0 @@
#include "GrowlDefines.h"
#ifdef __OBJC__
# include "GrowlApplicationBridge.h"
#endif
#include "GrowlApplicationBridge-Carbon.h"
@@ -1,780 +0,0 @@
//
// GrowlApplicationBridge-Carbon.h
// Growl
//
// Created by Mac-arena the Bored Zo on Wed Jun 18 2004.
// Based on GrowlApplicationBridge.h by Evan Schoenberg.
// This source code is in the public domain. You may freely link it into any
// program.
//
#ifndef _GROWLAPPLICATIONBRIDGE_CARBON_H_
#define _GROWLAPPLICATIONBRIDGE_CARBON_H_
#include <sys/cdefs.h>
#include <Carbon/Carbon.h>
#ifndef GROWL_EXPORT
#define GROWL_EXPORT __attribute__((visibility("default"))) DEPRECATED_ATTRIBUTE
#endif
/*! @header GrowlApplicationBridge-Carbon.h
* @abstract Declares an API that Carbon applications can use to interact with Growl.
* @discussion GrowlApplicationBridge uses a delegate to provide information //XXX
* to Growl (such as your application's name and what notifications it may
* post) and to provide information to your application (such as that Growl
* is listening for notifications or that a notification has been clicked).
*
* You can set the Growldelegate with Growl_SetDelegate and find out the
* current delegate with Growl_GetDelegate. See struct Growl_Delegate for more
* information about the delegate.
*/
__BEGIN_DECLS
/*! @struct Growl_Delegate
* @abstract Delegate to supply GrowlApplicationBridge with information and respond to events.
* @discussion The Growl delegate provides your interface to
* GrowlApplicationBridge. When GrowlApplicationBridge needs information about
* your application, it looks for it in the delegate; when Growl or the user
* does something that you might be interested in, GrowlApplicationBridge
* looks for a callback in the delegate and calls it if present
* (meaning, if it is not <code>NULL</code>).
* XXX on all of that
* @field size The size of the delegate structure.
* @field applicationName The name of your application.
* @field registrationDictionary A dictionary describing your application and the notifications it can send out.
* @field applicationIconData Your application's icon.
* @field growlInstallationWindowTitle The title of the installation window.
* @field growlInstallationInformation Text to display in the installation window.
* @field growlUpdateWindowTitle The title of the update window.
* @field growlUpdateInformation Text to display in the update window.
* @field referenceCount A count of owners of the delegate.
* @field retain Called when GrowlApplicationBridge receives this delegate.
* @field release Called when GrowlApplicationBridge no longer needs this delegate.
* @field growlIsReady Called when GrowlHelperApp is listening for notifications.
* @field growlNotificationWasClicked Called when a Growl notification is clicked.
* @field growlNotificationTimedOut Called when a Growl notification timed out.
*/
struct Growl_Delegate {
/* @discussion This should be sizeof(struct Growl_Delegate).
*/
size_t size;
/*All of these attributes are optional.
*Optional attributes can be NULL; required attributes that
* are NULL cause setting the Growl delegate to fail.
*XXX - move optional/required status into the discussion for each field
*/
/* This name is used both internally and in the Growl preferences.
*
* This should remain stable between different versions and incarnations of
* your application.
* For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and
* "SurfWriter Lite" are not.
*
* This can be <code>NULL</code> if it is provided elsewhere, namely in an
* auto-discoverable plist file in your app bundle
* (XXX refer to more information on that) or in registrationDictionary.
*/
CFStringRef applicationName;
/*
* Must contain at least these keys:
* GROWL_NOTIFICATIONS_ALL (CFArray):
* Contains the names of all notifications your application may post.
*
* Can also contain these keys:
* GROWL_NOTIFICATIONS_DEFAULT (CFArray):
* Names of notifications that should be enabled by default.
* If omitted, GROWL_NOTIFICATIONS_ALL will be used.
* GROWL_APP_NAME (CFString):
* Same as the applicationName member of this structure.
* If both are present, the applicationName member shall prevail.
* If this key is present, you may omit applicationName (set it to <code>NULL</code>).
* GROWL_APP_ICON (CFData):
* Same as the iconData member of this structure.
* If both are present, the iconData member shall prevail.
* If this key is present, you may omit iconData (set it to <code>NULL</code>).
*
* If you change the contents of this dictionary after setting the delegate,
* be sure to call Growl_Reregister.
*
* This can be <code>NULL</code> if you have an auto-discoverable plist file in your app
* bundle. (XXX refer to more information on that)
*/
CFDictionaryRef registrationDictionary;
/* The data can be in any format supported by NSImage. As of
* Mac OS X 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and
* PICT formats.
*
* If this is not supplied, Growl will look up your application's icon by
* its application name.
*/
CFDataRef applicationIconData;
/* Installer display attributes
*
* These four attributes are used by the Growl installer, if this framework
* supports it.
* For any of these being <code>NULL</code>, a localised default will be
* supplied.
*/
/* If this is <code>NULL</code>, Growl will use a default,
* localized title.
*
* Only used if you're using Growl-WithInstaller.framework. Otherwise,
* this member is ignored.
*/
CFStringRef growlInstallationWindowTitle;
/* This information may be as long or short as desired (the
* window will be sized to fit it). If Growl is not installed, it will
* be displayed to the user as an explanation of what Growl is and what
* it can do in your application.
* It should probably note that no download is required to install.
*
* If this is <code>NULL</code>, Growl will use a default, localized
* explanation.
*
* Only used if you're using Growl-WithInstaller.framework. Otherwise,
* this member is ignored.
*/
CFStringRef growlInstallationInformation;
/* If this is <code>NULL</code>, Growl will use a default,
* localized title.
*
* Only used if you're using Growl-WithInstaller.framework. Otherwise,
* this member is ignored.
*/
CFStringRef growlUpdateWindowTitle;
/* This information may be as long or short as desired (the
* window will be sized to fit it). If an older version of Growl is
* installed, it will be displayed to the user as an explanation that an
* updated version of Growl is included in your application and
* no download is required.
*
* If this is <code>NULL</code>, Growl will use a default, localized
* explanation.
*
* Only used if you're using Growl-WithInstaller.framework. Otherwise,
* this member is ignored.
*/
CFStringRef growlUpdateInformation;
/* This member is provided for use by your retain and release
* callbacks (see below).
*
* GrowlApplicationBridge never directly uses this member. Instead, it
* calls your retain callback (if non-<code>NULL</code>) and your release
* callback (if non-<code>NULL</code>).
*/
unsigned referenceCount;
//Functions. Currently all of these are optional (any of them can be NULL).
/* When you call Growl_SetDelegate(newDelegate), it will call
* oldDelegate->release(oldDelegate), and then it will call
* newDelegate->retain(newDelegate), and the return value from retain
* is what will be set as the delegate.
* (This means that this member works like CFRetain and -[NSObject retain].)
* This member is optional (it can be <code>NULL</code>).
* For a delegate allocated with malloc, this member would be
* <code>NULL</code>.
* @result A delegate to which GrowlApplicationBridge holds a reference.
*/
void *(*retain)(void *);
/* When you call Growl_SetDelegate(newDelegate), it will call
* oldDelegate->release(oldDelegate), and then it will call
* newDelegate->retain(newDelegate), and the return value from retain
* is what will be set as the delegate.
* (This means that this member works like CFRelease and
* -[NSObject release].)
* This member is optional (it can be NULL).
* For a delegate allocated with malloc, this member might be
* <code>free</code>(3).
*/
void (*release)(void *);
/* Informs the delegate that Growl (specifically, the GrowlHelperApp) was
* launched successfully (or was already running). The application can
* take actions with the knowledge that Growl is installed and functional.
*/
void (*growlIsReady)(void);
/* Informs the delegate that a Growl notification was clicked. It is only
* sent for notifications sent with a non-<code>NULL</code> clickContext,
* so if you want to receive a message when a notification is clicked,
* clickContext must not be <code>NULL</code> when calling
* Growl_PostNotification or
* Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext.
*/
void (*growlNotificationWasClicked)(CFPropertyListRef clickContext);
/* Informs the delegate that a Growl notification timed out. It is only
* sent for notifications sent with a non-<code>NULL</code> clickContext,
* so if you want to receive a message when a notification is clicked,
* clickContext must not be <code>NULL</code> when calling
* Growl_PostNotification or
* Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext.
*/
void (*growlNotificationTimedOut)(CFPropertyListRef clickContext);
};
/*! @struct Growl_Notification
* @abstract Structure describing a Growl notification.
* @discussion XXX
* @field size The size of the notification structure.
* @field name Identifies the notification.
* @field title Short synopsis of the notification.
* @field description Additional text.
* @field iconData An icon for the notification.
* @field priority An indicator of the notification's importance.
* @field reserved Bits reserved for future usage.
* @field isSticky Requests that a notification stay on-screen until dismissed explicitly.
* @field clickContext An identifier to be passed to your click callback when a notification is clicked.
* @field clickCallback A callback to call when the notification is clicked.
*/
struct Growl_Notification {
/* This should be sizeof(struct Growl_Notification).
*/
size_t size;
/* The notification name distinguishes one type of
* notification from another. The name should be human-readable, as it
* will be displayed in the Growl preference pane.
*
* The name is used in the GROWL_NOTIFICATIONS_ALL and
* GROWL_NOTIFICATIONS_DEFAULT arrays in the registration dictionary, and
* in this member of the Growl_Notification structure.
*/
CFStringRef name;
/* A notification's title describes the notification briefly.
* It should be easy to read quickly by the user.
*/
CFStringRef title;
/* The description supplements the title with more
* information. It is usually longer and sometimes involves a list of
* subjects. For example, for a 'Download complete' notification, the
* description might have one filename per line. GrowlMail in Growl 0.6
* uses a description of '%d new mail(s)' (formatted with the number of
* messages).
*/
CFStringRef description;
/* The notification icon usually indicates either what
* happened (it may have the same icon as e.g. a toolbar item that
* started the process that led to the notification), or what it happened
* to (e.g. a document icon).
*
* The icon data is optional, so it can be <code>NULL</code>. In that
* case, the application icon is used alone. Not all displays support
* icons.
*
* The data can be in any format supported by NSImage. As of Mac OS X
* 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and PICT form
* ats.
*/
CFDataRef iconData;
/* Priority is new in Growl 0.6, and is represented as a
* signed integer from -2 to +2. 0 is Normal priority, -2 is Very Low
* priority, and +2 is Very High priority.
*
* Not all displays support priority. If you do not wish to assign a
* priority to your notification, assign 0.
*/
signed int priority;
/* These bits are not used in Growl 0.6. Set them to 0.
*/
unsigned reserved: 31;
/* When the sticky bit is clear, in most displays,
* notifications disappear after a certain amount of time. Sticky
* notifications, however, remain on-screen until the user dismisses them
* explicitly, usually by clicking them.
*
* Sticky notifications were introduced in Growl 0.6. Most notifications
* should not be sticky. Not all displays support sticky notifications,
* and the user may choose in Growl's preference pane to force the
* notification to be sticky or non-sticky, in which case the sticky bit
* in the notification will be ignored.
*/
unsigned isSticky: 1;
/* If this is not <code>NULL</code>, and your click callback
* is not <code>NULL</code> either, this will be passed to the callback
* when your notification is clicked by the user.
*
* Click feedback was introduced in Growl 0.6, and it is optional. Not
* all displays support click feedback.
*/
CFPropertyListRef clickContext;
/* If this is not <code>NULL</code>, it will be called instead
* of the Growl delegate's click callback when clickContext is
* non-<code>NULL</code> and the notification is clicked on by the user.
*
* Click feedback was introduced in Growl 0.6, and it is optional. Not
* all displays support click feedback.
*
* The per-notification click callback is not yet supported as of Growl
* 0.7.
*/
void (*clickCallback)(CFPropertyListRef clickContext);
CFStringRef identifier;
};
#pragma mark -
#pragma mark Easy initialisers
/*! @defined InitGrowlDelegate
* @abstract Callable macro. Initializes a Growl delegate structure to defaults.
* @discussion Call with a pointer to a struct Growl_Delegate. All of the
* members of the structure will be set to 0 or <code>NULL</code>, except for
* size (which will be set to <code>sizeof(struct Growl_Delegate)</code>) and
* referenceCount (which will be set to 1).
*/
#define InitGrowlDelegate(delegate) \
do { \
if (delegate) { \
(delegate)->size = sizeof(struct Growl_Delegate); \
(delegate)->applicationName = NULL; \
(delegate)->registrationDictionary = NULL; \
(delegate)->applicationIconData = NULL; \
(delegate)->growlInstallationWindowTitle = NULL; \
(delegate)->growlInstallationInformation = NULL; \
(delegate)->growlUpdateWindowTitle = NULL; \
(delegate)->growlUpdateInformation = NULL; \
(delegate)->referenceCount = 1U; \
(delegate)->retain = NULL; \
(delegate)->release = NULL; \
(delegate)->growlIsReady = NULL; \
(delegate)->growlNotificationWasClicked = NULL; \
(delegate)->growlNotificationTimedOut = NULL; \
} \
} while(0)
/*! @defined InitGrowlNotification
* @abstract Callable macro. Initializes a Growl notification structure to defaults.
* @discussion Call with a pointer to a struct Growl_Notification. All of
* the members of the structure will be set to 0 or <code>NULL</code>, except
* for size (which will be set to
* <code>sizeof(struct Growl_Notification)</code>).
*/
#define InitGrowlNotification(notification) \
do { \
if (notification) { \
(notification)->size = sizeof(struct Growl_Notification); \
(notification)->name = NULL; \
(notification)->title = NULL; \
(notification)->description = NULL; \
(notification)->iconData = NULL; \
(notification)->priority = 0; \
(notification)->reserved = 0U; \
(notification)->isSticky = false; \
(notification)->clickContext = NULL; \
(notification)->clickCallback = NULL; \
(notification)->identifier = NULL; \
} \
} while(0)
#pragma mark -
#pragma mark Public API
// @functiongroup Managing the Growl delegate
/*! @function Growl_SetDelegate
* @abstract Replaces the current Growl delegate with a new one, or removes
* the Growl delegate.
* @param newDelegate
* @result Returns false and does nothing else if a pointer that was passed in
* is unsatisfactory (because it is non-<code>NULL</code>, but at least one
* required member of it is <code>NULL</code>). Otherwise, sets or unsets the
* delegate and returns true.
* @discussion When <code>newDelegate</code> is non-<code>NULL</code>, sets
* the delegate to <code>newDelegate</code>. When it is <code>NULL</code>,
* the current delegate will be unset, and no delegate will be in place.
*
* It is legal for <code>newDelegate</code> to be the current delegate;
* nothing will happen, and Growl_SetDelegate will return true. It is also
* legal for it to be <code>NULL</code>, as described above; again, it will
* return true.
*
* If there was a delegate in place before the call, Growl_SetDelegate will
* call the old delegate's release member if it was non-<code>NULL</code>. If
* <code>newDelegate</code> is non-<code>NULL</code>, Growl_SetDelegate will
* call <code>newDelegate->retain</code>, and set the delegate to its return
* value.
*
* If you are using Growl-WithInstaller.framework, and an older version of
* Growl is installed on the user's system, the user will automatically be
* prompted to update.
*
* GrowlApplicationBridge currently does not copy this structure, nor does it
* retain any of the CF objects in the structure (it regards the structure as
* a container that retains the objects when they are added and releases them
* when they are removed or the structure is destroyed). Also,
* GrowlApplicationBridge currently does not modify any member of the
* structure, except possibly the referenceCount by calling the retain and
* release members.
*/
GROWL_EXPORT Boolean Growl_SetDelegate(struct Growl_Delegate *newDelegate);
/*! @function Growl_GetDelegate
* @abstract Returns the current Growl delegate, if any.
* @result The current Growl delegate.
* @discussion Returns the last pointer passed into Growl_SetDelegate, or
* <code>NULL</code> if no such call has been made.
*
* This function follows standard Core Foundation reference-counting rules.
* Because it is a Get function, not a Copy function, it will not retain the
* delegate on your behalf. You are responsible for retaining and releasing
* the delegate as needed.
*/
GROWL_EXPORT struct Growl_Delegate *Growl_GetDelegate(void);
#pragma mark -
// @functiongroup Posting Growl notifications
/*! @function Growl_PostNotification
* @abstract Posts a Growl notification.
* @param notification The notification to post.
* @discussion This is the preferred means for sending a Growl notification.
* The notification name and at least one of the title and description are
* required (all three are preferred). All other parameters may be
* <code>NULL</code> (or 0 or false as appropriate) to accept default values.
*
* If using the Growl-WithInstaller framework, if Growl is not installed the
* user will be prompted to install Growl.
* If the user cancels, this function will have no effect until the next
* application session, at which time when it is called the user will be
* prompted again. The user is also given the option to not be prompted again.
* If the user does choose to install Growl, the requested notification will
* be displayed once Growl is installed and running.
*/
GROWL_EXPORT void Growl_PostNotification(const struct Growl_Notification *notification);
/*! @function Growl_PostNotificationWithDictionary
* @abstract Notifies using a userInfo dictionary suitable for passing to
* CFDistributedNotificationCenter.
* @param userInfo The dictionary to notify with.
* @discussion Before Growl 0.6, your application would have posted
* notifications using CFDistributedNotificationCenter by creating a userInfo
* dictionary with the notification data. This had the advantage of allowing
* you to add other data to the dictionary for programs besides Growl that
* might be listening.
*
* This function allows you to use such dictionaries without being restricted
* to using CFDistributedNotificationCenter. The keys for this dictionary
* can be found in GrowlDefines.h.
*/
GROWL_EXPORT void Growl_PostNotificationWithDictionary(CFDictionaryRef userInfo);
/*! @function Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext
* @abstract Posts a Growl notification using parameter values.
* @param title The title of the notification.
* @param description The description of the notification.
* @param notificationName The name of the notification as listed in the
* registration dictionary.
* @param iconData Data representing a notification icon. Can be <code>NULL</code>.
* @param priority The priority of the notification (-2 to +2, with -2
* being Very Low and +2 being Very High).
* @param isSticky If true, requests that this notification wait for a
* response from the user.
* @param clickContext An object to pass to the clickCallback, if any. Can
* be <code>NULL</code>, in which case the clickCallback is not called.
* @discussion Creates a temporary Growl_Notification, fills it out with the
* supplied information, and calls Growl_PostNotification on it.
* See struct Growl_Notification and Growl_PostNotification for more
* information.
*
* The icon data can be in any format supported by NSImage. As of Mac OS X
* 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and PICT formats.
*/
GROWL_EXPORT void Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext(
/*inhale*/
CFStringRef title,
CFStringRef description,
CFStringRef notificationName,
CFDataRef iconData,
signed int priority,
Boolean isSticky,
CFPropertyListRef clickContext);
#pragma mark -
// @functiongroup Registering
/*! @function Growl_RegisterWithDictionary
* @abstract Register your application with Growl without setting a delegate.
* @discussion When you call this function with a dictionary,
* GrowlApplicationBridge registers your application using that dictionary.
* If you pass <code>NULL</code>, GrowlApplicationBridge will ask the delegate
* (if there is one) for a dictionary, and if that doesn't work, it will look
* in your application's bundle for an auto-discoverable plist.
* (XXX refer to more information on that)
*
* If you pass a dictionary to this function, it must include the
* <code>GROWL_APP_NAME</code> key, unless a delegate is set.
*
* This function is mainly an alternative to the delegate system introduced
* with Growl 0.6. Without a delegate, you cannot receive callbacks such as
* <code>growlIsReady</code> (since they are sent to the delegate). You can,
* however, set a delegate after registering without one.
*
* This function was introduced in Growl.framework 0.7.
* @result <code>false</code> if registration failed (e.g. if Growl isn't installed).
*/
GROWL_EXPORT Boolean Growl_RegisterWithDictionary(CFDictionaryRef regDict);
/*! @function Growl_Reregister
* @abstract Updates your registration with Growl.
* @discussion If your application changes the contents of the
* GROWL_NOTIFICATIONS_ALL key in the registrationDictionary member of the
* Growl delegate, or if it changes the value of that member, or if it
* changes the contents of its auto-discoverable plist, call this function
* to have Growl update its registration information for your application.
*
* Otherwise, this function does not normally need to be called. If you're
* using a delegate, your application will be registered when you set the
* delegate if both the delegate and its registrationDictionary member are
* non-<code>NULL</code>.
*
* This function is now implemented using
* <code>Growl_RegisterWithDictionary</code>.
*/
GROWL_EXPORT void Growl_Reregister(void);
#pragma mark -
/*! @function Growl_SetWillRegisterWhenGrowlIsReady
* @abstract Tells GrowlApplicationBridge to register with Growl when Growl
* launches (or not).
* @discussion When Growl has started listening for notifications, it posts a
* <code>GROWL_IS_READY</code> notification on the Distributed Notification
* Center. GrowlApplicationBridge listens for this notification, using it to
* perform various tasks (such as calling your delegate's
* <code>growlIsReady</code> callback, if it has one). If this function is
* called with <code>true</code>, one of those tasks will be to reregister
* with Growl (in the manner of <code>Growl_Reregister</code>).
*
* This attribute is automatically set back to <code>false</code>
* (the default) after every <code>GROWL_IS_READY</code> notification.
* @param flag <code>true</code> if you want GrowlApplicationBridge to register with
* Growl when next it is ready; <code>false</code> if not.
*/
GROWL_EXPORT void Growl_SetWillRegisterWhenGrowlIsReady(Boolean flag);
/*! @function Growl_WillRegisterWhenGrowlIsReady
* @abstract Reports whether GrowlApplicationBridge will register with Growl
* when Growl next launches.
* @result <code>true</code> if GrowlApplicationBridge will register with
* Growl when next it posts GROWL_IS_READY; <code>false</code> if not.
*/
GROWL_EXPORT Boolean Growl_WillRegisterWhenGrowlIsReady(void);
#pragma mark -
// @functiongroup Obtaining registration dictionaries
/*! @function Growl_CopyRegistrationDictionaryFromDelegate
* @abstract Asks the delegate for a registration dictionary.
* @discussion If no delegate is set, or if the delegate's
* <code>registrationDictionary</code> member is <code>NULL</code>, this
* function returns <code>NULL</code>.
*
* This function does not attempt to clean up the dictionary in any way - for
* example, if it is missing the <code>GROWL_APP_NAME</code> key, the result
* will be missing it too. Use
* <code>Growl_CreateRegistrationDictionaryByFillingInDictionary</code> or
* <code>Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys</code>
* to try to fill in missing keys.
*
* This function was introduced in Growl.framework 0.7.
* @result A registration dictionary.
*/
GROWL_EXPORT CFDictionaryRef Growl_CopyRegistrationDictionaryFromDelegate(void);
/*! @function Growl_CopyRegistrationDictionaryFromBundle
* @abstract Looks in a bundle for a registration dictionary.
* @discussion This function looks in a bundle for an auto-discoverable
* registration dictionary file using <code>CFBundleCopyResourceURL</code>.
* If it finds one, it loads the file using <code>CFPropertyList</code> and
* returns the result.
*
* If you pass <code>NULL</code> as the bundle, the main bundle is examined.
*
* This function does not attempt to clean up the dictionary in any way - for
* example, if it is missing the <code>GROWL_APP_NAME</code> key, the result
* will be missing it too. Use
* <code>Growl_CreateRegistrationDictionaryByFillingInDictionary:</code> or
* <code>Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys</code>
* to try to fill in missing keys.
*
* This function was introduced in Growl.framework 0.7.
* @result A registration dictionary.
*/
GROWL_EXPORT CFDictionaryRef Growl_CopyRegistrationDictionaryFromBundle(CFBundleRef bundle);
/*! @function Growl_CreateBestRegistrationDictionary
* @abstract Obtains a registration dictionary, filled out to the best of
* GrowlApplicationBridge's knowledge.
* @discussion This function creates a registration dictionary as best
* GrowlApplicationBridge knows how.
*
* First, GrowlApplicationBridge examines the Growl delegate (if there is
* one) and gets the registration dictionary from that. If no such dictionary
* was obtained, GrowlApplicationBridge looks in your application's main
* bundle for an auto-discoverable registration dictionary file. If that
* doesn't exist either, this function returns <code>NULL</code>.
*
* Second, GrowlApplicationBridge calls
* <code>Growl_CreateRegistrationDictionaryByFillingInDictionary</code> with
* whatever dictionary was obtained. The result of that function is the
* result of this function.
*
* GrowlApplicationBridge uses this function when you call
* <code>Growl_SetDelegate</code>, or when you call
* <code>Growl_RegisterWithDictionary</code> with <code>NULL</code>.
*
* This function was introduced in Growl.framework 0.7.
* @result A registration dictionary.
*/
GROWL_EXPORT CFDictionaryRef Growl_CreateBestRegistrationDictionary(void);
#pragma mark -
// @functiongroup Filling in registration dictionaries
/*! @function Growl_CreateRegistrationDictionaryByFillingInDictionary
* @abstract Tries to fill in missing keys in a registration dictionary.
* @param regDict The dictionary to fill in.
* @result The dictionary with the keys filled in.
* @discussion This function examines the passed-in dictionary for missing keys,
* and tries to work out correct values for them. As of 0.7, it uses:
*
* Key Value
* --- -----
* <code>GROWL_APP_NAME</code> <code>CFBundleExecutableName</code>
* <code>GROWL_APP_ICON</code> The icon of the application.
* <code>GROWL_APP_LOCATION</code> The location of the application.
* <code>GROWL_NOTIFICATIONS_DEFAULT</code> <code>GROWL_NOTIFICATIONS_ALL</code>
*
* Keys are only filled in if missing; if a key is present in the dictionary,
* its value will not be changed.
*
* This function was introduced in Growl.framework 0.7.
*/
GROWL_EXPORT CFDictionaryRef Growl_CreateRegistrationDictionaryByFillingInDictionary(CFDictionaryRef regDict);
/*! @function Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys
* @abstract Tries to fill in missing keys in a registration dictionary.
* @param regDict The dictionary to fill in.
* @param keys The keys to fill in. If <code>NULL</code>, any missing keys are filled in.
* @result The dictionary with the keys filled in.
* @discussion This function examines the passed-in dictionary for missing keys,
* and tries to work out correct values for them. As of 0.7, it uses:
*
* Key Value
* --- -----
* <code>GROWL_APP_NAME</code> <code>CFBundleExecutableName</code>
* <code>GROWL_APP_ICON</code> The icon of the application.
* <code>GROWL_APP_LOCATION</code> The location of the application.
* <code>GROWL_NOTIFICATIONS_DEFAULT</code> <code>GROWL_NOTIFICATIONS_ALL</code>
*
* Only those keys that are listed in <code>keys</code> will be filled in.
* Other missing keys are ignored. Also, keys are only filled in if missing;
* if a key is present in the dictionary, its value will not be changed.
*
* This function was introduced in Growl.framework 0.7.
*/
GROWL_EXPORT CFDictionaryRef Growl_CreateRegistrationDictionaryByFillingInDictionaryRestrictedToKeys(CFDictionaryRef regDict, CFSetRef keys);
/*! @brief Tries to fill in missing keys in a notification dictionary.
* @param notifDict The dictionary to fill in.
* @return The dictionary with the keys filled in. This will be a separate instance from \a notifDict.
* @discussion This function examines the \a notifDict for missing keys, and
* tries to get them from the last known registration dictionary. As of 1.1,
* the keys that it will look for are:
*
* \li <code>GROWL_APP_NAME</code>
* \li <code>GROWL_APP_ICON</code>
*
* @since Growl.framework 1.1
*/
GROWL_EXPORT CFDictionaryRef Growl_CreateNotificationDictionaryByFillingInDictionary(CFDictionaryRef notifDict);
#pragma mark -
// @functiongroup Querying Growl's status
/*! @function Growl_IsInstalled
* @abstract Determines whether the Growl prefpane and its helper app are
* installed.
* @result Returns true if Growl is installed, false otherwise.
*/
GROWL_EXPORT Boolean Growl_IsInstalled(void);
/*! @function Growl_IsRunning
* @abstract Cycles through the process list to find whether GrowlHelperApp
* is running.
* @result Returns true if Growl is running, false otherwise.
*/
GROWL_EXPORT Boolean Growl_IsRunning(void);
#pragma mark -
// @functiongroup Launching Growl
/*! @typedef GrowlLaunchCallback
* @abstract Callback to notify you that Growl is running.
* @param context The context pointer passed to Growl_LaunchIfInstalled.
* @discussion Growl_LaunchIfInstalled calls this callback function if Growl
* was already running or if it launched Growl successfully.
*/
typedef void (*GrowlLaunchCallback)(void *context);
/*! @function Growl_LaunchIfInstalled
* @abstract Launches GrowlHelperApp if it is not already running.
* @param callback A callback function which will be called if Growl was successfully
* launched or was already running. Can be <code>NULL</code>.
* @param context The context pointer to pass to the callback. Can be <code>NULL</code>.
* @result Returns true if Growl was successfully launched or was already
* running; returns false and does not call the callback otherwise.
* @discussion Returns true and calls the callback (if the callback is not
* <code>NULL</code>) if the Growl helper app began launching or was already
* running. Returns false and performs no other action if Growl could not be
* launched (e.g. because the Growl preference pane is not properly installed).
*
* If <code>Growl_CreateBestRegistrationDictionary</code> returns
* non-<code>NULL</code>, this function will register with Growl atomically.
*
* The callback should take a single argument; this is to allow applications
* to have context-relevant information passed back. It is perfectly
* acceptable for context to be <code>NULL</code>. The callback itself can be
* <code>NULL</code> if you don't want one.
*/
GROWL_EXPORT Boolean Growl_LaunchIfInstalled(GrowlLaunchCallback callback, void *context);
#pragma mark -
#pragma mark Constants
/*! @defined GROWL_PREFPANE_BUNDLE_IDENTIFIER
* @abstract The CFBundleIdentifier of the Growl preference pane bundle.
* @discussion GrowlApplicationBridge uses this to determine whether Growl is
* currently installed, by searching for the Growl preference pane. Your
* application probably does not need to use this macro itself.
*/
#ifndef GROWL_PREFPANE_BUNDLE_IDENTIFIER
#define GROWL_PREFPANE_BUNDLE_IDENTIFIER CFSTR("com.growl.prefpanel")
#endif
__END_DECLS
#endif /* _GROWLAPPLICATIONBRIDGE_CARBON_H_ */
+35 -6
View File
@@ -8,21 +8,50 @@ var OS = require("os"),
task ("build", function()
{
// If sw_vers does not exist, we aren't on Mac OS X
if (!executableExists("sw_vers"))
OS.exit(0);
// No building on 10.6
var p = OS.popen(["sw_vers", "-productVersion"]);
if (p.wait() === 0)
{
var versions = p.stdout.read().split("."),
majorVersion = parseInt(versions[0], 10),
minorVersion = parseInt(versions[1], 10),
buildVersion = parseInt(versions[2], 10);
if (majorVersion < 10 || minorVersion < 7)
{
colorPrint("XcodeCapp can only be built on Mac OS X 10.7+. You can download the binary here: https://www.dropbox.com/sh/gxdgm356gyb9tqc/rFNyl8hcVG", "red");
OS.exit(0);
}
}
if (executableExists("xcodebuild"))
{
var args = "-sdk macosx -alltargets -configuration Release",
supportPath = FILE.join($BUILD_CJS_CAPPUCCINO, "support", applicationName),
installPath = FILE.join("/", "Applications", applicationName);
// Remove an old symlink, the application is built directly into /Applications now.
if (FILE.isLink(installPath))
FILE.remove(installPath);
if (OS.system("xcodebuild " + args))
OS.exit(1);
rm_rf(supportPath);
FILE.mkdirs(supportPath);
cp_r(FILE.join("build", "Release", "XcodeCapp.app"), supportPath);
FILE.chmod(FILE.join(supportPath, "Contents", "MacOS", "XcodeCapp"), 0755);
if (!executableExists("xcc"))
{
print("\nWould you like to install the xcc command line tool in /usr/local/bin? yes or no:");
OS.system(["ln", "-sf", supportPath, installPath]);
if (system.stdin.readLine() == "yes\n")
{
sudo(["mkdir", "-p", "/usr/local/bin"]);
sudo(["ln", "-s", "/Applications/XcodeCapp.app/Contents/MacOS/xcc", "/usr/local/bin/"]);
}
}
}
else
{
-18
View File
@@ -1,18 +0,0 @@
//
// PRHEmptyGrowlDelegate.h
// XcodeCapp
//
// Created by Andrea D'Amore on 19/06/11.
// Copyright 2011 by author. All rights reserved.
//
// taken from
// http://groups.google.com/group/growl-development/browse_thread/thread/6b0c3fb9fa31f765
#import <Cocoa/Cocoa.h>
#import <Growl/Growl.h>
@interface PRHEmptyGrowlDelegate : NSObject <GrowlApplicationBridgeDelegate> {
}
@end
-14
View File
@@ -1,14 +0,0 @@
//
// PRHEmptyGrowlDelegate.h
// XcodeCapp
//
// Created by Andrea D'Amore on 19/06/11.
// Copyright 2011 by author. All rights reserved.
//
#import "PRHEmptyGrowlDelegate.h"
@implementation PRHEmptyGrowlDelegate
@end
-19
View File
@@ -1,19 +0,0 @@
# xCodeCapp-Cocoa
xcodecapp-cocoa is a port from the original xcodecapp application. It works basically the same than this
tools shipped with Cappuccino framework but have serveral advantages:
* It uses the FSEventStream system to be notified when a file changes. So no useless looping
* It consumes about no CPU when idle
* It allows you to choose graphically the project you want to use
* It will keep track of your already generated project helper
* It supports .xcodecapp-ignore
* It uses Growl to notify you when a conversion is done.
# License
All the code is distributed under AGPL v3.0 license. The parse.j comes from Cappuccino parser and uses the Cappuccino license.
# Author
Antoine Meradal <primalmotion@archipelproject.org>
-34
View File
@@ -1,34 +0,0 @@
/*
* This file is a part of program XcodeCapp
* Copyright (C) 2013 Antoine Mercadal (<primalmotion@archipelproject.org>)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
@interface TNErrorDataView : NSView
{
IBOutlet NSTextField *fieldFileName;
IBOutlet NSTextField *__strong fieldMessage;
IBOutlet NSButton *buttonOpenFile;
NSString *_fullPath;
}
@property (strong) NSTextField *fieldMessage;
- (IBAction)openFile:(id)aSender;
@end
-75
View File
@@ -1,75 +0,0 @@
/*
* This file is a part of program XcodeCapp
* Copyright (C) 2013 Antoine Mercadal (<primalmotion@archipelproject.org>)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import "TNErrorDataView.h"
@implementation TNErrorDataView
@synthesize fieldMessage;
/*!
Set the data view's object value
@param aValue the dictionary representing the error
*/
- (void)setObjectValue:(NSDictionary *)aValue
{
[fieldMessage setStringValue:[aValue valueForKey:@"message"]];
[fieldFileName setStringValue:[aValue valueForKey:@"file"]];
_fullPath = [aValue valueForKey:@"path"];
}
#pragma -
#pragma Actions
/*!
Open the errored file in default editor
@param aSender the sender of the action
*/
- (IBAction)openFile:(id)aSender
{
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
[workspace openFile:_fullPath];
}
#pragma -
#pragma CPCoding
- (id)initWithCoder:(NSCoder*)aCoder
{
if (self = [super initWithCoder:aCoder])
{
fieldFileName = [aCoder decodeObjectForKey:@"fieldFileName"];
fieldMessage = [aCoder decodeObjectForKey:@"fieldMessage"];
buttonOpenFile = [aCoder decodeObjectForKey:@"buttonOpenFile"];
}
return self;
}
- (void)encodeWithCoder:(NSCoder*)aCoder
{
[super encodeWithCoder:aCoder];
[aCoder encodeObject:fieldFileName forKey:@"fieldFileName"];
[aCoder encodeObject:fieldMessage forKey:@"fieldMessage"];
[aCoder encodeObject:buttonOpenFile forKey:@"buttonOpenFile"];
}
@end
-102
View File
@@ -1,102 +0,0 @@
/*
* This file is a part of program XcodeCapp
* Copyright (C) 2011 Antoine Mercadal (<primalmotion@archipelproject.org>)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Foundation/Foundation.h>
#import "PRHEmptyGrowlDelegate.h"
#import "FSEventCallback.h"
extern NSString * const XCCDidPopulateProjectNotification;
extern NSString * const XCCConversionStartNotification;
extern NSString * const XCCConversionStopNotification;
extern NSString * const XCCListeningStartNotification;
@interface TNXCodeCapp : NSObject
{
FSEventStreamRef stream;
NSFileManager *fm;
NSMutableArray *errorList;
NSMutableSet *ignoredFilePaths;
NSNumber *lastEventId;
NSString *currentAPIMode;
NSString *currentProjectName;
NSString *parserPath;
NSString *XCodeSupportPBXPath;
NSString *XCodeSupportProjectName;
NSString *XCodeTemplatePBXPath;
NSString *profilePath;
NSString *shellPath;
NSString *PBXModifierScriptPath;
NSURL *currentProjectURL;
NSURL *XCodeSupportProject;
NSURL *XCodeSupportProjectSources;
PRHEmptyGrowlDelegate *growlDelegateRef;
NSObject *delegate;
NSDate *appStartedTimestamp;
NSMutableDictionary *pathModificationDates;
BOOL supportsFileBasedListening;
BOOL reactToInodeModification;
BOOL isListening;
BOOL isUsingFileLevelAPI;
BOOL supportFileLevelAPI;
}
@property (strong) NSObject* delegate;
@property (strong) NSMutableArray* errorList;
@property (strong) NSURL* XCodeSupportProject;
@property (strong) NSURL* currentProjectURL;
@property (strong) NSString* currentProjectName;
@property (strong) NSString* currentAPIMode;
@property BOOL supportsFileBasedListening;
@property BOOL reactToInodeModification;
@property BOOL isListening;
@property BOOL supportFileLevelAPI;
@property BOOL isUsingFileLevelAPI;
- (BOOL)isObjJFile:(NSString*)path;
- (void)computeIgnoredPaths;
- (BOOL)isPathMatchingIgnoredPaths:(NSString*)aPath;
- (BOOL)isXIBFile:(NSString *)path;
- (BOOL)isXCCIgnoreFile:(NSString *)path;
- (BOOL)prepareXCodeSupportProject;
- (NSURL*)shadowHeaderURLForSourceURL:(NSURL*)aSourceURL;
- (void)cleanUpShadowsRelatedToSourceURL:(NSURL*)aSourceURL;
- (NSURL*)shadowImplementationURLForSourceURL:(NSURL*)aSourceURL;
- (NSURL*)sourceURLForShadowName:(NSString *)aString;
- (void)handleFileModification:(NSString*)fullPath notify:(BOOL)shouldNotify;
- (void)handleFileRemoval:(NSString*)fullPath;
- (void)initializeEventStreamWithPath:(NSString*)aPath;
- (void)stopEventStream;
- (void)updateLastEventId:(uint64_t)eventId;
- (void)updateUserDefaultsWithLastEventId;
- (void)synchronizeUserDefaultsWithDisk;
- (void)listenProjectAtPath:(NSString *)path;
- (void)clear;
- (void)start;
- (void)configure;
- (void)tidyShadowedFiles;
@end
@interface TNXCodeCapp (SnowLeopard)
- (void)updateLastModificationDate:(NSDate *)date forPath:(NSString *)path;
- (NSDate*)lastModificationDateForPath:(NSString *)path;
@end
-882
View File
@@ -1,882 +0,0 @@
/*
* This file is a part of program XcodeCapp
* Copyright (C) 2011 Antoine Mercadal (<primalmotion@archipelproject.org>)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import "TNXCodeCapp.h"
#include "macros.h"
NSString * const XCCUnderscoreReplacement = @"DoNotPutThisStringInFileNameOrWorldWillDie";
NSString * const XCCDidPopulateProjectNotification = @"XCCDidPopulateProjectNotification";
NSString * const XCCConversionStartNotification = @"XCCConversionStartNotification";
NSString * const XCCConversionStopNotification = @"XCCConversionStopNotification";
NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification";
@implementation TNXCodeCapp
@synthesize delegate;
@synthesize errorList;
@synthesize XCodeSupportProject;
@synthesize currentProjectURL;
@synthesize currentProjectName;
@synthesize supportsFileBasedListening;
@synthesize reactToInodeModification;
@synthesize currentAPIMode;
@synthesize isListening;
@synthesize supportFileLevelAPI;
@synthesize isUsingFileLevelAPI;
#pragma mark - Initialization
/*!
Initialize the AppController
*/
- (id)init
{
self = [super init];
if (self)
{
errorList = [NSMutableArray arrayWithCapacity:10];
fm = [NSFileManager defaultManager];
ignoredFilePaths = [NSMutableSet new];
parserPath = [[NSBundle mainBundle] pathForResource:@"parser" ofType:@"j"];
lastEventId = [[NSUserDefaults standardUserDefaults] objectForKey:@"lastEventId"];
appStartedTimestamp = [NSDate date];
[self setIsListening:NO];
[self setIsUsingFileLevelAPI:NO];
SInt32 versionMajor = 0;
SInt32 versionMinor = 0;
Gestalt(gestaltSystemVersionMajor, &versionMajor);
Gestalt(gestaltSystemVersionMinor, &versionMinor);
[self setSupportFileLevelAPI:versionMajor >= 10 && versionMinor >= 7];
// Uncomment to simulate 10.6 mode
// [self setSupportFileLevelAPI:NO];
[self configure];
NSString* myShell = [[[NSProcessInfo processInfo] environment] objectForKey:@"SHELL"];
if (myShell)
{
shellPath = myShell;
}
else
{
shellPath = @"/bin/bash";
}
if([shellPath isEqualToString:@"/bin/bash"])
{
if([fm fileExistsAtPath:[@"~/.bash_profile" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.bash_profile" stringByExpandingTildeInPath];
else if([fm fileExistsAtPath:[@"~/.bashrc" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.bashrc" stringByExpandingTildeInPath];
else if([fm fileExistsAtPath:[@"~/.profile" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.profile" stringByExpandingTildeInPath];
else
profilePath = @"";
}
else if ([shellPath isEqualToString:@"/bin/zsh"])
{
if([fm fileExistsAtPath:[@"~/.zshrc" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.zshrc" stringByExpandingTildeInPath];
else if([fm fileExistsAtPath:[@"~/.profile" stringByExpandingTildeInPath]])
profilePath = [@"source ~/.profile" stringByExpandingTildeInPath];
else
profilePath = @"";
}
else
{
NSAlert *alert = [NSAlert alertWithMessageText:@"Shell not recognized."
defaultButton:@"OK"
alternateButton:nil
otherButton:nil
informativeTextWithFormat:@"You are running %@ as your shell, which is not supported. Please change your shell to either BASH or ZSH.", shellPath];
[alert runModal];
profilePath = @"";
}
}
return self;
}
- (void)start
{
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"XCCReopenLastProject"])
return;
NSString *lastOpenedPath = [[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenedPath"];
if (lastOpenedPath)
{
if ([fm fileExistsAtPath:lastOpenedPath])
{
[self listenProjectAtPath:[NSString stringWithFormat:@"%@/", lastOpenedPath]];
}
else
{
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"LastOpenedPath"];
}
}
}
#pragma mark - Project Management
/*!
Check if .XcodeSupport needs to be initialized.
If not needed, check that all J files are mirrored. If no,
then launch conversion for missing mirrored h files
@return YES or NO
*/
- (BOOL)prepareXCodeSupportProject
{
XCodeSupportProjectName = [NSString stringWithFormat:@"%@.xcodeproj/", currentProjectName];
XCodeTemplatePBXPath = [[NSBundle mainBundle] pathForResource:@"project.pbxproj" ofType:@"sample"];
XCodeSupportProject = [NSURL URLWithString:XCodeSupportProjectName relativeToURL:currentProjectURL];
XCodeSupportProjectSources = [NSURL URLWithString:@".XcodeSupport/" relativeToURL:currentProjectURL];
XCodeSupportPBXPath = [NSString stringWithFormat:@"%@/project.pbxproj", [XCodeSupportProject path]];
PBXModifierScriptPath = [[NSBundle mainBundle] pathForResource:@"pbxprojModifier" ofType:@"py"];
//[fm removeItemAtURL:XCodeSupportProjectSources error:nil];
//[fm removeItemAtURL:XCodeSupportProject error:nil];
// create the template project if it doesn't exist
if (![fm fileExistsAtPath:[XCodeSupportProjectSources path]])
{
NSLog(@"prepareXCodeSupportProject: Xcode support folder created at: %@", [XCodeSupportProject path]);
[fm createDirectoryAtPath:[XCodeSupportProject path] withIntermediateDirectories:YES attributes:nil error:nil];
DLog(@"prepareXCodeSupportProject: Copying project.pbxproj from %@ to %@", XCodeTemplatePBXPath, [XCodeSupportProject path]);
[fm copyItemAtPath:XCodeTemplatePBXPath toPath:XCodeSupportPBXPath error:nil];
DLog(@"prepareXCodeSupportProject: Reading the content of the project.pbxproj");
NSMutableString *PBXContent = [NSMutableString stringWithContentsOfFile:XCodeSupportPBXPath encoding:NSUTF8StringEncoding error:nil];
[PBXContent writeToFile:XCodeSupportPBXPath atomically:YES encoding:NSUTF8StringEncoding error:nil];
DLog(@"prepareXCodeSupportProject: PBX file adapted to the project");
[self createXcodeSupportProjectSourcesDirIfNecessary];
return NO;
}
[self createXcodeSupportProjectSourcesDirIfNecessary];
return YES;
}
/*!
Create the .XcodeSupport/Sources folder if necessary.
*/
- (void)createXcodeSupportProjectSourcesDirIfNecessary
{
if ([fm fileExistsAtPath:[XCodeSupportProjectSources path]])
return;
DLog(@"createXcodeSupportProjectSourcesDirIfNecessary: Creating source folder %@", [XCodeSupportProjectSources path]);
[fm createDirectoryAtPath:[XCodeSupportProjectSources path] withIntermediateDirectories:YES attributes:nil error:nil];
}
/*!
Initialize the creation of the .XcodeSupport project. This
Operation is threaded
@param arguments Thread arguments (not used)
@param shouldNotify is YES, XCCDidPopulateProjectNotification will be send
*/
- (void)populateXCodeProject:(NSNumber *)shouldNotify
{
if ([shouldNotify boolValue])
[delegate performSelector:@selector(growlWithTitle:message:) withObject:@"Loading project" withObject:[currentProjectURL path]];
NSArray *subdpaths = [fm subpathsAtPath:[currentProjectURL path]];
for (NSString *p in subdpaths)
{
NSString *filePath = [NSString stringWithFormat:@"%@/%@", [currentProjectURL path], p];
BOOL isDir = NO;
[fm fileExistsAtPath:filePath isDirectory:&isDir];
if (isDir || ![self isObjJFile:filePath] || [self isPathMatchingIgnoredPaths:filePath])
continue;
NSURL *eventualShadow = [self shadowHeaderURLForSourceURL:[NSURL fileURLWithPath:filePath]];
if (![fm fileExistsAtPath:[eventualShadow path]])
{
DLog(@"populateXCodeProject: Computing missing shadow file for %@", filePath);
[self handleFileModification:filePath notify:NO];
}
}
if ([shouldNotify boolValue])
{
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:currentProjectURL, @"URL", nil];
[[NSNotificationCenter defaultCenter] postNotificationName:XCCDidPopulateProjectNotification object:self userInfo:info];
}
}
/*!
Start all needed processes for listening to a given path
@param path The folder path to listen to
*/
- (void)listenProjectAtPath:(NSString *)path
{
NSMutableString *tempName = [NSMutableString stringWithString:[path lastPathComponent]];
currentProjectURL = [NSURL fileURLWithPath:path];
[tempName replaceOccurrencesOfString:@" "
withString:@"_"
options:NSCaseInsensitiveSearch
range:NSMakeRange(0, [tempName length])];
currentProjectName = [NSString stringWithString:tempName];
[self computeIgnoredPaths];
BOOL isProjectReady = [self prepareXCodeSupportProject];
[NSThread detachNewThreadSelector:@selector(populateXCodeProject:) toTarget:self withObject:[NSNumber numberWithBool:!isProjectReady]];
[self initializeEventStreamWithPath:[currentProjectURL path]];
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:path, @"path", [NSNumber numberWithInt:(isProjectReady) ? 1 : 0], @"ready", nil];
[[NSNotificationCenter defaultCenter] postNotificationName:XCCListeningStartNotification object:self userInfo:info];
[[NSUserDefaults standardUserDefaults] setObject:[currentProjectURL path] forKey:@"LastOpenedPath"];
}
#pragma mark - Event Stream
/*!
Initializes the FSEvent stream
@param aPath the path of the folder to listen
*/
- (void)initializeEventStreamWithPath:(NSString*)aPath
{
if ([self isListening])
return;
[self stopEventStream];
NSMutableArray *pathsToWatch = [NSMutableArray arrayWithObject:aPath];
void *appPointer = (__bridge void *)self;
FSEventStreamContext context = {0, appPointer, NULL, NULL, NULL};
CFTimeInterval latency = 2.0;
FSEventStreamCreateFlags flags = 0;
if (supportsFileBasedListening)
{
DLog(@"initializeEventStreamWithPath: Initializing the FSEventStream at file level (clean)");
flags = kFSEventStreamCreateFlagUseCFTypes | kFSEventStreamCreateFlagNoDefer | kFSEventStreamCreateFlagFileEvents;
}
else
{
NSLog(@"Initializing the FSEventStream at folder level (dirty)");
flags = kFSEventStreamCreateFlagUseCFTypes;
}
// add symlinked directories
NSArray *fileList = [fm contentsOfDirectoryAtPath:aPath error:nil];
for (NSString *node in fileList)
{
NSDictionary *attributes = [fm attributesOfItemAtPath:aPath error:nil];
if ([[attributes objectForKey:@"NSFileType"] isEqualTo:NSFileTypeDirectory])
{
NSString *subDirectoryPath = [aPath stringByAppendingPathComponent:node];
NSString *symlinkDestination = [fm destinationOfSymbolicLinkAtPath:subDirectoryPath error:nil];
if (symlinkDestination)
{
[pathsToWatch addObject:subDirectoryPath];
}
}
}
stream = FSEventStreamCreate(NULL, &fsevents_callback, &context, (__bridge CFArrayRef) pathsToWatch,
[lastEventId unsignedLongLongValue], latency, flags);
FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
FSEventStreamStart(stream);
[self setIsListening:YES];
}
/*!
Stop listening the FSEvent stream if active
*/
- (void)stopEventStream
{
if (stream)
{
FSEventStreamStop(stream);
FSEventStreamUnscheduleFromRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
FSEventStreamInvalidate(stream);
FSEventStreamRelease(stream);
stream = NULL;
}
[self setIsListening:NO];
}
/*!
Stops and clear the worker
*/
- (void)clear
{
[self updateUserDefaultsWithLastEventId];
[self synchronizeUserDefaultsWithDisk];
currentProjectURL = nil;
currentProjectName = nil;
[ignoredFilePaths removeAllObjects];
[self stopEventStream];
}
/*!
Choose the API mode according to default
*/
- (void)configure
{
if (![self supportFileLevelAPI])
{
DLog(@"configure: System doesn't support file level API");
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInt:2] forKey:@"XCCAPIMode"];
}
switch ([[NSUserDefaults standardUserDefaults] integerForKey:@"XCCAPIMode"])
{
case 0:
supportsFileBasedListening = [self supportFileLevelAPI] ? YES : NO;
break;
case 1:
supportsFileBasedListening = YES;
break;
case 2:
supportsFileBasedListening = NO;
break;
}
if (supportsFileBasedListening)
{
DLog(@"configure: using 10.7+ mode listening (clean)");
[self setCurrentAPIMode:@"File level (Lion)"];
[self setIsUsingFileLevelAPI:YES];
reactToInodeModification = [[NSUserDefaults standardUserDefaults] boolForKey:@"XCCReactMode"];
}
else
{
DLog(@"configure: using 10.6 mode listening (dirty)");
reactToInodeModification = NO;
[self setCurrentAPIMode:@"Folder level (Snow Leopard)"];
[self setIsUsingFileLevelAPI:NO];
}
}
/*!
Update the last event ID. We use a method because
This is called from outside the class, in the FSEvent callback
@param eventId the current event ID value
*/
- (void)updateLastEventId:(uint64_t)eventId
{
lastEventId = [NSNumber numberWithUnsignedLongLong:eventId];
}
/*!
Updates the user defaults with the last recorded event Id.
*/
- (void)updateUserDefaultsWithLastEventId
{
if (lastEventId && [lastEventId longLongValue] != 0)
{
[[NSUserDefaults standardUserDefaults] setObject:lastEventId forKey:@"lastEventId"];
}
}
/*!
Tells the standard user defaults to synchronize with disk.
*/
- (void)synchronizeUserDefaultsWithDisk
{
[[NSUserDefaults standardUserDefaults] synchronize];
}
#pragma mark - Shell Helpers
/*!
Run a NSTask with the given arguments
@param arguments NSArray containing the NSTask arguments
@return NSarray containing the return code (int) and the eventual response (string)
*/
- (NSArray *)runTask:(NSArray *)arguments
{
NSTask *task;
NSData *stdOut;
NSString *response;
NSNumber *status;
task = [[NSTask alloc] init];
[task setLaunchPath:shellPath];
[task setArguments: arguments];
[task setStandardOutput:[NSPipe pipe]];
[task launch];
[task waitUntilExit];
stdOut = [[[task standardOutput] fileHandleForReading] availableData];
response = [[NSString alloc] initWithData:stdOut encoding:NSUTF8StringEncoding];
status = [NSNumber numberWithInt:[task terminationStatus]];
return [NSArray arrayWithObjects:status, response, nil];
}
#pragma mark - Event Handlers
/*!
Handle a file modification. If it's a .J or XIB or NIB, it will
perform the according conversion. If it's .xcodecapp-ignore, it will
update the list of ignored files.
@param fullPath the full path of the modified file
@param shouldNotify if YES, Growl notifications will be displayed
*/
- (void)handleFileModification:(NSString*)fullPath notify:(BOOL)shouldNotify
{
if (![self isXIBFile:fullPath] && ![self isObjJFile:fullPath] && ![self isXCCIgnoreFile:fullPath])
return;
if ([self isPathMatchingIgnoredPaths:fullPath] || ![fm fileExistsAtPath:fullPath])
return;
DLog(@"handleFileModification:notify: Parsing modified file: %@", fullPath);
NSArray *arguments = nil;
NSArray *PBXArguments = nil;
NSString *successTitle = nil;
NSString *successMsg = nil;
NSString *response = nil;
NSNumber *status = [NSNumber numberWithInt:0];
NSString *splitPath = [fullPath substringFromIndex:[[currentProjectURL path] length] + 1];
NSURL *encodedURL = [NSURL URLWithString:[fullPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSURL *shadowHeaderURL = [self shadowHeaderURLForSourceURL:encodedURL];
NSURL *shadowImplementationURL = [self shadowImplementationURLForSourceURL:encodedURL];
DLog(@"handleFileModification:notify: Shadow header path: %@", shadowHeaderURL);
DLog(@"handleFileModification:notify: Shadow implementation path: %@", shadowImplementationURL);
[[NSNotificationCenter defaultCenter] postNotificationName:XCCConversionStartNotification object:self];
if ([self isXIBFile:fullPath])
{
arguments = [NSArray arrayWithObjects: @"-c",
[NSString stringWithFormat:@"(%@; nib2cib '%@';) 2>&1", profilePath, fullPath],@"",nil];
successTitle = @"XIB converted";
successMsg = splitPath;
}
else if ([self isObjJFile:fullPath])
{
arguments = [NSArray arrayWithObjects: @"-c",
[NSString stringWithFormat:@"(%@; objj '%@' '%@' '%@' '%@';) 2>&1",
profilePath,
parserPath,
fullPath,
[shadowHeaderURL path],
[shadowImplementationURL path]],nil];
PBXArguments = [NSArray arrayWithObjects: @"-c",
[NSString stringWithFormat:@"(%@; python %@ add '%@' '%@' '%@' '%@' '%@') 2>&1",
profilePath,
PBXModifierScriptPath,
XCodeSupportPBXPath,
[shadowHeaderURL path],
[shadowImplementationURL path],
fullPath,
[currentProjectURL path]],nil];
successTitle = @"Objective-J source processed";
successMsg = splitPath;
}
else if ([self isXCCIgnoreFile:fullPath])
{
[self computeIgnoredPaths];
successTitle = @".xcodecapp-ignore processed";
successMsg = @"Ignored files list updated";
arguments = nil;
}
// Run the task and get the response if needed
if (arguments)
{
DLog(@"handleFileModification:notify: Running conversion task...");
NSArray *statusInfo = [self runTask:arguments];
status = [statusInfo objectAtIndex:0];
response = [statusInfo objectAtIndex:1];
DLog(@"handleFileModification:notify: Conversion task result/response: %@/%@", status, response);
if ([status intValue] == 0 && shouldNotify)
{
[delegate performSelector:@selector(growlWithTitle:message:) withObject:successTitle withObject:successMsg];
}
else if (![status intValue] == 0)
{
if (response)
{
NSDictionary *errorDictionary = [NSDictionary dictionaryWithObjectsAndKeys:response, @"message",
splitPath, @"file",
fullPath, @"path", nil];
[errorList addObject:errorDictionary];
}
[delegate performSelector:@selector(growlWithTitle:message:) withObject:@"Error processing file" withObject:splitPath];
}
}
if (PBXArguments)
{
DLog(@"handleFileModification:notify: Running update PBX task...");
NSArray *statusInfo = [self runTask:PBXArguments];
status = [statusInfo objectAtIndex:0];
response = [statusInfo objectAtIndex:1];
DLog(@"handleFileModification:notify: Update PBX Task result/response: %@/%@", status, response);
}
[[NSNotificationCenter defaultCenter] postNotificationName:XCCConversionStopNotification object:self];
DLog(@"handleFileModification:notify: Processed: %@", fullPath);
}
/*!
Handle a file deletion. If it's a .J, it will
remove the shadowed .h file. If it's .xcodecapp-ignore
it will reset the list of ignored files.
@param fullPath the full path of the modified file
@param shouldNotify if YES, Growl notifications will be displayed
*/
- (void)handleFileRemoval:(NSString*)fullPath
{
if ([self isPathMatchingIgnoredPaths:fullPath] || [fm fileExistsAtPath:fullPath])
return;
NSString *encodedPath = [fullPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
if ([self isObjJFile:fullPath])
[self cleanUpShadowsRelatedToSourceURL:[NSURL URLWithString:encodedPath]];
else if ([self isXCCIgnoreFile:fullPath])
[self computeIgnoredPaths];
}
#pragma mark - Source Files Management
/*!
Check if given full path is Objective-J file
@param path the path to check
@return YES or NO
*/
- (BOOL)isObjJFile:(NSString *)path
{
return [[[path pathExtension] uppercaseString] isEqual:@"J"];
}
/*!
Check if given full path is XIB or NIB file
@param path the path to check
@return YES or NO
*/
- (BOOL)isXIBFile:(NSString *)path
{
path = [[path pathExtension] uppercaseString];
return [path isEqual:@"XIB"] || [path isEqual:@"NIB"];
}
/*!
Check if given full path is the .xcodecapp-ignore file
@param path the path to check
@return YES or NO
*/
- (BOOL)isXCCIgnoreFile:(NSString *)path
{
path = [path lastPathComponent];
return [path isEqual:@".xcodecapp-ignore"];
}
#pragma mark - Shadow Files Management
/*!
Compute the mirorred (shadow) header file name for a given path
@param aSourceURL the origin path
@return NSURL representing the shadow URL for the header file
*/
- (NSURL *)shadowHeaderURLForSourceURL:(NSURL*)aSourceURL
{
if (!aSourceURL)
[NSException raise:NSInvalidArgumentException format:@"shadowHeaderURLForSourceURL: aSource URL must not be null"];
NSMutableString *flattenedPath = [NSMutableString stringWithString:[aSourceURL path]];
// Replace "_" with a substring that is unlikely to be in a filename
[flattenedPath replaceOccurrencesOfString:@"_"
withString:XCCUnderscoreReplacement
options:0
range:NSMakeRange(0, [flattenedPath length])];
[flattenedPath replaceOccurrencesOfString:@"/"
withString:@"_"
options:0
range:NSMakeRange(0, [flattenedPath length])];
DLog(@"shadowHeaderURLForSourceURL: Flattened path: %@", flattenedPath);
NSString *basename = [NSString stringWithFormat:@"%@.h", [[flattenedPath stringByDeletingPathExtension] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
return [NSURL URLWithString:basename relativeToURL:XCodeSupportProjectSources];
}
/*!
Compute the mirorred (shadow) implementation file name for a given path
@param aSourceURL the origin path
@return NSURL representing the shadow URL for the implementation file
*/
- (NSURL *)shadowImplementationURLForSourceURL:(NSURL*)aSourceURL
{
if (!aSourceURL)
[NSException raise:NSInvalidArgumentException format:@"shadowImplementationURLForSourceURL: aSource URL must not be null"];
NSURL *shadowHeaderURL = [self shadowHeaderURLForSourceURL:aSourceURL];
NSURL *shadowImplPath = [[shadowHeaderURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"m"];
return shadowImplPath;
}
/*!
Compute the Cappuccino source file that is related to the given shadow header file URL
@param aString the origin path
@return NSURL representing the URL for the related Cappuccino source file
*/
- (NSURL *)sourceURLForShadowName:(NSString *)aString
{
NSMutableString * unshadowedPath = [NSMutableString stringWithString:aString];
[unshadowedPath replaceOccurrencesOfString:@"_"
withString:@"/"
options:0
range:NSMakeRange(0, [unshadowedPath length])];
[unshadowedPath replaceOccurrencesOfString:XCCUnderscoreReplacement
withString:@"_"
options:0
range:NSMakeRange(0, [unshadowedPath length])];
[unshadowedPath replaceOccurrencesOfString:@".h"
withString:@".j"
options:0
range:NSMakeRange(0, [unshadowedPath length])];
return [NSURL fileURLWithPath:[NSString stringWithString:unshadowedPath]];
}
/*!
Clean up any shadow files and PBX entries related to given the Cappuccino source file URL
@param anURL the Cappuccino source file URL
*/
- (void)cleanUpShadowsRelatedToSourceURL:(NSURL *)anURL
{
NSURL *shadowHeaderURL = [self shadowHeaderURLForSourceURL:anURL];
NSURL *shadowImplementationURL = [self shadowImplementationURLForSourceURL:anURL];
DLog(@"cleanUpShadowsRelatedToSourceURL: Removing shadow header file: %@", shadowHeaderURL);
[fm removeItemAtURL:shadowHeaderURL error:nil];
DLog(@"cleanUpShadowsRelatedToSourceURL: Removing shadow implementation file: %@", shadowImplementationURL);
[fm removeItemAtURL:shadowImplementationURL error:nil];
DLog(@"cleanUpShadowsRelatedToSourceURL:Removing PBX reference task...");
NSArray *PBXArguments = [NSArray arrayWithObjects: @"-c",
[NSString stringWithFormat:@"(%@; python %@ remove '%@' '%@' '%@' '%@' '%@') 2>&1",
profilePath,
PBXModifierScriptPath,
XCodeSupportPBXPath,
[shadowHeaderURL path],
[shadowImplementationURL path],
[anURL path],
[currentProjectURL path]],nil];
NSArray *statusInfo = [self runTask:PBXArguments];
NSNumber *status = [statusInfo objectAtIndex:0];
NSString *response = [statusInfo objectAtIndex:1];
DLog(@"cleanUpShadowsRelatedToSourceURL: PBX Reference removal status/response: %@/%@", status, response);
}
/*!
Clean the support folder according to files present in given path
*/
- (void)tidyShadowedFiles
{
NSArray *subpaths = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:[XCodeSupportProjectSources path] error:NULL];
for (NSString *subpath in subpaths)
{
if (![[subpath pathExtension] isEqual:@".h"] || [[subpath lastPathComponent] isEqual:@"xcc_general_include.h"])
continue;
NSURL *unshadowed = [self sourceURLForShadowName:subpath];
if (![fm fileExistsAtPath:[unshadowed path]])
{
[self cleanUpShadowsRelatedToSourceURL:unshadowed];
if (![self supportFileLevelAPI] && [self respondsToSelector:@selector(updateLastModificationDate:forPath:)])
[self performSelector:@selector(updateLastModificationDate:forPath:) withObject:nil withObject:unshadowed];
}
}
}
#pragma mark - XCC Ignore management
/*!
Compute the ignored paths according to any existing
.xcodecapp-ignore file
*/
- (void)computeIgnoredPaths
{
NSString *ignorePath = [NSString stringWithFormat:@"%@/.xcodecapp-ignore", [currentProjectURL path]];
[ignoredFilePaths removeAllObjects];
if ([fm fileExistsAtPath:ignorePath])
{
NSString *ignoreFileContent = [NSString stringWithContentsOfFile:ignorePath encoding:NSUTF8StringEncoding error:nil];
NSArray *ignoredPatterns = [ignoreFileContent componentsSeparatedByString:@"\n"];
for (NSString *pattern in ignoredPatterns)
{
if ([pattern length])
[ignoredFilePaths addObject:pattern];
}
}
[ignoredFilePaths addObject:@"*/.git/*"];
[ignoredFilePaths addObject:@"*/.svn/*"];
[ignoredFilePaths addObject:@"*/.hg/*"];
[ignoredFilePaths addObject:@"*/Frameworks/*"];
[ignoredFilePaths addObject:@"*/.XcodeSupport/*"];
[ignoredFilePaths addObject:@"*/Build/*"];
[ignoredFilePaths addObject:@"*/NS_*.j"];
[ignoredFilePaths addObject:@"*main.j"];
[ignoredFilePaths addObject:@"*.xcodeproj/*"];
[ignoredFilePaths addObject:@"*.DS_Store"];
NSLog(@"Ignoring file paths: %@", ignoredFilePaths);
}
/*!
Check is given path should be ignored
@param aPath the path to check
@return YES if it should be ignored, NO otherwise
*/
- (BOOL)isPathMatchingIgnoredPaths:(NSString*)aPath
{
if ([ignoredFilePaths count] == 0)
return NO;
for (NSString *ignoredPath in ignoredFilePaths)
{
if ([ignoredPath length] == 0)
continue;
NSMutableString *regexp = [ignoredPath mutableCopy];
[regexp replaceOccurrencesOfString:@"/"
withString:@"\\/"
options:0
range:NSMakeRange(0, [regexp length])];
[regexp replaceOccurrencesOfString:@"."
withString:@"\\."
options:0
range:NSMakeRange(0, [regexp length])];
[regexp replaceOccurrencesOfString:@"*"
withString:@".*"
options:0
range:NSMakeRange(0, [regexp length])];
[regexp replaceOccurrencesOfString:@" "
withString:@"\\ "
options:0
range:NSMakeRange(0, [regexp length])];
NSPredicate *regextest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regexp];
if ([regextest evaluateWithObject:aPath])
return YES;
}
return NO;
}
@end
@implementation TNXCodeCapp (SnowLeopard)
- (void)updateLastModificationDate:(NSDate *)date forPath:(NSString *)path
{
if (!pathModificationDates)
{
pathModificationDates = [[[NSUserDefaults standardUserDefaults] dictionaryForKey:@"pathModificationDates"] mutableCopy];
if (!pathModificationDates)
pathModificationDates = [NSMutableDictionary new];
}
if (date)
[pathModificationDates setObject:date forKey:path];
else
[pathModificationDates removeObjectForKey:path];
[[NSUserDefaults standardUserDefaults] setObject:pathModificationDates forKey:@"pathModificationDates"];
}
- (NSDate *)lastModificationDateForPath:(NSString *)path
{
if (!pathModificationDates)
{
pathModificationDates = [[[NSUserDefaults standardUserDefaults] dictionaryForKey:@"pathModificationDates"] mutableCopy];
if (!pathModificationDates)
pathModificationDates = [NSMutableDictionary new];
}
if ([pathModificationDates valueForKey:path] != nil)
return [pathModificationDates valueForKey:path];
else
return appStartedTimestamp;
}
@end
Binary file not shown.
File diff suppressed because it is too large. Load diff
@@ -1,152 +0,0 @@
// !$*UTF8*$!
{
29B97313FDCFA39411CA2CEA /* Project object */ = {
activeArchitecture = i386;
activeBuildConfigurationName = Debug;
activeExecutable = 8E01A8CD0DE519E70008BB35 /* xcodecapp-cocoa */;
activeTarget = 8D1107260486CEB800E47090 /* xcodecapp-cocoa */;
addToTargets = (
8D1107260486CEB800E47090 /* xcodecapp-cocoa */,
);
breakpoints = (
8EF107B90DFCF23200C52EB1 /* AppController.m:30 */,
8EF107CA0DFCF4A100C52EB1 /* AppController.m:62 */,
);
codeSenseManager = 8E01A8DC0DE51A060008BB35 /* Code sense */;
executables = (
8E01A8CD0DE519E70008BB35 /* xcodecapp-cocoa */,
);
perUserDictionary = {
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
71,
20,
48,
43,
43,
20,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
PBXFileDataSource_Target_ColumnID,
);
};
PBXPerProjectTemplateStateSaveDate = 244845075;
PBXWorkspaceStateSaveDate = 244845075;
};
sourceControlManager = 8E01A8DB0DE51A060008BB35 /* Source Control */;
userBuildSettings = {
};
};
29B97316FDCFA39411CA2CEA /* main.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1176, 392}}";
sepNavSelRange = "{818, 0}";
sepNavVisRange = "{297, 521}";
};
};
8D1107260486CEB800E47090 /* xcodecapp-cocoa */ = {
activeExec = 0;
executables = (
8E01A8CD0DE519E70008BB35 /* xcodecapp-cocoa */,
);
};
8E01A8CD0DE519E70008BB35 /* xcodecapp-cocoa */ = {
isa = PBXExecutable;
activeArgIndices = (
);
argumentStrings = (
);
autoAttachOnCrash = 1;
breakpointsEnabled = 0;
configStateDict = {
};
customDataFormattersEnabled = 1;
debuggerPlugin = GDBDebugging;
disassemblyDisplayState = 0;
dylibVariantSuffix = "";
enableDebugStr = 1;
environmentEntries = (
);
executableSystemSymbolLevel = 0;
executableUserSymbolLevel = 0;
libgmallocEnabled = 0;
name = xcodecapp-cocoa;
savedGlobals = {
};
sourceDirectories = (
);
variableFormatDictionary = {
"*eventIds-long long unsigned int-mycallback" = 3;
};
};
8E01A8DB0DE51A060008BB35 /* Source Control */ = {
isa = PBXSourceControlManager;
fallbackIsa = XCSourceControlManager;
isSCMEnabled = 0;
scmConfiguration = {
};
};
8E01A8DC0DE51A060008BB35 /* Code sense */ = {
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
8E01A91D0DE9EED20008BB35 /* AppController.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {692, 280}}";
sepNavSelRange = "{234, 37}";
sepNavVisRange = "{146, 185}";
sepNavWindowFrame = "{{112, 264}, {1441, 774}}";
};
};
8E01A91E0DE9EED20008BB35 /* AppController.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {692, 2324}}";
sepNavSelRange = "{4949, 0}";
sepNavVisRange = "{3760, 551}";
sepNavWindowFrame = "{{15, -1}, {1441, 774}}";
};
};
8EF107B90DFCF23200C52EB1 /* AppController.m:30 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = 8E01A91E0DE9EED20008BB35 /* AppController.m */;
functionName = "-awakeFromNib";
hitCount = 1;
ignoreCount = 0;
lineNumber = 30;
location = xcodecapp-cocoa;
modificationTime = 234708321.122562;
state = 2;
};
8EF107CA0DFCF4A100C52EB1 /* AppController.m:62 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = 8E01A91E0DE9EED20008BB35 /* AppController.m */;
functionName = "mycallback()";
hitCount = 0;
ignoreCount = 0;
lineNumber = 62;
location = xcodecapp-cocoa;
modificationTime = 234708306.739971;
state = 2;
};
}
@@ -7,393 +7,597 @@
objects = {
/* Begin PBXBuildFile section */
0218442515D32B5D00A782B8 /* pbxprojModifier.py in Resources */ = {isa = PBXBuildFile; fileRef = 0218442415D32B5D00A782B8 /* pbxprojModifier.py */; };
022BCEA71468632000B72910 /* project.pbxproj.sample in Resources */ = {isa = PBXBuildFile; fileRef = 022BCEA61468632000B72910 /* project.pbxproj.sample */; };
024A041413699DD400DCBE4D /* parser.j in Resources */ = {isa = PBXBuildFile; fileRef = 024A041113699D6800DCBE4D /* parser.j */; };
026F3B6213866B0B00EE5B83 /* xcodecapp-icon-inactive.png in Resources */ = {isa = PBXBuildFile; fileRef = 026F3B6113866B0B00EE5B83 /* xcodecapp-icon-inactive.png */; };
026F3B6513866E7D00EE5B83 /* xcodecapp-icon-active.png in Resources */ = {isa = PBXBuildFile; fileRef = 026F3B6413866E7D00EE5B83 /* xcodecapp-icon-active.png */; };
027D999B13696A7000D3DB13 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
027D999C13696A7000D3DB13 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
027D999E13696A7000D3DB13 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
027D999F13696A7000D3DB13 /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E01A91E0DE9EED20008BB35 /* AppController.m */; };
027D99A113696A7000D3DB13 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
027D99A213696A7000D3DB13 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E01A8DD0DE51A7C0008BB35 /* CoreServices.framework */; };
027FE49D1462D74C00B1AB92 /* TNXCodeCapp.m in Sources */ = {isa = PBXBuildFile; fileRef = 027FE49C1462D74C00B1AB92 /* TNXCodeCapp.m */; };
027FE4BA1462F64E00B1AB92 /* xcodecapp-icon-working.png in Resources */ = {isa = PBXBuildFile; fileRef = 027FE4B91462F64E00B1AB92 /* xcodecapp-icon-working.png */; };
027FE4BD1462F7EB00B1AB92 /* FSEventCallback.m in Sources */ = {isa = PBXBuildFile; fileRef = 027FE4BC1462F7EB00B1AB92 /* FSEventCallback.m */; };
0289AC9414668CAF003CD975 /* XcodeCapp.icns in Resources */ = {isa = PBXBuildFile; fileRef = 0289AC9314668CAF003CD975 /* XcodeCapp.icns */; };
0294F09315D345A500840547 /* mod_pbxproj.py in Resources */ = {isa = PBXBuildFile; fileRef = 0294F09215D345A500840547 /* mod_pbxproj.py */; };
02998CEB1369BF7D006C73DB /* Growl Registration Ticket.growlRegDict in Resources */ = {isa = PBXBuildFile; fileRef = 02998CEA1369BF7D006C73DB /* Growl Registration Ticket.growlRegDict */; };
02998CF71369C339006C73DB /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 02998CF61369C339006C73DB /* Growl.framework */; };
02998CF91369C38A006C73DB /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 02998CF61369C339006C73DB /* Growl.framework */; };
02B1C8D816B25C74003C6E82 /* TNErrorDataView.m in Sources */ = {isa = PBXBuildFile; fileRef = 02B1C8D716B25C74003C6E82 /* TNErrorDataView.m */; };
4E2D0D01154840B400475C01 /* help.rtfd in Resources */ = {isa = PBXBuildFile; fileRef = 4E2D0D00154840B400475C01 /* help.rtfd */; };
4E2D0D03154840BC00475C01 /* help.rtfd in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4E2D0D00154840B400475C01 /* help.rtfd */; };
651DAE1F13B0CAB900ECA3F0 /* PRHEmptyGrowlDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 651DAE1D13B0CAB900ECA3F0 /* PRHEmptyGrowlDelegate.m */; };
E10E4CD717298E5F004AB09E /* project.pbxproj in Resources */ = {isa = PBXBuildFile; fileRef = E164FE2A172188F300263CE3 /* project.pbxproj */; };
E14015421740248C006C2792 /* XcodeProjectCloser.m in Sources */ = {isa = PBXBuildFile; fileRef = E14015411740248C006C2792 /* XcodeProjectCloser.m */; };
E1401543174025B8006C2792 /* XcodeProjectCloser.m in Sources */ = {isa = PBXBuildFile; fileRef = E14015411740248C006C2792 /* XcodeProjectCloser.m */; };
E164FDD31720E77100263CE3 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E164FDD21720E77100263CE3 /* Cocoa.framework */; };
E164FDDF1720E77100263CE3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E164FDDE1720E77100263CE3 /* main.m */; };
E164FDF51720EBC100263CE3 /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = E164FDF41720EBC100263CE3 /* AppController.m */; };
E164FDF71720EBD600263CE3 /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E164FDF61720EBD600263CE3 /* Growl.framework */; };
E164FDFF1720EC5B00263CE3 /* XcodeCapp.m in Sources */ = {isa = PBXBuildFile; fileRef = E164FDFB1720EC5B00263CE3 /* XcodeCapp.m */; };
E164FE181720F44B00263CE3 /* parser.j in Resources */ = {isa = PBXBuildFile; fileRef = E164FE171720F44B00263CE3 /* parser.j */; };
E164FE1A1720F49A00263CE3 /* Growl Registration Ticket.growlRegDict in Resources */ = {isa = PBXBuildFile; fileRef = E164FE191720F49A00263CE3 /* Growl Registration Ticket.growlRegDict */; };
E164FE1F1720F51E00263CE3 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E164FE1D1720F50100263CE3 /* CoreServices.framework */; };
E164FE211720F55600263CE3 /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E164FDF61720EBD600263CE3 /* Growl.framework */; };
E164FE2F1721A34900263CE3 /* icon-active.png in Resources */ = {isa = PBXBuildFile; fileRef = E164FE2C1721A34900263CE3 /* icon-active.png */; };
E164FE301721A34900263CE3 /* icon-inactive.png in Resources */ = {isa = PBXBuildFile; fileRef = E164FE2D1721A34900263CE3 /* icon-inactive.png */; };
E164FE311721A34900263CE3 /* icon-working.png in Resources */ = {isa = PBXBuildFile; fileRef = E164FE2E1721A34900263CE3 /* icon-working.png */; };
E170C3FB17296205003DC489 /* pbxprojModifier.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = E164FE141720F40400263CE3 /* pbxprojModifier.py */; };
E170C3FC1729620C003DC489 /* mod_pbxproj.py in CopyFiles */ = {isa = PBXBuildFile; fileRef = E164FE131720F40400263CE3 /* mod_pbxproj.py */; };
E170C3FD1729620F003DC489 /* parser.j in CopyFiles */ = {isa = PBXBuildFile; fileRef = E164FE171720F44B00263CE3 /* parser.j */; };
E170C40317298833003DC489 /* icon-active@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E170C3FE17298833003DC489 /* icon-active@2x.png */; };
E170C40417298833003DC489 /* icon-error.png in Resources */ = {isa = PBXBuildFile; fileRef = E170C3FF17298833003DC489 /* icon-error.png */; };
E170C40517298833003DC489 /* icon-error@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E170C40017298833003DC489 /* icon-error@2x.png */; };
E170C40617298833003DC489 /* icon-inactive@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E170C40117298833003DC489 /* icon-inactive@2x.png */; };
E170C40717298833003DC489 /* icon-working@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E170C40217298833003DC489 /* icon-working@2x.png */; };
E171D25F173C168C00210893 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E171D25E173C168C00210893 /* Foundation.framework */; };
E171D262173C168C00210893 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E171D261173C168C00210893 /* main.m */; };
E171D26A173C1ADD00210893 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E164FE1D1720F50100263CE3 /* CoreServices.framework */; };
E171D26C173C1C8300210893 /* xcc in CopyFiles */ = {isa = PBXBuildFile; fileRef = E171D25D173C168C00210893 /* xcc */; };
E17A822D172700B90095CD83 /* XcodeCapp.iconset in Resources */ = {isa = PBXBuildFile; fileRef = E17A822C172700B90095CD83 /* XcodeCapp.iconset */; };
E17B55411732F57700809FFB /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E17B55401732F57700809FFB /* Quartz.framework */; };
E17B55431732F72700809FFB /* help.pdf in Resources */ = {isa = PBXBuildFile; fileRef = E17B55421732F72700809FFB /* help.pdf */; };
E1A5594A172C5EE20088FB61 /* FindSourceFilesOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = E1A55949172C5EE20088FB61 /* FindSourceFilesOperation.m */; };
E1A5594D172CA8D40088FB61 /* ProcessSourceOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = E1A5594C172CA8D40088FB61 /* ProcessSourceOperation.m */; };
E1E90C411735D846005C6D5B /* DDLogLevel.m in Sources */ = {isa = PBXBuildFile; fileRef = E1E90C391735D846005C6D5B /* DDLogLevel.m */; };
E1E90C421735D846005C6D5B /* Notifications.m in Sources */ = {isa = PBXBuildFile; fileRef = E1E90C3C1735D846005C6D5B /* Notifications.m */; };
E1E90C431735D846005C6D5B /* UserDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = E1E90C3F1735D846005C6D5B /* UserDefaults.m */; };
E1E90C4B1735D8A1005C6D5B /* DDASLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = E1E90C461735D8A1005C6D5B /* DDASLLogger.m */; };
E1E90C4C1735D8A1005C6D5B /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = E1E90C481735D8A1005C6D5B /* DDLog.m */; };
E1E90C4D1735D8A1005C6D5B /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = E1E90C4A1735D8A1005C6D5B /* DDTTYLogger.m */; };
E1E90C62173B42D0005C6D5B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = E1E90C60173B42D0005C6D5B /* MainMenu.xib */; };
E1E90C67173B44CC005C6D5B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E1E90C65173B44CC005C6D5B /* InfoPlist.strings */; };
E1ED6B71173414E100641628 /* icon_128x128.png in Resources */ = {isa = PBXBuildFile; fileRef = E1ED6B6F173414E100641628 /* icon_128x128.png */; };
E1ED6B72173414E100641628 /* icon_128x128@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E1ED6B70173414E100641628 /* icon_128x128@2x.png */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
E171D26D173C405C00210893 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = E164FDC71720E77100263CE3 /* Project object */;
proxyType = 1;
remoteGlobalIDString = E171D25C173C168C00210893;
remoteInfo = xcc;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
02998CF81369C383006C73DB /* CopyFiles */ = {
E164FE201720F54800263CE3 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
02998CF91369C38A006C73DB /* Growl.framework in CopyFiles */,
4E2D0D03154840BC00475C01 /* help.rtfd in CopyFiles */,
E164FE211720F55600263CE3 /* Growl.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
E170C3F9172961E6003DC489 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 12;
files = (
E170C3FB17296205003DC489 /* pbxprojModifier.py in CopyFiles */,
E170C3FC1729620C003DC489 /* mod_pbxproj.py in CopyFiles */,
E170C3FD1729620F003DC489 /* parser.j in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
E171D25B173C168C00210893 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
E171D26B173C1C6900210893 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 6;
files = (
E171D26C173C1C8300210893 /* xcc in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
0218442415D32B5D00A782B8 /* pbxprojModifier.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = pbxprojModifier.py; sourceTree = "<group>"; };
022BCEA61468632000B72910 /* project.pbxproj.sample */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = project.pbxproj.sample; sourceTree = "<group>"; };
024A041113699D6800DCBE4D /* parser.j */ = {isa = PBXFileReference; explicitFileType = sourcecode.javascript; fileEncoding = 4; path = parser.j; sourceTree = "<group>"; };
026F3B6113866B0B00EE5B83 /* xcodecapp-icon-inactive.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "xcodecapp-icon-inactive.png"; sourceTree = "<group>"; };
026F3B6413866E7D00EE5B83 /* xcodecapp-icon-active.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "xcodecapp-icon-active.png"; sourceTree = "<group>"; };
027D9989136969DD00D3DB13 /* XcodeCapp.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XcodeCapp.pch; sourceTree = "<group>"; };
027D99A613696A7000D3DB13 /* XcodeCapp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XcodeCapp.app; sourceTree = BUILT_PRODUCTS_DIR; };
027FE49B1462D74C00B1AB92 /* TNXCodeCapp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TNXCodeCapp.h; sourceTree = "<group>"; };
027FE49C1462D74C00B1AB92 /* TNXCodeCapp.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNXCodeCapp.m; sourceTree = "<group>"; };
027FE4B91462F64E00B1AB92 /* xcodecapp-icon-working.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "xcodecapp-icon-working.png"; sourceTree = "<group>"; };
027FE4BB1462F7D600B1AB92 /* FSEventCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSEventCallback.h; sourceTree = "<group>"; };
027FE4BC1462F7EB00B1AB92 /* FSEventCallback.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSEventCallback.m; sourceTree = "<group>"; };
0289AC9314668CAF003CD975 /* XcodeCapp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = XcodeCapp.icns; sourceTree = "<group>"; };
0294F09215D345A500840547 /* mod_pbxproj.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = mod_pbxproj.py; sourceTree = "<group>"; };
02998CEA1369BF7D006C73DB /* Growl Registration Ticket.growlRegDict */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Growl Registration Ticket.growlRegDict"; sourceTree = "<group>"; };
02998CF61369C339006C73DB /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Growl.framework; sourceTree = "<group>"; };
02B1C8D616B25C74003C6E82 /* TNErrorDataView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TNErrorDataView.h; sourceTree = "<group>"; };
02B1C8D716B25C74003C6E82 /* TNErrorDataView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNErrorDataView.m; sourceTree = "<group>"; };
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
4E2D0D00154840B400475C01 /* help.rtfd */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; path = help.rtfd; sourceTree = "<group>"; };
651DAE1C13B0CAB900ECA3F0 /* PRHEmptyGrowlDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.objj.h; path = PRHEmptyGrowlDelegate.h; sourceTree = "<group>"; };
651DAE1D13B0CAB900ECA3F0 /* PRHEmptyGrowlDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PRHEmptyGrowlDelegate.m; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8E01A8DD0DE51A7C0008BB35 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
8E01A91D0DE9EED20008BB35 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; };
8E01A91E0DE9EED20008BB35 /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = AppController.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
E12AA95F14637828006F55D6 /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.objj.h; path = macros.h; sourceTree = "<group>"; };
E14015401740248C006C2792 /* XcodeProjectCloser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XcodeProjectCloser.h; sourceTree = "<group>"; };
E14015411740248C006C2792 /* XcodeProjectCloser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XcodeProjectCloser.m; sourceTree = "<group>"; };
E164FDCF1720E77100263CE3 /* XcodeCapp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XcodeCapp.app; sourceTree = BUILT_PRODUCTS_DIR; };
E164FDD21720E77100263CE3 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
E164FDD51720E77100263CE3 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
E164FDD61720E77100263CE3 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
E164FDD71720E77100263CE3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
E164FDDE1720E77100263CE3 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
E164FDE01720E77100263CE3 /* XcodeCapp-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XcodeCapp-Prefix.pch"; sourceTree = "<group>"; };
E164FDEF1720E7FA00263CE3 /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
E164FDF01720E7FA00263CE3 /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
E164FDF41720EBC100263CE3 /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = AppController.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
E164FDF61720EBD600263CE3 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = XcodeCapp/Growl.framework; sourceTree = SOURCE_ROOT; };
E164FDFB1720EC5B00263CE3 /* XcodeCapp.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = XcodeCapp.m; sourceTree = "<group>"; usesTabs = 0; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
E164FE131720F40400263CE3 /* mod_pbxproj.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = mod_pbxproj.py; sourceTree = "<group>"; };
E164FE141720F40400263CE3 /* pbxprojModifier.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = pbxprojModifier.py; sourceTree = "<group>"; };
E164FE171720F44B00263CE3 /* parser.j */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = parser.j; sourceTree = "<group>"; };
E164FE191720F49A00263CE3 /* Growl Registration Ticket.growlRegDict */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Growl Registration Ticket.growlRegDict"; sourceTree = "<group>"; };
E164FE1D1720F50100263CE3 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; };
E164FE2A172188F300263CE3 /* project.pbxproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.pbxproject; lineEnding = 0; name = project.pbxproj; path = Resources/project.pbxproj; sourceTree = "<group>"; };
E164FE2C1721A34900263CE3 /* icon-active.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon-active.png"; path = "Resources/icon-active.png"; sourceTree = "<group>"; };
E164FE2D1721A34900263CE3 /* icon-inactive.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon-inactive.png"; path = "Resources/icon-inactive.png"; sourceTree = "<group>"; };
E164FE2E1721A34900263CE3 /* icon-working.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon-working.png"; path = "Resources/icon-working.png"; sourceTree = "<group>"; };
E170C3FE17298833003DC489 /* icon-active@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon-active@2x.png"; path = "Resources/icon-active@2x.png"; sourceTree = "<group>"; };
E170C3FF17298833003DC489 /* icon-error.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon-error.png"; path = "Resources/icon-error.png"; sourceTree = "<group>"; };
E170C40017298833003DC489 /* icon-error@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon-error@2x.png"; path = "Resources/icon-error@2x.png"; sourceTree = "<group>"; };
E170C40117298833003DC489 /* icon-inactive@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon-inactive@2x.png"; path = "Resources/icon-inactive@2x.png"; sourceTree = "<group>"; };
E170C40217298833003DC489 /* icon-working@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon-working@2x.png"; path = "Resources/icon-working@2x.png"; sourceTree = "<group>"; };
E171D25D173C168C00210893 /* xcc */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = xcc; sourceTree = BUILT_PRODUCTS_DIR; };
E171D25E173C168C00210893 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
E171D261173C168C00210893 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
E171D264173C168C00210893 /* xcc-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "xcc-Prefix.pch"; sourceTree = "<group>"; };
E17A822C172700B90095CD83 /* XcodeCapp.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; name = XcodeCapp.iconset; path = Resources/XcodeCapp.iconset; sourceTree = "<group>"; };
E17B55401732F57700809FFB /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; };
E17B55421732F72700809FFB /* help.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = help.pdf; path = Resources/help.pdf; sourceTree = "<group>"; };
E1A55949172C5EE20088FB61 /* FindSourceFilesOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = FindSourceFilesOperation.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
E1A5594C172CA8D40088FB61 /* ProcessSourceOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ProcessSourceOperation.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
E1E90C371735D82B005C6D5B /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = "<group>"; };
E1E90C381735D846005C6D5B /* DDLogLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDLogLevel.h; sourceTree = "<group>"; };
E1E90C391735D846005C6D5B /* DDLogLevel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDLogLevel.m; sourceTree = "<group>"; };
E1E90C3A1735D846005C6D5B /* FindSourceFilesOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindSourceFilesOperation.h; sourceTree = "<group>"; };
E1E90C3B1735D846005C6D5B /* Notifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Notifications.h; sourceTree = "<group>"; };
E1E90C3C1735D846005C6D5B /* Notifications.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Notifications.m; sourceTree = "<group>"; };
E1E90C3D1735D846005C6D5B /* ProcessSourceOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessSourceOperation.h; sourceTree = "<group>"; };
E1E90C3E1735D846005C6D5B /* UserDefaults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserDefaults.h; sourceTree = "<group>"; };
E1E90C3F1735D846005C6D5B /* UserDefaults.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserDefaults.m; sourceTree = "<group>"; };
E1E90C401735D846005C6D5B /* XcodeCapp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XcodeCapp.h; sourceTree = "<group>"; };
E1E90C451735D8A1005C6D5B /* DDASLLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDASLLogger.h; sourceTree = "<group>"; };
E1E90C461735D8A1005C6D5B /* DDASLLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDASLLogger.m; sourceTree = "<group>"; };
E1E90C471735D8A1005C6D5B /* DDLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDLog.h; sourceTree = "<group>"; };
E1E90C481735D8A1005C6D5B /* DDLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDLog.m; sourceTree = "<group>"; };
E1E90C491735D8A1005C6D5B /* DDTTYLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDTTYLogger.h; sourceTree = "<group>"; };
E1E90C4A1735D8A1005C6D5B /* DDTTYLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDTTYLogger.m; sourceTree = "<group>"; };
E1E90C61173B42D0005C6D5B /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
E1E90C66173B44CC005C6D5B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
E1E90C68173B48DA005C6D5B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E1ED6B6F173414E100641628 /* icon_128x128.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = icon_128x128.png; path = Resources/icon_128x128.png; sourceTree = "<group>"; };
E1ED6B70173414E100641628 /* icon_128x128@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon_128x128@2x.png"; path = "Resources/icon_128x128@2x.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
027D99A013696A7000D3DB13 /* Frameworks */ = {
E164FDCC1720E77100263CE3 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
027D99A113696A7000D3DB13 /* Cocoa.framework in Frameworks */,
027D99A213696A7000D3DB13 /* CoreServices.framework in Frameworks */,
02998CF71369C339006C73DB /* Growl.framework in Frameworks */,
E164FDD31720E77100263CE3 /* Cocoa.framework in Frameworks */,
E164FE1F1720F51E00263CE3 /* CoreServices.framework in Frameworks */,
E17B55411732F57700809FFB /* Quartz.framework in Frameworks */,
E164FDF71720EBD600263CE3 /* Growl.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
E171D25A173C168C00210893 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E171D26A173C1ADD00210893 /* CoreServices.framework in Frameworks */,
E171D25F173C168C00210893 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
E164FDC61720E77100263CE3 = {
isa = PBXGroup;
children = (
651DAE1C13B0CAB900ECA3F0 /* PRHEmptyGrowlDelegate.h */,
651DAE1D13B0CAB900ECA3F0 /* PRHEmptyGrowlDelegate.m */,
02B1C8D616B25C74003C6E82 /* TNErrorDataView.h */,
02B1C8D716B25C74003C6E82 /* TNErrorDataView.m */,
8E01A91D0DE9EED20008BB35 /* AppController.h */,
8E01A91E0DE9EED20008BB35 /* AppController.m */,
027FE49B1462D74C00B1AB92 /* TNXCodeCapp.h */,
027FE49C1462D74C00B1AB92 /* TNXCodeCapp.m */,
027FE4BB1462F7D600B1AB92 /* FSEventCallback.h */,
027FE4BC1462F7EB00B1AB92 /* FSEventCallback.m */,
E164FDD81720E77100263CE3 /* XcodeCapp */,
E171D260173C168C00210893 /* xcc */,
E164FDD11720E77100263CE3 /* Frameworks */,
E164FDD01720E77100263CE3 /* Products */,
);
name = Classes;
sourceTree = "<group>";
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
E164FDD01720E77100263CE3 /* Products */ = {
isa = PBXGroup;
children = (
8E01A8DD0DE51A7C0008BB35 /* CoreServices.framework */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
027D99A613696A7000D3DB13 /* XcodeCapp.app */,
E164FDCF1720E77100263CE3 /* XcodeCapp.app */,
E171D25D173C168C00210893 /* xcc */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* xcodecapp-cocoa */ = {
E164FDD11720E77100263CE3 /* Frameworks */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
E164FDD21720E77100263CE3 /* Cocoa.framework */,
E164FE1D1720F50100263CE3 /* CoreServices.framework */,
E164FDF61720EBD600263CE3 /* Growl.framework */,
E171D25E173C168C00210893 /* Foundation.framework */,
E164FDD41720E77100263CE3 /* Other Frameworks */,
);
name = "xcodecapp-cocoa";
name = Frameworks;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
E164FDD41720E77100263CE3 /* Other Frameworks */ = {
isa = PBXGroup;
children = (
027D9989136969DD00D3DB13 /* XcodeCapp.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
E12AA95F14637828006F55D6 /* macros.h */,
E164FDD51720E77100263CE3 /* AppKit.framework */,
E164FDD61720E77100263CE3 /* CoreData.framework */,
E164FDD71720E77100263CE3 /* Foundation.framework */,
E17B55401732F57700809FFB /* Quartz.framework */,
);
name = "Other Sources";
name = "Other Frameworks";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
E164FDD81720E77100263CE3 /* XcodeCapp */ = {
isa = PBXGroup;
children = (
0294F09215D345A500840547 /* mod_pbxproj.py */,
0218442415D32B5D00A782B8 /* pbxprojModifier.py */,
4E2D0D00154840B400475C01 /* help.rtfd */,
022BCEA61468632000B72910 /* project.pbxproj.sample */,
027FE4B91462F64E00B1AB92 /* xcodecapp-icon-working.png */,
026F3B6413866E7D00EE5B83 /* xcodecapp-icon-active.png */,
026F3B6113866B0B00EE5B83 /* xcodecapp-icon-inactive.png */,
024A041113699D6800DCBE4D /* parser.j */,
8D1107310486CEB800E47090 /* Info.plist */,
0289AC9314668CAF003CD975 /* XcodeCapp.icns */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
02998CEA1369BF7D006C73DB /* Growl Registration Ticket.growlRegDict */,
E1E90C60173B42D0005C6D5B /* MainMenu.xib */,
E164FDF41720EBC100263CE3 /* AppController.m */,
E1E90C371735D82B005C6D5B /* AppController.h */,
E164FDFB1720EC5B00263CE3 /* XcodeCapp.m */,
E1E90C401735D846005C6D5B /* XcodeCapp.h */,
E14015411740248C006C2792 /* XcodeProjectCloser.m */,
E14015401740248C006C2792 /* XcodeProjectCloser.h */,
E1E90C3C1735D846005C6D5B /* Notifications.m */,
E1E90C3B1735D846005C6D5B /* Notifications.h */,
E1E90C3F1735D846005C6D5B /* UserDefaults.m */,
E1E90C3E1735D846005C6D5B /* UserDefaults.h */,
E1E90C391735D846005C6D5B /* DDLogLevel.m */,
E1E90C381735D846005C6D5B /* DDLogLevel.h */,
E1A55947172C5EA80088FB61 /* Operations */,
E1E90C441735D8A1005C6D5B /* Lumberjack */,
E164FE121720F3E100263CE3 /* Scripts */,
E164FE071720F25400263CE3 /* Resources */,
E164FDD91720E77100263CE3 /* Supporting Files */,
);
path = XcodeCapp;
sourceTree = "<group>";
};
E164FDD91720E77100263CE3 /* Supporting Files */ = {
isa = PBXGroup;
children = (
E1E90C68173B48DA005C6D5B /* Info.plist */,
E1E90C65173B44CC005C6D5B /* InfoPlist.strings */,
E164FDDE1720E77100263CE3 /* main.m */,
E164FDE01720E77100263CE3 /* XcodeCapp-Prefix.pch */,
E164FDEF1720E7FA00263CE3 /* Debug.xcconfig */,
E164FDF01720E7FA00263CE3 /* Release.xcconfig */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
E164FE071720F25400263CE3 /* Resources */ = {
isa = PBXGroup;
children = (
E1ED6B6F173414E100641628 /* icon_128x128.png */,
E1ED6B70173414E100641628 /* icon_128x128@2x.png */,
E164FE2D1721A34900263CE3 /* icon-inactive.png */,
E170C40117298833003DC489 /* icon-inactive@2x.png */,
E164FE2E1721A34900263CE3 /* icon-working.png */,
E170C40217298833003DC489 /* icon-working@2x.png */,
E164FE2C1721A34900263CE3 /* icon-active.png */,
E170C3FE17298833003DC489 /* icon-active@2x.png */,
E170C3FF17298833003DC489 /* icon-error.png */,
E170C40017298833003DC489 /* icon-error@2x.png */,
E17A822C172700B90095CD83 /* XcodeCapp.iconset */,
E17B55421732F72700809FFB /* help.pdf */,
E164FE2A172188F300263CE3 /* project.pbxproj */,
E164FE191720F49A00263CE3 /* Growl Registration Ticket.growlRegDict */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
E164FE121720F3E100263CE3 /* Scripts */ = {
isa = PBXGroup;
children = (
02998CF61369C339006C73DB /* Growl.framework */,
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
E164FE171720F44B00263CE3 /* parser.j */,
E164FE141720F40400263CE3 /* pbxprojModifier.py */,
E164FE131720F40400263CE3 /* mod_pbxproj.py */,
);
name = Frameworks;
path = Scripts;
sourceTree = "<group>";
};
E171D260173C168C00210893 /* xcc */ = {
isa = PBXGroup;
children = (
E171D261173C168C00210893 /* main.m */,
E171D263173C168C00210893 /* Supporting Files */,
);
path = xcc;
sourceTree = "<group>";
};
E171D263173C168C00210893 /* Supporting Files */ = {
isa = PBXGroup;
children = (
E171D264173C168C00210893 /* xcc-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
E1A55947172C5EA80088FB61 /* Operations */ = {
isa = PBXGroup;
children = (
E1A55949172C5EE20088FB61 /* FindSourceFilesOperation.m */,
E1E90C3A1735D846005C6D5B /* FindSourceFilesOperation.h */,
E1A5594C172CA8D40088FB61 /* ProcessSourceOperation.m */,
E1E90C3D1735D846005C6D5B /* ProcessSourceOperation.h */,
);
name = Operations;
sourceTree = "<group>";
};
E1E90C441735D8A1005C6D5B /* Lumberjack */ = {
isa = PBXGroup;
children = (
E1E90C451735D8A1005C6D5B /* DDASLLogger.h */,
E1E90C461735D8A1005C6D5B /* DDASLLogger.m */,
E1E90C471735D8A1005C6D5B /* DDLog.h */,
E1E90C481735D8A1005C6D5B /* DDLog.m */,
E1E90C491735D8A1005C6D5B /* DDTTYLogger.h */,
E1E90C4A1735D8A1005C6D5B /* DDTTYLogger.m */,
);
path = Lumberjack;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
027D999913696A7000D3DB13 /* XcodeCapp */ = {
E164FDCE1720E77100263CE3 /* XcodeCapp */ = {
isa = PBXNativeTarget;
buildConfigurationList = 027D99A313696A7000D3DB13 /* Build configuration list for PBXNativeTarget "XcodeCapp" */;
buildConfigurationList = E164FDEC1720E77100263CE3 /* Build configuration list for PBXNativeTarget "XcodeCapp" */;
buildPhases = (
024699001602C04A00F0AE43 /* ShellScript */,
027D999A13696A7000D3DB13 /* Resources */,
027D999D13696A7000D3DB13 /* Sources */,
02998CF81369C383006C73DB /* CopyFiles */,
027D99A013696A7000D3DB13 /* Frameworks */,
E164FDCB1720E77100263CE3 /* Sources */,
E164FDCC1720E77100263CE3 /* Frameworks */,
E164FDCD1720E77100263CE3 /* Resources */,
E164FE201720F54800263CE3 /* CopyFiles */,
E170C3F9172961E6003DC489 /* CopyFiles */,
E171D26B173C1C6900210893 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
E171D26E173C405C00210893 /* PBXTargetDependency */,
);
name = XcodeCapp;
productName = XcodeCapp;
productReference = E164FDCF1720E77100263CE3 /* XcodeCapp.app */;
productType = "com.apple.product-type.application";
};
E171D25C173C168C00210893 /* xcc */ = {
isa = PBXNativeTarget;
buildConfigurationList = E171D269173C168C00210893 /* Build configuration list for PBXNativeTarget "xcc" */;
buildPhases = (
E171D259173C168C00210893 /* Sources */,
E171D25A173C168C00210893 /* Frameworks */,
E171D25B173C168C00210893 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = XcodeCapp;
productInstallPath = "$(HOME)/Applications";
productName = "xcodecapp-cocoa";
productReference = 027D99A613696A7000D3DB13 /* XcodeCapp.app */;
productType = "com.apple.product-type.application";
name = xcc;
productName = xcc;
productReference = E171D25D173C168C00210893 /* xcc */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
E164FDC71720E77100263CE3 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0440;
LastUpgradeCheck = 0460;
ORGANIZATIONNAME = "Cappuccino Project";
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "XcodeCapp" */;
buildConfigurationList = E164FDCA1720E77100263CE3 /* Build configuration list for PBXProject "XcodeCapp" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* xcodecapp-cocoa */;
mainGroup = E164FDC61720E77100263CE3;
productRefGroup = E164FDD01720E77100263CE3 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
027D999913696A7000D3DB13 /* XcodeCapp */,
E164FDCE1720E77100263CE3 /* XcodeCapp */,
E171D25C173C168C00210893 /* xcc */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
027D999A13696A7000D3DB13 /* Resources */ = {
E164FDCD1720E77100263CE3 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
027D999B13696A7000D3DB13 /* MainMenu.nib in Resources */,
027D999C13696A7000D3DB13 /* InfoPlist.strings in Resources */,
024A041413699DD400DCBE4D /* parser.j in Resources */,
02998CEB1369BF7D006C73DB /* Growl Registration Ticket.growlRegDict in Resources */,
026F3B6213866B0B00EE5B83 /* xcodecapp-icon-inactive.png in Resources */,
026F3B6513866E7D00EE5B83 /* xcodecapp-icon-active.png in Resources */,
027FE4BA1462F64E00B1AB92 /* xcodecapp-icon-working.png in Resources */,
0289AC9414668CAF003CD975 /* XcodeCapp.icns in Resources */,
022BCEA71468632000B72910 /* project.pbxproj.sample in Resources */,
4E2D0D01154840B400475C01 /* help.rtfd in Resources */,
0218442515D32B5D00A782B8 /* pbxprojModifier.py in Resources */,
0294F09315D345A500840547 /* mod_pbxproj.py in Resources */,
E10E4CD717298E5F004AB09E /* project.pbxproj in Resources */,
E164FE181720F44B00263CE3 /* parser.j in Resources */,
E164FE1A1720F49A00263CE3 /* Growl Registration Ticket.growlRegDict in Resources */,
E164FE2F1721A34900263CE3 /* icon-active.png in Resources */,
E164FE301721A34900263CE3 /* icon-inactive.png in Resources */,
E164FE311721A34900263CE3 /* icon-working.png in Resources */,
E17A822D172700B90095CD83 /* XcodeCapp.iconset in Resources */,
E170C40317298833003DC489 /* icon-active@2x.png in Resources */,
E170C40417298833003DC489 /* icon-error.png in Resources */,
E170C40517298833003DC489 /* icon-error@2x.png in Resources */,
E170C40617298833003DC489 /* icon-inactive@2x.png in Resources */,
E170C40717298833003DC489 /* icon-working@2x.png in Resources */,
E17B55431732F72700809FFB /* help.pdf in Resources */,
E1ED6B71173414E100641628 /* icon_128x128.png in Resources */,
E1ED6B72173414E100641628 /* icon_128x128@2x.png in Resources */,
E1E90C62173B42D0005C6D5B /* MainMenu.xib in Resources */,
E1E90C67173B44CC005C6D5B /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
024699001602C04A00F0AE43 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(SRCROOT)/*.m",
"$(SRCROOT)/*.h",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /usr/bin/perl;
shellScript = "#!/usr/bin/perl\n\nwhile (<>) {\n s/\\s+$//;\n print \"$_\\n\";\n}";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
027D999D13696A7000D3DB13 /* Sources */ = {
E164FDCB1720E77100263CE3 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
027D999E13696A7000D3DB13 /* main.m in Sources */,
027D999F13696A7000D3DB13 /* AppController.m in Sources */,
651DAE1F13B0CAB900ECA3F0 /* PRHEmptyGrowlDelegate.m in Sources */,
027FE49D1462D74C00B1AB92 /* TNXCodeCapp.m in Sources */,
027FE4BD1462F7EB00B1AB92 /* FSEventCallback.m in Sources */,
02B1C8D816B25C74003C6E82 /* TNErrorDataView.m in Sources */,
E164FDDF1720E77100263CE3 /* main.m in Sources */,
E164FDF51720EBC100263CE3 /* AppController.m in Sources */,
E164FDFF1720EC5B00263CE3 /* XcodeCapp.m in Sources */,
E1A5594A172C5EE20088FB61 /* FindSourceFilesOperation.m in Sources */,
E1A5594D172CA8D40088FB61 /* ProcessSourceOperation.m in Sources */,
E1E90C411735D846005C6D5B /* DDLogLevel.m in Sources */,
E1E90C421735D846005C6D5B /* Notifications.m in Sources */,
E1E90C431735D846005C6D5B /* UserDefaults.m in Sources */,
E1E90C4B1735D8A1005C6D5B /* DDASLLogger.m in Sources */,
E1E90C4C1735D8A1005C6D5B /* DDLog.m in Sources */,
E1E90C4D1735D8A1005C6D5B /* DDTTYLogger.m in Sources */,
E14015421740248C006C2792 /* XcodeProjectCloser.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
E171D259173C168C00210893 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E171D262173C168C00210893 /* main.m in Sources */,
E1401543174025B8006C2792 /* XcodeProjectCloser.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
E171D26E173C405C00210893 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = E171D25C173C168C00210893 /* xcc */;
targetProxy = E171D26D173C405C00210893 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
E1E90C60173B42D0005C6D5B /* MainMenu.xib */ = {
isa = PBXVariantGroup;
children = (
089C165DFE840E0CC02AAC07 /* English */,
E1E90C61173B42D0005C6D5B /* en */,
);
name = InfoPlist.strings;
name = MainMenu.xib;
sourceTree = "<group>";
};
29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
E1E90C65173B44CC005C6D5B /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
29B97319FDCFA39411CA2CEA /* English */,
E1E90C66173B44CC005C6D5B /* en */,
);
name = MainMenu.nib;
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
027D99A413696A7000D3DB13 /* Debug */ = {
E164FDEA1720E77100263CE3 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E164FDEF1720E7FA00263CE3 /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)\"",
);
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_GC = unsupported;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = XcodeCapp.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = /Applications;
MACOSX_DEPLOYMENT_TARGET = 10.6.8;
PRODUCT_NAME = XcodeCapp;
DSTROOT = /;
};
name = Debug;
};
027D99A513696A7000D3DB13 /* Release */ = {
E164FDEB1720E77100263CE3 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E164FDF01720E7FA00263CE3 /* Release.xcconfig */;
buildSettings = {
COPY_PHASE_STRIP = NO;
DEPLOYMENT_LOCATION = YES;
DSTROOT = /;
};
name = Release;
};
E164FDED1720E77100263CE3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/XcodeCapp\"",
);
MACOSX_DEPLOYMENT_TARGET = 10.6.8;
};
name = Debug;
};
E164FDEE1720E77100263CE3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/XcodeCapp\"",
);
MACOSX_DEPLOYMENT_TARGET = 10.6.8;
};
name = Release;
};
E171D267173C168C00210893 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)\"",
);
GCC_ENABLE_OBJC_GC = unsupported;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = XcodeCapp.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = /Applications;
MACOSX_DEPLOYMENT_TARGET = 10.6.8;
PRODUCT_NAME = XcodeCapp;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_OBJC_GC = required;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "xcc/xcc-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.5;
MACOSX_DEPLOYMENT_TARGET = 10.8;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
E171D268173C168C00210893 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_OBJC_GC = required;
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "";
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEPLOYMENT_LOCATION = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "xcc/xcc-Prefix.pch";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.5;
ONLY_ACTIVE_ARCH = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
name = Release;
@@ -401,25 +605,34 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
027D99A313696A7000D3DB13 /* Build configuration list for PBXNativeTarget "XcodeCapp" */ = {
E164FDCA1720E77100263CE3 /* Build configuration list for PBXProject "XcodeCapp" */ = {
isa = XCConfigurationList;
buildConfigurations = (
027D99A413696A7000D3DB13 /* Debug */,
027D99A513696A7000D3DB13 /* Release */,
E164FDEA1720E77100263CE3 /* Debug */,
E164FDEB1720E77100263CE3 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "XcodeCapp" */ = {
E164FDEC1720E77100263CE3 /* Build configuration list for PBXNativeTarget "XcodeCapp" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
E164FDED1720E77100263CE3 /* Debug */,
E164FDEE1720E77100263CE3 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
E171D269173C168C00210893 /* Build configuration list for PBXNativeTarget "xcc" */ = {
isa = XCConfigurationList;
buildConfigurations = (
E171D267173C168C00210893 /* Debug */,
E171D268173C168C00210893 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
rootObject = E164FDC71720E77100263CE3 /* Project object */;
}
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
<true/>
<key>IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges</key>
<true/>
</dict>
</plist>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "1.0">
</Bucket>
@@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>XcodeCapp Debug.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>XcodeCapp Release.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>XcodeCapp.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>027D998A13696A0700D3DB13</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>027D999913696A7000D3DB13</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>8D1107260486CEB800E47090</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
+48
View File
@@ -0,0 +1,48 @@
/*
* This file is a part of program XcodeCapp
* Copyright (C) 2011 Antoine Mercadal (<primalmotion@archipelproject.org>)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Cocoa/Cocoa.h>
#import <CoreServices/CoreServices.h>
#import <Quartz/Quartz.h>
@class XcodeCapp;
@interface AppController : NSObject <NSApplicationDelegate, NSMenuDelegate>
@property (strong) IBOutlet NSMenu *statusMenu;
@property (unsafe_unretained) IBOutlet NSMenuItem *menuItemHistory;
@property (unsafe_unretained) IBOutlet NSMenuItem *menuItemOpenProject;
@property (unsafe_unretained) IBOutlet NSMenuItem *menuItemShowInFinder;
@property (strong) IBOutlet NSPanel *aboutWindow;
@property (strong) IBOutlet NSWindow *preferencesWindow;
@property (strong) IBOutlet NSWindow *helpWindow;
@property (unsafe_unretained) IBOutlet PDFView *helpView;
@property (strong) IBOutlet NSUserDefaultsController *preferencesController;
@property (strong) IBOutlet XcodeCapp *xcc;
+ (AppController *)sharedAppController;
- (IBAction)loadProject:(id)aSender;
- (IBAction)openHelp:(id)aSender;
- (IBAction)openAbout:(id)aSender;
@end
+508
View File
@@ -0,0 +1,508 @@
/*
* This file is a part of program XcodeCapp
* Copyright (C) 2011 Antoine Mercadal (<primalmotion@archipelproject.org>)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#import <AppKit/NSApplication.h>
#import "AppController.h"
#import "Notifications.h"
#import "XcodeCapp.h"
#import "UserDefaults.h"
AppController *SharedAppControllerInstance = nil;
@interface AppController ()
@property (nonatomic) NSImage *iconActive;
@property (nonatomic) NSImage *iconInactive;
@property (nonatomic) NSImage *iconWorking;
@property (nonatomic) NSImage *iconError;
@property (nonatomic) NSMenu *recentMenu;
@property NSStatusItem *statusItem;
@property NSString *finderName;
@property BOOL appFinishedLaunching;
@property NSString *pathToOpenAtLaunch;
@property NSFileManager *fm;
@end
@implementation AppController
+ (AppController *)sharedAppController
{
return SharedAppControllerInstance;
}
#pragma mark - Initialization
- (void)awakeFromNib
{
SharedAppControllerInstance = self;
self.fm = [NSFileManager defaultManager];
[self registerDefaultPreferences];
[self initLogging];
DDLogVerbose(@"\n******************************\n** XcodeCapp started **\n******************************\n");
self.aboutWindow.backgroundColor = [NSColor whiteColor];
[self initStatusItem];
[self initObservers];
[self initShowInFinderItem];
[self pruneProjectHistory];
[self updateHistoryMenu];
[self checkFirstLaunch];
}
- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename
{
if (filename)
{
NSString *path = filename.stringByStandardizingPath;
if (self.appFinishedLaunching)
return [self loadProjectAtPath:path reopening:YES];
else
self.pathToOpenAtLaunch = path;
}
return YES;
}
- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
self.appFinishedLaunching = YES;
if (![self.xcc executablesAreAccessible])
{
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
NSRunAlertPanel(
@"Executables are missing.",
@"Please make sure that each one of these executables:\n\n"
@"%@\n\n"
@"(or a symlink to it) is within one these directories:\n\n"
@"%@\n\n"
@"They do not all have to be in the same directory.",
@"Quit",
nil,
nil,
[self.xcc.executables componentsJoinedByString:@"\n"],
[self.xcc.environmentPaths componentsJoinedByString:@"\n"]);
[[NSApplication sharedApplication] terminate:self];
return;
}
// If we were opened from the command line, self.pathToOpenAtLaunch will be set.
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (!self.pathToOpenAtLaunch)
{
if (![defaults boolForKey:kDefaultXCCReopenLastProject])
return;
self.pathToOpenAtLaunch = [defaults objectForKey:kDefaultLastOpenedPath];
}
if (self.pathToOpenAtLaunch)
{
if ([[NSFileManager defaultManager] fileExistsAtPath:self.pathToOpenAtLaunch])
[self loadProjectAtPath:self.pathToOpenAtLaunch reopening:YES];
else
[defaults removeObjectForKey:kDefaultLastOpenedPath];
}
}
/*!
Register default values for preferences
*/
- (void)registerDefaultPreferences
{
NSDictionary *appDefaults = @{
kDefaultLastEventId: [NSNumber numberWithUnsignedLongLong:kFSEventStreamEventIdSinceNow],
kDefaultFirstLaunch: @YES,
kDefaultFirstLaunchVersion: @2.0,
kDefaultXCCAPIMode: [NSNumber numberWithInt:kXCCAPIModeAuto],
kDefaultXCCReactToInodeMod: @YES,
kDefaultXCCReopenLastProject: @YES,
kDefaultXCCAutoOpenErrorsPanelOnWarnings: @YES,
kDefaultXCCAutoOpenErrorsPanelOnErrors: @YES,
kDefaultXCCProjectHistory: [NSArray new],
kDefaultMaxRecentProjects: @20,
kDefaultLogLevel: [NSNumber numberWithInt:LOG_LEVEL_WARN],
kDefaultAutoOpenXcodeProject: @YES,
kDefaultShowProcessingNotices: @YES
};
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults registerDefaults:appDefaults];
[defaults synchronize];
[defaults addObserver:self
forKeyPath:kDefaultMaxRecentProjects
options:NSKeyValueObservingOptionNew
context:NULL];
}
- (void)initLogging
{
#if DEBUG
[DDLog addLogger:[DDTTYLogger sharedInstance]];
[[DDTTYLogger sharedInstance] setColorsEnabled:YES];
[DDLogLevel setLogLevel:LOG_LEVEL_VERBOSE];
#else
[DDLog addLogger:[DDASLLogger sharedInstance]];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
int logLevel = (int)[defaults integerForKey:kDefaultLogLevel];
NSUInteger modifiers = [NSEvent modifierFlags];
if (modifiers & NSAlternateKeyMask)
logLevel = LOG_LEVEL_VERBOSE;
[DDLogLevel setLogLevel:logLevel];
#endif
}
- (void)initStatusItem
{
self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
self.statusItem.menu = self.statusMenu;
self.statusItem.image = self.iconInactive;
self.statusItem.highlightMode = YES;
self.statusItem.length = self.iconInactive.size.width + 12; // Add some space around the icon
self.statusMenu.delegate = self;
}
- (void)initObservers
{
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
[defaultCenter addObserver:self selector:@selector(batchDidStart:) name:XCCBatchDidStartNotification object:nil];
[defaultCenter addObserver:self selector:@selector(batchDidEnd:) name:XCCBatchDidEndNotification object:nil];
[defaultCenter addObserver:self selector:@selector(projectDidFinishLoading:) name:XCCProjectDidFinishLoadingNotification object:nil];
}
- (void)initShowInFinderItem
{
// See if PathFinder is available
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
NSString *path = [workspace absolutePathForAppBundleWithIdentifier:@"com.cocoatech.PathFinder"];
if (path)
self.finderName = path.lastPathComponent.stringByDeletingPathExtension;
else
self.finderName = @"Finder";
self.menuItemShowInFinder.title = [NSString stringWithFormat:self.menuItemShowInFinder.title, self.finderName];
}
- (void)pruneProjectHistory
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSMutableArray *projectHistory = [[defaults arrayForKey:kDefaultXCCProjectHistory] mutableCopy];
NSFileManager *fm = [NSFileManager new];
for (NSInteger i = projectHistory.count - 1; i >= 0; --i)
{
if (![fm fileExistsAtPath:projectHistory[i]])
[projectHistory removeObjectAtIndex:i];
}
NSInteger maxProjects = [defaults integerForKey:kDefaultMaxRecentProjects];
if (projectHistory.count > maxProjects)
[projectHistory removeObjectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(maxProjects, projectHistory.count - maxProjects)]];
[defaults setObject:projectHistory forKey:kDefaultXCCProjectHistory];
}
- (void)checkFirstLaunch
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
double firstLaunchVersion = [defaults doubleForKey:kDefaultFirstLaunchVersion];
// Note: the scanner will only get the major.minor version numbers, which is what we want.
NSScanner *scanner = [NSScanner scannerWithString:[self bundleVersion]];
double appVersion = 0.0;
[scanner scanDouble:&appVersion];
if ([defaults boolForKey:kDefaultFirstLaunch] || appVersion > firstLaunchVersion)
{
[defaults setBool:NO forKey:kDefaultFirstLaunch];
[defaults setDouble:appVersion forKey:kDefaultFirstLaunchVersion];
[self openHelp:self];
}
}
#pragma mark - Properties
- (NSImage *)iconActive
{
if (!_iconActive)
_iconActive = [NSImage imageNamed:@"icon-active"];
return _iconActive;
}
- (NSImage *)iconInactive
{
if (!_iconInactive)
_iconInactive = [NSImage imageNamed:@"icon-inactive"];
return _iconInactive;
}
- (NSImage *)iconWorking
{
if (!_iconWorking)
_iconWorking = [NSImage imageNamed:@"icon-working"];
return _iconWorking;
}
- (NSImage *)iconError
{
if (!_iconError)
_iconError = [NSImage imageNamed:@"icon-error"];
return _iconError;
}
- (NSMenu *)recentMenu
{
if (!_recentMenu)
{
_recentMenu = [NSMenu new];
_recentMenu.delegate = self;
self.menuItemHistory.submenu = _recentMenu;
}
return _recentMenu;
}
#pragma mark - Notification handlers
- (void)batchDidStart:(NSNotification *)note
{
DDLogVerbose(@"Batch start");
self.statusItem.image = self.iconWorking;
}
- (void)batchDidEnd:(NSNotification *)note
{
DDLogVerbose(@"Batch end");
if (!self.xcc.isLoadingProject)
self.statusItem.image = self.xcc.hasErrors ? self.iconError : self.iconActive;
}
- (void)projectDidFinishLoading:(NSNotification *)note
{
self.statusItem.image = self.xcc.hasErrors ? self.iconError : self.iconActive;
self.menuItemOpenProject.title = [NSString stringWithFormat:@"Close “%@”", self.xcc.projectPath.lastPathComponent];
self.menuItemOpenProject.action = @selector(closeProject:);
}
// Watch changes to the max recent projects preference
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
if ([keyPath isEqualToString:kDefaultMaxRecentProjects])
[self pruneProjectHistory];
}
#pragma mark - Actions
- (IBAction)loadProject:(id)aSender
{
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
openPanel.title = @"Choose Cappuccino Project";
openPanel.canChooseDirectories = YES;
openPanel.canCreateDirectories = YES;
openPanel.canChooseFiles = NO;
if ([openPanel runModal] != NSFileHandlingPanelOKButton)
return;
NSString *projectPath = [[openPanel.URLs[0] path] stringByStandardizingPath];
[self loadProjectAtPath:projectPath reopening:YES];
}
- (void)closeProject:(id)aSender
{
[self.xcc stop];
self.statusItem.image = self.iconInactive;
self.menuItemOpenProject.title = @"Open Project…";
self.menuItemOpenProject.action = @selector(loadProject:);
[[NSUserDefaults standardUserDefaults] removeObjectForKey:kDefaultLastOpenedPath];
}
- (void)switchToProject:(NSMenuItem *)aSender
{
[self loadProjectAtPath:aSender.representedObject reopening:NO];
}
- (void)clearProjectHistory:(id)aSender
{
[[NSUserDefaults standardUserDefaults] setObject:[NSArray array] forKey:kDefaultXCCProjectHistory];
[self updateHistoryMenu];
}
- (IBAction)showInFinder:(id)aSender
{
[[NSWorkspace sharedWorkspace] openFile:self.xcc.projectPath withApplication:self.finderName];
}
- (IBAction)openHelp:(id)aSender
{
if (!self.helpView.document)
{
NSURL *helpURL = [[NSBundle mainBundle] URLForResource:@"help" withExtension:@"pdf"];
PDFDocument *help = [[PDFDocument alloc] initWithURL:helpURL];
self.helpView.document = help;
}
[self openWindow:self.helpWindow];
}
- (IBAction)openAbout:(id)aSender
{
[self openWindow:self.aboutWindow];
}
- (IBAction)openPreferences:(id)aSender
{
[self openWindow:self.preferencesWindow];
}
#pragma mark - Delegates
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)app
{
[self.xcc stop];
return NSTerminateNow;
}
- (BOOL)validateMenuItem:(NSMenuItem *)aMenuItem
{
NSMenu *menu = aMenuItem.menu;
if (menu == self.recentMenu)
{
// Disable recent items if they don't exist or are not directories,
// but enable the Clear History item, which is last in the menu.
if ([menu indexOfItem:aMenuItem] == menu.itemArray.count - 1)
return YES;
BOOL isDirectory;
BOOL exists = [self.fm fileExistsAtPath:aMenuItem.representedObject isDirectory:&isDirectory];
return exists && isDirectory;
}
return YES;
}
#pragma mark - Bindings
- (NSString *)bundleVersion
{
return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
}
#pragma mark - Private Helpers
- (BOOL)loadProjectAtPath:(NSString *)path reopening:(BOOL)reopen
{
if (!reopen && [self.xcc.projectPath isEqualToString:path])
return YES;
[self closeProject:self];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSMutableArray *projectHistory = [[defaults arrayForKey:kDefaultXCCProjectHistory] mutableCopy];
if ([projectHistory containsObject:path])
[projectHistory removeObject:path];
// The path may no longer be there, validate it
NSFileManager *fm = [NSFileManager defaultManager];
BOOL exists, isDirectory;
exists = [fm fileExistsAtPath:path isDirectory:&isDirectory];
if (exists && isDirectory)
{
[projectHistory insertObject:path atIndex:0];
}
else
{
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
NSRunAlertPanel(@"Project not found.", @"%@ %@", nil, nil, nil, path, !exists ? @"no longer exists." : @"is not a directory.");
}
[defaults setObject:projectHistory forKey:kDefaultXCCProjectHistory];
[self pruneProjectHistory];
[self updateHistoryMenu];
if (exists && isDirectory)
{
[self.xcc loadProjectAtPath:path];
return YES;
}
else
return NO;
}
- (void)openWindow:(NSWindow *)aWindow
{
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
[aWindow makeKeyAndOrderFront:nil];
}
- (void)updateHistoryMenu
{
[self.recentMenu removeAllItems];
NSArray *projectHistory = [[NSUserDefaults standardUserDefaults] arrayForKey:kDefaultXCCProjectHistory];
for (NSString *path in projectHistory)
{
NSMenuItem *item = [self.recentMenu addItemWithTitle:path.lastPathComponent action:@selector(switchToProject:) keyEquivalent:@""];
[item setEnabled:YES];
item.representedObject = path;
}
[self.recentMenu addItem:[NSMenuItem separatorItem]];
[self.recentMenu addItemWithTitle:@"Clear history" action:@selector(clearProjectHistory:) keyEquivalent:@""];
self.menuItemHistory.enabled = [projectHistory count] > 0;
}
@end
+17
View File
@@ -0,0 +1,17 @@
//
// DDLogLevel.h
// XcodeCapp
//
// Created by Aparajita on 4/29/13.
// Copyright (c) 2013 Cappuccino Project. All rights reserved.
//
#import <Foundation/Foundation.h>
extern int ddLogLevel;
@interface DDLogLevel : NSObject
+ (void)setLogLevel:(int)logLevel;
@end
+27
View File
@@ -0,0 +1,27 @@
//
// DDLog.m
// XcodeCapp
//
// Created by Aparajita on 4/29/13.
// Copyright (c) 2013 Cappuccino Project. All rights reserved.
//
#import "DDLogLevel.h"
int ddLogLevel = LOG_LEVEL_OFF;
@implementation DDLogLevel
+ (int)ddLogLevel
{
return ddLogLevel;
}
+ (void)setLogLevel:(int)logLevel
{
ddLogLevel = logLevel;
}
@end
+41
View File
@@ -0,0 +1,41 @@
//
// Debug.xcconfig
// XcodeCapp
//
// Created by Aparajita on 4/18/13.
//
//
//:configuration = Debug
ARCHS = $(ARCHS_STANDARD_64_BIT)
SDKROOT = macosx
ONLY_ACTIVE_ARCH = YES
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
COMBINE_HIDPI_IMAGES = YES
INSTALL_PATH = $(LOCAL_APPS_DIR)
MACOSX_DEPLOYMENT_TARGET = 10.6.8
COPY_PHASE_STRIP = NO
INFOPLIST_FILE = XcodeCapp/Info.plist
PRODUCT_NAME = XcodeCapp
ALWAYS_SEARCH_USER_PATHS = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SRCROOT)/XcodeCapp"
GCC_OPTIMIZATION_LEVEL = 0
CLANG_ENABLE_OBJC_ARC = YES
GCC_PRECOMPILE_PREFIX_HEADER = YES
GCC_PREFIX_HEADER = XcodeCapp/XcodeCapp-Prefix.pch
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_UNUSED_VARIABLE = YES
WRAPPER_EXTENSION = app
GCC_C_LANGUAGE_STANDARD = gnu99
CLANG_CXX_LANGUAGE_STANDARD = gnu++0x
CLANG_CXX_LIBRARY = libc++
CLANG_WARN_EMPTY_BODY = YES
CLANG_WARN_CONSTANT_CONVERSION = YES
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
CLANG_WARN_ENUM_CONVERSION = YES
CLANG_WARN_INT_CONVERSION = YES
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_UNINITIALIZED_AUTOS = YES
GCC_WARN_UNUSED_VARIABLE = YES
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
@@ -0,0 +1,21 @@
//
// FindSourceFilesOperation.h
// XcodeCapp
//
// Created by Aparajita on 4/27/13.
// Copyright (c) 2013 Cappuccino Project. All rights reserved.
//
#import <Foundation/Foundation.h>
@class XcodeCapp;
extern NSString * const XCCNeedSourceToProjectPathMappingNotification;
@interface FindSourceFilesOperation : NSOperation
- (id)initWithXCC:(XcodeCapp *)xcc projectId:(NSNumber *)projectId path:(NSString *)path;
@end
@@ -0,0 +1,172 @@
//
// FindSourceFilesOperation.m
// XcodeCapp
//
// Created by Aparajita on 4/27/13.
// Copyright (c) 2013 Cappuccino Project. All rights reserved.
//
#import "FindSourceFilesOperation.h"
#import "ProcessSourceOperation.h"
#import "XcodeCapp.h"
NSString * const XCCNeedSourceToProjectPathMappingNotification = @"XCCNeedSourceToProjectPathMappingNotification";
@interface FindSourceFilesOperation ()
@property XcodeCapp *xcc;
@property NSNumber *projectId;
@property NSString *projectPathToSearch;
@property NSString *projectPath;
@end
@implementation FindSourceFilesOperation
- (id)initWithXCC:(XcodeCapp *)xcc projectId:(NSNumber *)projectId path:(NSString *)path
{
self = [super init];
if (self)
{
self.xcc = xcc;
self.projectId = projectId;
self.projectPathToSearch = path;
self.projectPath = xcc.projectPath;
}
return self;
}
- (void)main
{
[self findSourceFilesAtProjectPath:self.projectPathToSearch];
}
- (void)findSourceFilesAtProjectPath:(NSString *)aProjectPath
{
if (self.isCancelled)
return;
DDLogVerbose(@"-->findSourceFiles: %@", aProjectPath);
NSError *error = NULL;
NSString *projectPath = [self.projectPath stringByAppendingPathComponent:aProjectPath];
NSFileManager *fm = [NSFileManager defaultManager];
NSArray *urls = [fm contentsOfDirectoryAtURL:[NSURL fileURLWithPath:projectPath.stringByResolvingSymlinksInPath]
includingPropertiesForKeys:@[NSURLIsDirectoryKey, NSURLIsSymbolicLinkKey]
options:NSDirectoryEnumerationSkipsHiddenFiles | NSDirectoryEnumerationSkipsPackageDescendants | NSDirectoryEnumerationSkipsSubdirectoryDescendants
error:&error];
if (!urls)
return;
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
for (NSURL *url in urls)
{
if (self.isCancelled)
return;
NSString *filename = url.lastPathComponent;
NSString *projectRelativePath = [aProjectPath stringByAppendingPathComponent:filename];
NSString *realPath = url.path;
NSURL *resolvedURL = url;
NSNumber *isDirectory, *isSymlink;
[url getResourceValue:&isSymlink forKey:NSURLIsSymbolicLinkKey error:nil];
if (isSymlink.boolValue == YES)
{
resolvedURL = [url URLByResolvingSymlinksInPath];
if ([resolvedURL checkResourceIsReachableAndReturnError:nil])
{
filename = resolvedURL.lastPathComponent;
realPath = resolvedURL.path;
}
else
continue;
}
[resolvedURL getResourceValue:&isDirectory forKey:NSURLIsDirectoryKey error:nil];
if (isDirectory.boolValue == YES)
{
if ([self.xcc shouldIgnoreDirectoryNamed:filename])
{
DDLogVerbose(@"ignored symlinked directory: %@", projectRelativePath);
continue;
}
// If the resolved path is not within the project directory and is not ignored, add a mapping to it
// so we can map the resolved path back to the project directory later.
if (isSymlink.boolValue == YES)
{
NSString *fullProjectPath = [self.projectPath stringByAppendingPathComponent:projectRelativePath];
if (![realPath hasPrefix:fullProjectPath] && ![self.xcc pathMatchesIgnoredPaths:fullProjectPath])
{
DDLogVerbose(@"symlinked directory: %@ -> %@", projectRelativePath, realPath);
NSDictionary *info =
@{
@"projectId":self.projectId,
@"sourcePath":realPath,
@"projectPath":fullProjectPath
};
if (self.isCancelled)
return;
[center postNotificationName:XCCNeedSourceToProjectPathMappingNotification object:self userInfo:info];
}
else
DDLogVerbose(@"ignored symlinked directory: %@", projectRelativePath);
}
[self findSourceFilesAtProjectPath:projectRelativePath];
continue;
}
if (self.isCancelled)
return;
if ([self.xcc pathMatchesIgnoredPaths:realPath])
continue;
NSString *projectSourcePath = [self.projectPath stringByAppendingPathComponent:projectRelativePath];
if ([self.xcc isObjjFile:filename] || [self.xcc isXibFile:filename])
{
NSString *processedPath;
if ([self.xcc isObjjFile:filename])
processedPath = [[self.xcc shadowBasePathForProjectSourcePath:projectSourcePath] stringByAppendingPathExtension:@"h"];
else
processedPath = [projectSourcePath.stringByDeletingPathExtension stringByAppendingPathExtension:@"cib"];
if (![fm fileExistsAtPath:processedPath])
[self createProcessingOperationForProjectSourcePath:projectSourcePath];
}
}
DDLogVerbose(@"<--findSourceFiles: %@", aProjectPath);
}
- (void)createProcessingOperationForProjectSourcePath:(NSString *)projectSourcePath
{
if (self.isCancelled)
return;
ProcessSourceOperation *op = [[ProcessSourceOperation alloc] initWithXCC:self.xcc
projectId:self.projectId
sourcePath:projectSourcePath];
[[NSOperationQueue currentQueue] addOperation:op];
}
@end
Binary file not shown.
@@ -0,0 +1,5 @@
#include <Growl/GrowlDefines.h>
#ifdef __OBJC__
# include <Growl/GrowlApplicationBridge.h>
#endif
@@ -18,14 +18,11 @@
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#import "GrowlDefines.h"
#import <Growl/GrowlDefines.h>
//Forward declarations
@protocol GrowlApplicationBridgeDelegate;
//Internal notification when the user chooses not to install (to avoid continuing to cache notifications awaiting installation)
#define GROWL_USER_CHOSE_NOT_TO_INSTALL_NOTIFICATION @"User chose not to install"
//------------------------------------------------------------------------------
#pragma mark -
@@ -45,9 +42,9 @@
* @method isGrowlInstalled
* @abstract Detects whether Growl is installed.
* @discussion Determines if the Growl prefpane and its helper app are installed.
* @result Returns YES if Growl is installed, NO otherwise.
* @result this method will forever return YES.
*/
+ (BOOL) isGrowlInstalled;
+ (BOOL) isGrowlInstalled __attribute__((deprecated));
/*!
* @method isGrowlRunning
@@ -57,6 +54,34 @@
*/
+ (BOOL) isGrowlRunning;
/*!
* @method isMistEnabled
* @abstract Gives the caller a fairly good indication of whether or not built-in notifications(Mist) will be used.
* @discussion since this call makes use of isGrowlRunning it is entirely possible for this value to change between call and
* executing a notification dispatch
* @result Returns YES if Growl isn't reachable and the developer has not opted-out of
* Mist and the user hasn't set the global mist enable key to false.
*/
+ (BOOL)isMistEnabled;
/*!
* @method setShouldUseBuiltInNotifications
* @abstract opt-out mechanism for the mist notification style in the event growl can't be reached.
* @discussion if growl is unavailable due to not being installed or as a result of being turned off then
* this option can enable/disable a built-in fire and forget display style
* @param should Specifies whether or not the developer wants to opt-in (default) or opt out
* of the built-in Mist style in the event Growl is unreachable.
*/
+ (void)setShouldUseBuiltInNotifications:(BOOL)should;
/*!
* @method shouldUseBuiltInNotifications
* @abstract returns the current opt-in state of the framework's use of the Mist display style.
* @result Returns NO if the developer opt-ed out of Mist, the default value is YES.
*/
+ (BOOL)shouldUseBuiltInNotifications;
#pragma mark -
/*!
@@ -87,7 +112,7 @@
*
* @param inDelegate The delegate for the GrowlApplicationBridge. It must conform to the GrowlApplicationBridgeDelegate protocol.
*/
+ (void) setGrowlDelegate:(NSObject<GrowlApplicationBridgeDelegate> *)inDelegate;
+ (void) setGrowlDelegate:(id<GrowlApplicationBridgeDelegate>)inDelegate;
/*!
* @method growlDelegate
@@ -95,7 +120,7 @@
* @discussion See setGrowlDelegate: for details.
* @result The Growl delegate.
*/
+ (NSObject<GrowlApplicationBridgeDelegate> *) growlDelegate;
+ (id<GrowlApplicationBridgeDelegate>) growlDelegate;
#pragma mark -
@@ -235,6 +260,7 @@
* Growl when next it is ready; <code>NO</code> if not.
*/
+ (void) setWillRegisterWhenGrowlIsReady:(BOOL)flag;
/*! @method willRegisterWhenGrowlIsReady
* @abstract Reports whether GrowlApplicationBridge will register with Growl
* when Growl next launches.
@@ -323,7 +349,7 @@
* Key Value
* --- -----
* <code>GROWL_APP_NAME</code> <code>CFBundleExecutableName</code>
* <code>GROWL_APP_ICON</code> The icon of the application.
* <code>GROWL_APP_ICON_DATA</code> The data of the icon of the application.
* <code>GROWL_APP_LOCATION</code> The location of the application.
* <code>GROWL_NOTIFICATIONS_DEFAULT</code> <code>GROWL_NOTIFICATIONS_ALL</code>
*
@@ -336,6 +362,7 @@
* copy of <code>regDict</code>.
*/
+ (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict;
/*! @method registrationDictionaryByFillingInDictionary:restrictToKeys:
* @abstract Tries to fill in missing keys in a registration dictionary.
* @discussion This method examines the passed-in dictionary for missing keys,
@@ -344,7 +371,7 @@
* Key Value
* --- -----
* <code>GROWL_APP_NAME</code> <code>CFBundleExecutableName</code>
* <code>GROWL_APP_ICON</code> The icon of the application.
* <code>GROWL_APP_ICON_DATA</code> The data of the icon of the application.
* <code>GROWL_APP_LOCATION</code> The location of the application.
* <code>GROWL_NOTIFICATIONS_DEFAULT</code> <code>GROWL_NOTIFICATIONS_ALL</code>
*
@@ -368,13 +395,39 @@
* the keys that it will look for are:
*
* \li <code>GROWL_APP_NAME</code>
* \li <code>GROWL_APP_ICON</code>
* \li <code>GROWL_APP_ICON_DATA</code>
*
* @since Growl.framework 1.1
*/
+ (NSDictionary *) notificationDictionaryByFillingInDictionary:(NSDictionary *)regDict;
+ (NSDictionary *) frameworkInfoDictionary;
#pragma mark -
/*!
*@method growlURLSchemeAvailable
*@abstract Lets the app know whether growl:// is registered on the system, used for certain methods below this
*@return Returns whether growl:// is registered on the system
*@discussion Methods such as openGrowlPreferences rely on the growl:// URL scheme to function
* Further, this method can provide a check on whether Growl is installed,
* however, the framework will not be relying on this method for choosing when/how to notify,
* and it is not recommended that the app rely on it for other than whether to use growl:// methods
*@since Growl.framework 1.4
*/
+ (BOOL) isGrowlURLSchemeAvailable;
/*!
* @method openGrowlPreferences:
* @abstract Open Growl preferences, optionally to this app's settings, growl:// method
* @param showApp Whether to show the application's settings, otherwise just opens to the last position
* @return Return's whether opening the URL was succesfull or not.
* @discussion Will launch if Growl is installed, but not running, and open the preferences window
* Uses growl:// URL scheme
* @since Growl.framework 1.4
*/
+ (BOOL) openGrowlPreferences:(BOOL)showApp;
@end
//------------------------------------------------------------------------------
@@ -383,27 +436,15 @@
/*!
* @protocol GrowlApplicationBridgeDelegate
* @abstract Required protocol for the Growl delegate.
* @discussion The methods in this protocol are required and are called
* @discussion The methods in this protocol are optional and are called
* automatically as needed by GrowlApplicationBridge. See
* <code>+[GrowlApplicationBridge setGrowlDelegate:]</code>.
* See also <code>GrowlApplicationBridgeDelegate_InformalProtocol</code>.
*/
@protocol GrowlApplicationBridgeDelegate
@protocol GrowlApplicationBridgeDelegate <NSObject>
// -registrationDictionaryForGrowl has moved to the informal protocol as of 0.7.
@end
//------------------------------------------------------------------------------
#pragma mark -
/*!
* @category NSObject(GrowlApplicationBridgeDelegate_InformalProtocol)
* @abstract Methods which may be optionally implemented by the GrowlDelegate.
* @discussion The methods in this informal protocol will only be called if implemented by the delegate.
*/
@interface NSObject (GrowlApplicationBridgeDelegate_InformalProtocol)
@optional
/*!
* @method registrationDictionaryForGrowl
@@ -510,66 +551,17 @@
*/
- (void) growlNotificationTimedOut:(id)clickContext;
/*!
* @method hasNetworkClientEntitlement
* @abstract Used only in sandboxed situations since we don't know whether the app has com.apple.security.network.client entitlement
* @discussion GrowlDelegate calls to find out if we have the com.apple.security.network.client entitlement,
* since we can't find this out without hitting the sandbox. We only call it if we detect that the application is sandboxed.
*/
- (BOOL) hasNetworkClientEntitlement;
@end
#pragma mark -
/*!
* @category NSObject(GrowlApplicationBridgeDelegate_Installation_InformalProtocol)
* @abstract Methods which may be optionally implemented by the Growl delegate when used with Growl-WithInstaller.framework.
* @discussion The methods in this informal protocol will only be called if
* implemented by the delegate. They allow greater control of the information
* presented to the user when installing or upgrading Growl from within your
* application when using Growl-WithInstaller.framework.
*/
@interface NSObject (GrowlApplicationBridgeDelegate_Installation_InformalProtocol)
/*!
* @method growlInstallationWindowTitle
* @abstract Return the title of the installation window.
* @discussion If not implemented, Growl will use a default, localized title.
* @result An NSString object to use as the title.
*/
- (NSString *)growlInstallationWindowTitle;
/*!
* @method growlUpdateWindowTitle
* @abstract Return the title of the upgrade window.
* @discussion If not implemented, Growl will use a default, localized title.
* @result An NSString object to use as the title.
*/
- (NSString *)growlUpdateWindowTitle;
/*!
* @method growlInstallationInformation
* @abstract Return the information to display when installing.
* @discussion This information may be as long or short as desired (the window
* will be sized to fit it). It will be displayed to the user as an
* explanation of what Growl is and what it can do in your application. It
* should probably note that no download is required to install.
*
* If this is not implemented, Growl will use a default, localized explanation.
* @result An NSAttributedString object to display.
*/
- (NSAttributedString *)growlInstallationInformation;
/*!
* @method growlUpdateInformation
* @abstract Return the information to display when upgrading.
* @discussion This information may be as long or short as desired (the window
* will be sized to fit it). It will be displayed to the user as an
* explanation that an updated version of Growl is included in your
* application and no download is required.
*
* If this is not implemented, Growl will use a default, localized explanation.
* @result An NSAttributedString object to display.
*/
- (NSAttributedString *)growlUpdateInformation;
@end
//private
@interface GrowlApplicationBridge (GrowlInstallationPrompt_private)
+ (void) _userChoseNotToInstallGrowl;
@end
#endif /* __GrowlApplicationBridge_h__ */
@@ -7,10 +7,8 @@
#ifdef __OBJC__
#define XSTR(x) (@x)
#define STRING_TYPE NSString *
#else
#define XSTR CFSTR
#define STRING_TYPE CFStringRef
#endif
/*! @header GrowlDefines.h
@@ -56,7 +54,7 @@
* This key is optional.
*/
#define GROWL_APP_ID XSTR("ApplicationId")
/*! @defined GROWL_APP_ICON
/*! @defined GROWL_APP_ICON_DATA
* @abstract The image data for your application's icon.
* @discussion Image data representing your application's icon. This may be
* superimposed on a notification icon as a badge, used as the notification
@@ -66,7 +64,7 @@
*
* Optional. Not supported by all display plugins.
*/
#define GROWL_APP_ICON XSTR("ApplicationIcon")
#define GROWL_APP_ICON_DATA XSTR("ApplicationIcon")
/*! @defined GROWL_NOTIFICATIONS_DEFAULT
* @abstract The array of notifications to turn on by default.
* @discussion These are the names of the notifications that should be enabled
@@ -101,6 +99,14 @@
* This key is optional.
*/
#define GROWL_NOTIFICATIONS_DESCRIPTIONS XSTR("NotificationDescriptions")
/*! @defined GROWL_NOTIFICATIONS_ICONS
* @abstract A dictionary of icons for each notification
* @discussion This is an NSDictionary whose keys are GROWL_NOTIFICATION_NAME strings and whose objects are
* icons for each notification, for GNTP spec
*
* This key is optional.
*/
#define GROWL_NOTIFICATIONS_ICONS XSTR("NotificationIcons")
/*! @defined GROWL_TICKET_VERSION
* @abstract The version of your registration ticket.
@@ -144,20 +150,20 @@
*/
#define GROWL_NOTIFICATION_DESCRIPTION XSTR("NotificationDescription")
/*! @defined GROWL_NOTIFICATION_ICON
* @discussion Image data for the notification icon. Must be in a format
* @discussion Image data for the notification icon. Image data must be in a format
* supported by NSImage, such as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF.
*
* Optional. Not supported by all display plugins.
*/
#define GROWL_NOTIFICATION_ICON XSTR("NotificationIcon")
#define GROWL_NOTIFICATION_ICON_DATA XSTR("NotificationIcon")
/*! @defined GROWL_NOTIFICATION_APP_ICON
* @discussion Image data for the application icon, in case GROWL_APP_ICON does
* not apply for some reason. Must be in a format supported by NSImage, such
* not apply for some reason. Image data be in a format supported by NSImage, such
* as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF.
*
* Optional. Not supported by all display plugins.
*/
#define GROWL_NOTIFICATION_APP_ICON XSTR("NotificationAppIcon")
#define GROWL_NOTIFICATION_APP_ICON_DATA XSTR("NotificationAppIcon")
/*! @defined GROWL_NOTIFICATION_PRIORITY
* @discussion The priority of the notification as an integer number from
* -2 to +2 (+2 being highest).
@@ -185,16 +191,6 @@
*/
#define GROWL_NOTIFICATION_CLICK_CONTEXT XSTR("NotificationClickContext")
/*! @defined GROWL_DISPLAY_PLUGIN
* @discussion The name of a display plugin which should be used for this notification.
* Optional. If this key is not set or the specified display plugin does not
* exist, the display plugin stored in the application ticket is used. This key
* allows applications to use different default display plugins for their
* notifications. The user can still override those settings in the preference
* pane.
*/
#define GROWL_DISPLAY_PLUGIN XSTR("NotificationDisplayPlugin")
/*! @defined GROWL_NOTIFICATION_IDENTIFIER
* @abstract An identifier for the notification for coalescing purposes.
* Notifications with the same identifier fall into the same class; only
@@ -224,6 +220,19 @@
*/
#define GROWL_NOTIFICATION_PROGRESS XSTR("NotificationProgress")
/*! @defined GROWL_NOTIFICATION_ALREADY_SHOWN
* @abstract If this key is set, it should contain a bool value wrapped
* in a NSNumber which describes whether the notification has
* already been displayed, for instance by built in Notification
* Center support. This value can be used to allow display
* plugins to skip a notification, while still allowing Growl
* actions to run on them.
*
* Optional. Not supported by all display plugins.
*/
#define GROWL_NOTIFICATION_ALREADY_SHOWN XSTR("AlreadyShown")
// Notifications
#pragma mark Notifications
@@ -245,7 +254,7 @@
* The userInfo dictionary for this notification can contain these keys:
* <ul>
* <li>GROWL_APP_NAME</li>
* <li>GROWL_APP_ICON</li>
* <li>GROWL_APP_ICON_DATA</li>
* <li>GROWL_NOTIFICATIONS_ALL</li>
* <li>GROWL_NOTIFICATIONS_DEFAULT</li>
* </ul>
@@ -288,12 +297,6 @@
* Growl_PostNotification.
*/
#define GROWL_NOTIFICATION XSTR("GrowlNotification")
/*! @defined GROWL_SHUTDOWN
* @abstract The distributed notification name that tells Growl to shutdown.
* @discussion The Growl preference pane posts this notification when the
* "Stop Growl" button is clicked.
*/
#define GROWL_SHUTDOWN XSTR("GrowlShutdown")
/*! @defined GROWL_PING
* @abstract A distributed notification to check whether Growl is running.
* @discussion This is used by the Growl preference pane. If it receives a
@@ -313,15 +316,48 @@
* registration dictionary supplied by its delegate.
*/
#define GROWL_IS_READY XSTR("Lend Me Some Sugar; I Am Your Neighbor!")
/*! @defined GROWL_NOTIFICATION_CLICKED
* @abstract The distributed notification sent when a supported notification is clicked.
/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX
* @abstract Part of the name of the distributed notification sent when a supported notification is clicked.
* @discussion When a Growl notification with a click context is clicked on by
* the user, Growl posts this distributed notification.
* The GrowlApplicationBridge responds to this notification by calling a
* callback in its delegate.
* the user, Growl posts a distributed notification whose name is in the format:
* [NSString stringWithFormat:@"%@-%d-%@", appName, pid, GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX]
* The GrowlApplicationBridge responds to this notification by calling a callback in its delegate.
*/
#define GROWL_NOTIFICATION_CLICKED XSTR("GrowlClicked!")
#define GROWL_NOTIFICATION_TIMED_OUT XSTR("GrowlTimedOut!")
#define GROWL_DISTRIBUTED_NOTIFICATION_CLICKED_SUFFIX XSTR("GrowlClicked!")
/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX
* @abstract Part of the name of the distributed notification sent when a supported notification times out without being clicked.
* @discussion When a Growl notification with a click context times out, Growl posts a distributed notification
* whose name is in the format:
* [NSString stringWithFormat:@"%@-%d-%@", appName, pid, GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX]
* The GrowlApplicationBridge responds to this notification by calling a callback in its delegate.
* NOTE: The user may have actually clicked the 'close' button; this triggers an *immediate* time-out of the notification.
*/
#define GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX XSTR("GrowlTimedOut!")
/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_ON
* @abstract The distributed notification sent when the Notification Center support is toggled on in Growl 2.0
* @discussion When the user enables Notification Center support in Growl 2.0, this notification is sent
* to inform all running apps that they should now speak to Notification Center directly.
*/
#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_ON XSTR("GrowlNotificationCenterOn!")
/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_OFF
* @abstract The distributed notification sent when the Notification Center support is toggled off in Growl 2.0
* @discussion When the user enables Notification Center support in Growl 2.0, this notification is sent
* to inform all running apps that they should no longer speak to Notification Center directly.
*/
#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_OFF XSTR("GrowlNotificationCenterOff!")
/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_QUERY
* @abstract The distributed notification sent by an application to query Growl 2.0's notification center support.
* @discussion When an app starts up, it will send this query to get Growl 2.0 to spit out whether notification
* center support is on or off.
*/
#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_QUERY XSTR("GrowlNotificationCenterYN?")
/*! @group Other symbols */
/* Symbols which don't fit into any of the other categories. */
@@ -345,4 +381,6 @@
#define GROWL_POSITION_PREFERENCE_KEY @"GrowlSelectedPosition"
#define GROWL_PLUGIN_CONFIG_ID XSTR("GrowlPluginConfigurationID")
#endif //ndef _GROWLDEFINES_H
@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>12C60</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
@@ -13,11 +15,25 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.2.1</string>
<string>2.0.1</string>
<key>CFBundleSignature</key>
<string>GRRR</string>
<key>CFBundleVersion</key>
<string>1.2.1</string>
<string>2.0.1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>4G2008a</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>12C37</string>
<key>DTSDKName</key>
<string>macosx10.8</string>
<key>DTXcode</key>
<string>0452</string>
<key>DTXcodeBuild</key>
<string>4G2008a</string>
<key>NSPrincipalClass</key>
<string>GrowlApplicationBridge</string>
</dict>
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Resources/Info.plist</key>
<data>
VZb3f8My4te/5JwcjfvotgCXTAs=
</data>
</dict>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
</dict>
</plist>
@@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0</string>
<string>3.0.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.0</string>
<string>3.0.5</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSUIElement</key>
@@ -30,5 +30,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>XCCCompatibilityVersion</key>
<real>3</real>
</dict>
</plist>
+41
View File
@@ -0,0 +1,41 @@
#import <Foundation/Foundation.h>
#import <asl.h>
#import "DDLog.h"
/**
* Welcome to Cocoa Lumberjack!
*
* The project page has a wealth of documentation if you have any questions.
* https://github.com/robbiehanson/CocoaLumberjack
*
* If you're new to the project you may wish to read the "Getting Started" wiki.
* https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted
*
*
* This class provides a logger for the Apple System Log facility.
*
* As described in the "Getting Started" page,
* the traditional NSLog() function directs it's output to two places:
*
* - Apple System Log
* - StdErr (if stderr is a TTY) so log statements show up in Xcode console
*
* To duplicate NSLog() functionality you can simply add this logger and a tty logger.
* However, if you instead choose to use file logging (for faster performance),
* you may choose to use a file logger and a tty logger.
**/
@interface DDASLLogger : DDAbstractLogger <DDLogger>
{
aslclient client;
}
+ (DDASLLogger *)sharedInstance;
// Inherited from DDAbstractLogger
// - (id <DDLogFormatter>)logFormatter;
// - (void)setLogFormatter:(id <DDLogFormatter>)formatter;
@end
Loaded 100 of 192 files, more files were not shown because too many files have changed in this diff. Show more