diff --git a/AppKit/CPDatePicker/_CPDatePickerElementTextField.j b/AppKit/CPDatePicker/_CPDatePickerElementTextField.j index 012a7a81a..8bdb0b1ac 100644 --- a/AppKit/CPDatePicker/_CPDatePickerElementTextField.j +++ b/AppKit/CPDatePicker/_CPDatePickerElementTextField.j @@ -385,6 +385,18 @@ CPAMPMDateType = 6; return; } + // if we enter a day that is too high for the current month + // we need to increase the month by one + // if we do not do this, the user input would be silently reset + // very poor user experience + + if (parseInt(anObjectValue, 10) > [dateValue _daysInMonth]) + { + [_datePickerElementView._textFieldMonth setIntValue:(dateValue.getMonth() + 2)]; + [super setObjectValue:objectValue]; + return; + } + [super setObjectValue:objectValue]; break; diff --git a/AppKit/CPView.j b/AppKit/CPView.j index 9c4eaef0c..df06eb78b 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -44,6 +44,7 @@ @class CPClipView @class CPScrollView @class CALayer +@class CPBinder @global appkit_tag_dom_elements @@ -232,7 +233,7 @@ var CPViewHighDPIDrawingEnabled = YES; JSObject _ephemeralSubviews; JSObject _ephemeralSubviewsForNames; - CPSet _ephereralSubviews; + CPSet _ephemeralSubviews; // Key View Support CPView _nextKeyView; @@ -3732,6 +3733,16 @@ var CPAppearanceVibrantDark = [CPAppearance appearanceNamed:CPAppearanceNameVibr [owners[i] updateTrackingAreas]; } +// needed by CPWindow's releasedWhenClosed property +- (void)_releaseRecursively +{ + [_subviews makeObjectsPerformSelector:@selector(_releaseRecursively)]; + + [self _removeObservers]; + [CPBinder unbindAllForObject:self]; + [self removeFromSuperview]; +} + @end var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask", diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index 5c1b266f5..023193871 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -186,6 +186,7 @@ var CPWindowActionMessageKeys = [ BOOL _constrainsToUsableScreen; unsigned _shadowStyle; BOOL _showsResizeIndicator; + BOOL _releasedWhenClosed @accessors(property=releasedWhenClosed); int _positioningMask; CGRect _positioningScreenRect; @@ -2536,6 +2537,9 @@ CPTexturedBackgroundWindowMask [_parentWindow removeChildWindow:self]; [self _orderOutRecursively:NO]; [self _detachFromChildrenClosing:!_parentWindow]; + + if (_releasedWhenClosed) + [_contentView _releaseRecursively]; } - (void)_detachFromChildrenClosing:(BOOL)shouldCloseChildren diff --git a/Foundation/CPString.j b/Foundation/CPString.j index e9331e000..eeccf81b5 100644 --- a/Foundation/CPString.j +++ b/Foundation/CPString.j @@ -570,6 +570,16 @@ var CPStringNull = [CPNull null]; return aString && aString != "" && self.indexOf(aString) == 0; } +/*! + Returns \c YES if the receiver contains + the specified string. If \c aString + is empty, the method will return \c NO. + */ +- (BOOL)containsString:(CPString)aString +{ + return aString && aString != "" && self.indexOf(aString) >= 0; +} + /*! Returns \c YES if the receiver ends with the specified string. If \c aString diff --git a/Tools/XcodeCapp/Jakefile b/Tools/XcodeCapp/Jakefile index dd964200b..8aa1e055f 100644 --- a/Tools/XcodeCapp/Jakefile +++ b/Tools/XcodeCapp/Jakefile @@ -24,9 +24,9 @@ task ("build", function() minorVersion = parseInt(versions[1], 10), buildVersion = parseInt(versions[2], 10); - if (!((majorVersion == 11) || (majorVersion == 10 && minorVersion >= 12))) + if (!((majorVersion >= 11) || (majorVersion == 10 && minorVersion >= 13))) { - colorPrint("XcodeCapp requires at least macOS Sierra.", "red"); + colorPrint("XcodeCapp requires at least macOS High Sierra.", "red"); p.stdin.close(); p.stdout.close(); diff --git a/Tools/XcodeCapp/XcodeCapp.xcodeproj/project.pbxproj b/Tools/XcodeCapp/XcodeCapp.xcodeproj/project.pbxproj index 583ebc8c8..6a0cf87f4 100644 --- a/Tools/XcodeCapp/XcodeCapp.xcodeproj/project.pbxproj +++ b/Tools/XcodeCapp/XcodeCapp.xcodeproj/project.pbxproj @@ -444,7 +444,6 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_LOCATION = YES; - DSTROOT = /; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -463,7 +462,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INSTALL_PATH = $USER_APPS_DIR; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -494,7 +493,6 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEPLOYMENT_LOCATION = YES; - DSTROOT = /; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -506,7 +504,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INSTALL_PATH = $USER_APPS_DIR; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; }; @@ -518,11 +516,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; - DSTROOT = /; INFOPLIST_FILE = XcodeCapp/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = XcodeCapp; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools"; INSTALL_PATH = "$(LOCAL_APPS_DIR)"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = org.cappuccino.xcodecapp; PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -534,11 +533,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; - DSTROOT = /; INFOPLIST_FILE = XcodeCapp/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = XcodeCapp; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools"; INSTALL_PATH = "$(LOCAL_APPS_DIR)"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = org.cappuccino.xcodecapp; PRODUCT_NAME = "$(TARGET_NAME)"; }; diff --git a/bootstrap.sh b/bootstrap.sh index af1e1b0d1..223ae0031 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -381,7 +381,21 @@ if [ `uname` = "Darwin" ]; then check_build_environment # The narwhal-jsc package is already installed within the base kit. - + + # Xcode 15's version of the 'ld' linker no longer supports + # the '-force_cpusubtype_ALL' flag. + # Although not documented, this may have been included to support PowerPC compilation. + # Removing the flag has been successfully tested on High Sierra/Xcode 10.1 + # Testing on all intermediate operating systems and Xcode versions isn't practical, + # or beneficial, given the imminent move to NodeJS. + # We apply the patch here for expediency, rather than in the 'cappuccino-base' repository. + # If a full final release of the narwhal branch is undertaken, + # the change will be applied to cappuccino-base at that time. + # Note: Rosetta2 is still available in macOS Sonoma. + # Compiling for both Intel and Apple Silicon targets requires a testing program + # which is, again, neither practical nor justified at this stage of Narwhal's lifecycle. + sed -i .orig 's/-force_cpusubtype_ALL//g' $install_directory/packages/narwhal-jsc/Makefile + # This autoreconf command improves compatibility with MacPorts, but only works with autoconf 2.65+. needed_autoconf_major=2 needed_autoconf_minor=65