diff --git a/Acknowledgments.txt b/Acknowledgments.txt index 7e25ca00..98862c53 100644 --- a/Acknowledgments.txt +++ b/Acknowledgments.txt @@ -338,31 +338,76 @@ http://www.opensource.org/licenses/bsd-license.php -- -CocoaICU - -Copyright (c) 2005-2006, Aaron Evans -* All rights reserved. -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of Aaron Evans, nor the names of its contributors may -* be used to endorse or promote products derived from this software -* without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' -* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE COYPRIGHT HOLDERS AND CONTRIBUTORS AND -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +AutoHyperlinks framework + +/* + * The AutoHyperlinks Framework is the legal property of its developers (DEVELOPERS), whose names are listed in the + * copyright file included with this source distribution. + * + * Copyright (c) 2004-2008 + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AutoHyperlinks Framework nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY ITS DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL ITS DEVELOPERS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + Adium (AutoHyperlinks framework) + Copyright (C) 2001-2005 by the following: + + Adam Atlas + Colin Barrett + Erik J. Barzeski + Max Bertrand + Adam Betts + Jorge Salvador Caffarena + David Clark + Nelson Elhage + Ken Ferry + Christopher Forsythe + Brian Ganninger + Arno Hautala + Asher Haig + Jasper Hauser + Stephen Holt + Adam Iser + Severin Klaus + Ian Krieg + Thomas Kunze + Scott Lamb + Jack M.H. Lin + Sam McCandlish + Nicola Del Monaco + David Munch + Daisuke Okada + Mac-arena the Bored Zo + Chris Serino + Jeffrey Melloy + Roeland Nas + Laura Natcher + Daisuke Okada + Stephen Poprocki + Evan Schoenberg + David Smith + Greg Smith + Vinay Venkatesh + Wesley Underwood diff --git a/AttributedPlainText.m b/AttributedPlainText.m index 9a170457..781e2b33 100755 --- a/AttributedPlainText.m +++ b/AttributedPlainText.m @@ -19,9 +19,9 @@ #import "AttributedPlainText.h" #import "NSCollection_utils.h" #import "GlobalPrefs.h" -#import "ICUPattern.h" -#import "ICUMatcher.h" #import "NSString_NV.h" +#import + @implementation NSMutableAttributedString (AttributedPlainText) @@ -168,61 +168,34 @@ - (BOOL)restyleTextToFont:(NSFont*)currentFont usingBaseFont:(NSFont*)baseFont { - (void)addLinkAttributesForRange:(NSRange)changedRange { - if (!changedRange.length) return; + if (!changedRange.length) + return; - static ICUPattern *urlPattern = nil; - //This regexp modeled on John Gruber's patterns: http://daringfireball.net/2010/07/improved_regex_for_matching_urls - if (!urlPattern) urlPattern = [ICUPattern patternWithString: - @"(?i)\\b((?:[a-z][\\w-]+:/{2,3}|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>\\[\\]]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))"]; - //For a heavier-duty implementation, Adium's AutoHyperlinks framework (based on flex) might be better + //lazily loads Adium's BSD-licensed Auto-Hyperlinks: //http://trac.adium.im/wiki/AutoHyperlinksFramework - static ICUPattern *emailPattern = nil; - //use a separate regexp for email addresses, eschewing any that contain an inner colon - if (!emailPattern) emailPattern = [ICUPattern patternWithString:@"(\\w+([-+.']\\w+)*?@(?>\\w+([-.]\\w+)*?\\.\\w+([-.]\\w+)*))(?=[^:]|:*?($|\\s))"]; - - [self beginEditing]; - @try { - NSMutableIndexSet *urlIndexes = [NSMutableIndexSet indexSet]; - - ICUMatcher *matcher = [ICUMatcher matcherWithPattern:urlPattern overString:[self string] range:changedRange]; - - while ([matcher findNext]) { - NSRange range = [matcher rangeOfMatch]; - NSString *extractedMatch = [[self string] substringWithRange:range]; - [urlIndexes addIndexesInRange:range]; - - NSURL *url = [NSURL URLWithString:extractedMatch]; - if (![[url scheme] length]) { - //if the parsed URL lacks an explicit protocol specifier, just assume it's http - url = [NSURL URLWithString:[@"http://" stringByAppendingString:extractedMatch]]; - } - //File Reference URLs cannot be safely archived! - if (url && !([url isFileURL] && [extractedMatch rangeOfString:@"/.file/" options:NSLiteralSearch].location != NSNotFound)) - [self addAttribute:NSLinkAttributeName value:url range:range]; + static Class AHHyperlinkScanner = Nil; + static Class AHMarkedHyperlink = Nil; + if (!AHHyperlinkScanner || !AHMarkedHyperlink) { + if (![[NSBundle bundleWithPath:[[[NSBundle mainBundle] privateFrameworksPath] stringByAppendingPathComponent:@"AutoHyperlinks.framework"]] load]) { + NSLog(@"Could not load AutoHyperlinks framework"); + return; } - - matcher = [ICUMatcher matcherWithPattern:emailPattern overString:[self string] range:changedRange]; - while ([matcher findNext]) { - NSRange range = [matcher rangeOfMatch]; - - //don't make links if part of the range was already matched as a URL - if (![urlIndexes intersectsIndexesInRange:range]) { - NSURL *url = [NSURL URLWithString:[@"mailto:" stringByAppendingString:[[self string] substringWithRange:range]]]; - if (url) [self addAttribute:NSLinkAttributeName value:url range:range]; - } - } - - //NEXT: add [[ ]] url-links? - - + AHHyperlinkScanner = NSClassFromString(@"AHHyperlinkScanner"); + AHMarkedHyperlink = NSClassFromString(@"AHMarkedHyperlink"); } - @catch (NSException *e) { - NSLog(@"Failed adding link attributes for %u-char string: %@", [self length], e); - } - @finally { - [self endEditing]; + + id scanner = [AHHyperlinkScanner hyperlinkScannerWithString:[[self string] substringWithRange:changedRange]]; + id markedLink = nil; + while ((markedLink = [scanner nextURI])) { + NSURL *markedLinkURL = nil; + if ((markedLinkURL = [markedLink URL])) { + [self addAttribute:NSLinkAttributeName value:markedLinkURL + range:NSMakeRange([markedLink range].location + changedRange.location, [markedLink range].length)]; + } } + + //also detect double-bracketed URLs here } diff --git a/AutoHyperlinks.framework/AutoHyperlinks b/AutoHyperlinks.framework/AutoHyperlinks new file mode 120000 index 00000000..0aa46e77 --- /dev/null +++ b/AutoHyperlinks.framework/AutoHyperlinks @@ -0,0 +1 @@ +Versions/Current/AutoHyperlinks \ No newline at end of file diff --git a/AutoHyperlinks.framework/Headers b/AutoHyperlinks.framework/Headers new file mode 120000 index 00000000..a177d2a6 --- /dev/null +++ b/AutoHyperlinks.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/AutoHyperlinks.framework/Resources b/AutoHyperlinks.framework/Resources new file mode 120000 index 00000000..953ee36f --- /dev/null +++ b/AutoHyperlinks.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/AutoHyperlinks.framework/Versions/A/AutoHyperlinks b/AutoHyperlinks.framework/Versions/A/AutoHyperlinks new file mode 100755 index 00000000..0b23d091 Binary files /dev/null and b/AutoHyperlinks.framework/Versions/A/AutoHyperlinks differ diff --git a/AutoHyperlinks.framework/Versions/A/Headers/AHHyperlinkScanner.h b/AutoHyperlinks.framework/Versions/A/Headers/AHHyperlinkScanner.h new file mode 100644 index 00000000..bbaf2ad1 --- /dev/null +++ b/AutoHyperlinks.framework/Versions/A/Headers/AHHyperlinkScanner.h @@ -0,0 +1,152 @@ +/* + * The AutoHyperlinks Framework is the legal property of its developers (DEVELOPERS), whose names are listed in the + * copyright file included with this source distribution. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AutoHyperlinks Framework nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY ITS DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL ITS DEVELOPERS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "AHLinkLexer.h" + +typedef void* yyscan_t; + +extern long AHlex( yyscan_t yyscanner ); +extern long AHlex_init( yyscan_t * ptr_yy_globals ); +extern long AHlex_destroy ( yyscan_t yyscanner ); +extern long AHget_leng ( yyscan_t scanner ); +extern void AHset_in ( FILE * in_str , yyscan_t scanner ); + +typedef struct AH_buffer_state *AH_BUFFER_STATE; +extern void AH_switch_to_buffer(AH_BUFFER_STATE, yyscan_t scanner); +extern AH_BUFFER_STATE AH_scan_string (const char *, yyscan_t scanner); +extern void AH_delete_buffer(AH_BUFFER_STATE, yyscan_t scanner); + +@class AHMarkedHyperlink; + +@interface AHHyperlinkScanner : NSObject +{ + NSDictionary *m_urlSchemes; + NSString *m_scanString; + NSAttributedString *m_scanAttrString; + BOOL m_strictChecking; + NSUInteger m_scanLocation; + NSUInteger m_scanStringLength; +} + + +/*! + * @brief Allocs and inits a new lax AHHyperlinkScanner with the given NSString + * + * @param inString the scanner's string + * @return a new AHHyperlinkScanner + */ ++ (id)hyperlinkScannerWithString:(NSString *)inString; + +/*! + * @brief Allocs and inits a new strict AHHyperlinkScanner with the given NSString + * + * @param inString the scanner's string + * @return a new AHHyperlinkScanner + */ ++ (id)strictHyperlinkScannerWithString:(NSString *)inString; + +/*! + * @brief Allocs and inits a new lax AHHyperlinkScanner with the given attributed string + * + * @param inString the scanner's string + * @return a new AHHyperlinkScanner + */ ++ (id)hyperlinkScannerWithAttributedString:(NSAttributedString *)inString; + +/*! + * @brief Allocs and inits a new strict AHHyperlinkScanner with the given attributed string + * + * @param inString the scanner's string + * @return a new AHHyperlinkScanner + */ ++ (id)strictHyperlinkScannerWithAttributedString:(NSAttributedString *)inString; + +/*! + * @brief Determine the validity of a given string with a custom strictness + * + * @param inString The string to be verified + * @param useStrictChecking Use strict rules or not + * @param index a pointer to the index the string starts at, for easy incrementing. + * @return Boolean + */ ++ (BOOL)isStringValidURI:(NSString *)inString usingStrict:(BOOL)useStrictChecking fromIndex:(NSUInteger *)index withStatus:(AH_URI_VERIFICATION_STATUS *)validStatus; + +/*! + * @brief Init + * + * Inits a new AHHyperlinkScanner object for a NSString with the set strict checking option. + * + * @param inString the NSString to be scanned. + * @param flag Sets strict checking preference. + * @return A new AHHyperlinkScanner. + */ +- (id)initWithString:(NSString *)inString usingStrictChecking:(BOOL)flag; + +/*! + * @brief Init + * + * Inits a new AHHyperlinkScanner object for a NSAttributedString with the set strict checking option. + * + * param inString the NSString to be scanned. + * @param flag Sets strict checking preference. + * @return A new AHHyperlinkScanner. + */ + - (id)initWithAttributedString:(NSAttributedString *)inString usingStrictChecking:(BOOL)flag; + + +/*! + * @brief Determine the validity of the scanner's string using the set strictness + * + * @return Boolean + */ +- (BOOL)isValidURI; + +/*! + * @brief Returns a AHMarkedHyperlink representing the next URI in the scanner's string + * + * @return A new AHMarkedHyperlink. + */ +- (AHMarkedHyperlink *)nextURI; + +/*! + * @brief Fetches all the URIs from the scanner's string + * + * @return An array of AHMarkedHyperlinks representing each matched URL in the string or nil if no matches. + */ +- (NSArray *)allURIs; + +/*! + * @brief Scans an attributed string for URIs then adds the link attribs and objects. + * @param inString The NSAttributedString to be linkified + * @return An autoreleased NSAttributedString. + */ +- (NSAttributedString *)linkifiedString; + +- (NSUInteger)scanLocation; +- (void)setScanLocation:(NSUInteger)location; + +@end diff --git a/AutoHyperlinks.framework/Versions/A/Headers/AHLinkLexer.h b/AutoHyperlinks.framework/Versions/A/Headers/AHLinkLexer.h new file mode 100644 index 00000000..a1012396 --- /dev/null +++ b/AutoHyperlinks.framework/Versions/A/Headers/AHLinkLexer.h @@ -0,0 +1,45 @@ +/* + * The AutoHyperlinks Framework is the legal property of its developers (DEVELOPERS), whose names are listed in the + * copyright file included with this source distribution. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AutoHyperlinks Framework nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY ITS DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL ITS DEVELOPERS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if __LP64__ || NS_BUILD_32_LIKE_64 +typedef long NSInteger; +typedef unsigned long NSUInteger; +#else +typedef int NSInteger; +typedef unsigned int NSUInteger; +#endif + +typedef enum { + AH_URL_INVALID = -1, + AH_URL_VALID = 0, + AH_MAILTO_VALID, + AH_FILE_VALID, + AH_URL_DEGENERATE, + AH_MAILTO_DEGENERATE +} AH_URI_VERIFICATION_STATUS; + +#define YY_EXTRA_TYPE NSUInteger diff --git a/AutoHyperlinks.framework/Versions/A/Headers/AHMarkedHyperlink.h b/AutoHyperlinks.framework/Versions/A/Headers/AHMarkedHyperlink.h new file mode 100644 index 00000000..34a362e5 --- /dev/null +++ b/AutoHyperlinks.framework/Versions/A/Headers/AHMarkedHyperlink.h @@ -0,0 +1,51 @@ +/* + * The AutoHyperlinks Framework is the legal property of its developers (DEVELOPERS), whose names are listed in the + * copyright file included with this source distribution. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AutoHyperlinks Framework nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY ITS DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL ITS DEVELOPERS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "AHLinkLexer.h" + + +@interface AHMarkedHyperlink : NSObject { + NSRange linkRange; + NSURL *linkURL; + NSString *pString; + AH_URI_VERIFICATION_STATUS urlStatus; +} + +-(id)initWithString:(NSString *)inString withValidationStatus:(AH_URI_VERIFICATION_STATUS)status parentString:(NSString *)pInString andRange:(NSRange)inRange; +-(NSString *)parentString; +-(NSRange)range; +-(NSURL *)URL; +-(AH_URI_VERIFICATION_STATUS)validationStatus; + +-(void)setRange:(NSRange)inRange; +-(void)setURL:(NSURL *)inURL; +-(void)setURLFromString:(NSString *)inString; +-(void)setValidationStatus:(AH_URI_VERIFICATION_STATUS)status; +-(void)setParentString:(NSString *)pInString; + + +@end diff --git a/AutoHyperlinks.framework/Versions/A/Headers/AutoHyperlinks.h b/AutoHyperlinks.framework/Versions/A/Headers/AutoHyperlinks.h new file mode 100644 index 00000000..cc1821e0 --- /dev/null +++ b/AutoHyperlinks.framework/Versions/A/Headers/AutoHyperlinks.h @@ -0,0 +1,29 @@ +/* + * The AutoHyperlinks Framework is the legal property of its developers (DEVELOPERS), whose names are listed in the + * copyright file included with this source distribution. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the AutoHyperlinks Framework nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY ITS DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL ITS DEVELOPERS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "AHHyperlinkScanner.h" +#import "AHMarkedHyperlink.h" diff --git a/AutoHyperlinks.framework/Versions/A/Resources/Info.plist b/AutoHyperlinks.framework/Versions/A/Resources/Info.plist new file mode 100644 index 00000000..11d13bde Binary files /dev/null and b/AutoHyperlinks.framework/Versions/A/Resources/Info.plist differ diff --git a/AutoHyperlinks.framework/Versions/Current b/AutoHyperlinks.framework/Versions/Current new file mode 120000 index 00000000..8c7e5a66 --- /dev/null +++ b/AutoHyperlinks.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Notation.xcodeproj/project.pbxproj b/Notation.xcodeproj/project.pbxproj index 47eb3ea4..2524267b 100755 --- a/Notation.xcodeproj/project.pbxproj +++ b/Notation.xcodeproj/project.pbxproj @@ -125,13 +125,8 @@ 21B54C021134F2E800E163A1 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21B54C011134F2E800E163A1 /* IOKit.framework */; }; 21BD2ED110DAF31500BA3DF6 /* LinearDividerShader.m in Sources */ = {isa = PBXBuildFile; fileRef = 21BD2ECF10DAF31500BA3DF6 /* LinearDividerShader.m */; }; 21BD2F3610DAF61700BA3DF6 /* SplitViewDimple.tif in Resources */ = {isa = PBXBuildFile; fileRef = 21BD2F3510DAF61700BA3DF6 /* SplitViewDimple.tif */; }; - 21C0F57E12C480970068693F /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 21C0F57D12C480970068693F /* libicucore.dylib */; }; - 21C0F59212C480B00068693F /* LICENSE.html in Resources */ = {isa = PBXBuildFile; fileRef = 21C0F58012C480B00068693F /* LICENSE.html */; }; - 21C0F59A12C481DD0068693F /* ICUMatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 21C0F59512C481DD0068693F /* ICUMatcher.m */; }; - 21C0F59B12C481DD0068693F /* LICENSE.txt in Resources */ = {isa = PBXBuildFile; fileRef = 21C0F59712C481DD0068693F /* LICENSE.txt */; }; - 21C0F59C12C481DD0068693F /* NSStringICUAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 21C0F59912C481DD0068693F /* NSStringICUAdditions.m */; }; - 21C0F5D112C48C2E0068693F /* ICUPattern.m in Sources */ = {isa = PBXBuildFile; fileRef = 21C0F5D012C48C2E0068693F /* ICUPattern.m */; }; 21C0F8A212C7E7160068693F /* Fonts & Colors.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 21C0F8A112C7E7160068693F /* Fonts & Colors.tiff */; }; + 21C3D8F212CAB20D002F707A /* AutoHyperlinks.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 21C3D8F012CAB207002F707A /* AutoHyperlinks.framework */; }; 21C737950B50C73E0048C08A /* MultiplePageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 21C737940B50C73E0048C08A /* MultiplePageView.m */; }; 21D583620B78F0CC00245E29 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21D5834D0B78F0CC00245E29 /* ApplicationServices.framework */; }; 21D60128098FDB46007440DF /* GlobalPrefs.m in Sources */ = {isa = PBXBuildFile; fileRef = 21D60127098FDB46007440DF /* GlobalPrefs.m */; }; @@ -183,6 +178,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + 21C3D8F212CAB20D002F707A /* AutoHyperlinks.framework in CopyFiles */, 213623FC0B92AA6E008C0830 /* Sparkle.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; @@ -388,32 +384,8 @@ 21BD2ECF10DAF31500BA3DF6 /* LinearDividerShader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LinearDividerShader.m; sourceTree = ""; }; 21BD2ED010DAF31500BA3DF6 /* LinearDividerShader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinearDividerShader.h; sourceTree = ""; }; 21BD2F3510DAF61700BA3DF6 /* SplitViewDimple.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = SplitViewDimple.tif; sourceTree = ""; }; - 21C0F57D12C480970068693F /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; }; - 21C0F58012C480B00068693F /* LICENSE.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LICENSE.html; sourceTree = ""; }; - 21C0F58212C480B00068693F /* parseerr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parseerr.h; sourceTree = ""; }; - 21C0F58312C480B00068693F /* platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform.h; sourceTree = ""; }; - 21C0F58412C480B00068693F /* putil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = putil.h; sourceTree = ""; }; - 21C0F58512C480B00068693F /* uconfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uconfig.h; sourceTree = ""; }; - 21C0F58612C480B00068693F /* udraft.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = udraft.h; sourceTree = ""; }; - 21C0F58712C480B00068693F /* uiter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uiter.h; sourceTree = ""; }; - 21C0F58812C480B00068693F /* umachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = umachine.h; sourceTree = ""; }; - 21C0F58912C480B00068693F /* uregex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uregex.h; sourceTree = ""; }; - 21C0F58A12C480B00068693F /* urename.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = urename.h; sourceTree = ""; }; - 21C0F58B12C480B00068693F /* ustring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ustring.h; sourceTree = ""; }; - 21C0F58C12C480B00068693F /* utf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utf.h; sourceTree = ""; }; - 21C0F58D12C480B00068693F /* utf16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utf16.h; sourceTree = ""; }; - 21C0F58E12C480B00068693F /* utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utf8.h; sourceTree = ""; }; - 21C0F58F12C480B00068693F /* utf_old.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utf_old.h; sourceTree = ""; }; - 21C0F59012C480B00068693F /* utypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utypes.h; sourceTree = ""; }; - 21C0F59112C480B00068693F /* uversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uversion.h; sourceTree = ""; }; - 21C0F59412C481DD0068693F /* ICUMatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ICUMatcher.h; path = ICU/ICUMatcher.h; sourceTree = ""; }; - 21C0F59512C481DD0068693F /* ICUMatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ICUMatcher.m; path = ICU/ICUMatcher.m; sourceTree = ""; }; - 21C0F59612C481DD0068693F /* ICUPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ICUPattern.h; path = ICU/ICUPattern.h; sourceTree = ""; }; - 21C0F59712C481DD0068693F /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE.txt; path = ICU/LICENSE.txt; sourceTree = ""; }; - 21C0F59812C481DD0068693F /* NSStringICUAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSStringICUAdditions.h; path = ICU/NSStringICUAdditions.h; sourceTree = ""; }; - 21C0F59912C481DD0068693F /* NSStringICUAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSStringICUAdditions.m; path = ICU/NSStringICUAdditions.m; sourceTree = ""; }; - 21C0F5D012C48C2E0068693F /* ICUPattern.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ICUPattern.m; path = ICU/ICUPattern.m; sourceTree = ""; }; 21C0F8A112C7E7160068693F /* Fonts & Colors.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = "Fonts & Colors.tiff"; path = "Images/Fonts & Colors.tiff"; sourceTree = ""; }; + 21C3D8F012CAB207002F707A /* AutoHyperlinks.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AutoHyperlinks.framework; sourceTree = ""; }; 21C737930B50C73E0048C08A /* MultiplePageView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MultiplePageView.h; sourceTree = ""; }; 21C737940B50C73E0048C08A /* MultiplePageView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MultiplePageView.m; sourceTree = ""; }; 21CB29AD10EEE39400360118 /* SyncServiceSessionProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SyncServiceSessionProtocol.h; sourceTree = ""; }; @@ -538,7 +510,6 @@ 21D583620B78F0CC00245E29 /* ApplicationServices.framework in Frameworks */, 219D254A1113FE34005E7DF5 /* SystemConfiguration.framework in Frameworks */, 21B54C021134F2E800E163A1 /* IOKit.framework in Frameworks */, - 21C0F57E12C480970068693F /* libicucore.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -619,9 +590,9 @@ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { isa = PBXGroup; children = ( - 21C0F57D12C480970068693F /* libicucore.dylib */, 21B54C011134F2E800E163A1 /* IOKit.framework */, 213623E50B92AA4E008C0830 /* Sparkle.framework */, + 21C3D8F012CAB207002F707A /* AutoHyperlinks.framework */, 210C07230B6BF0A1005D23A8 /* WebKit.framework */, 21973FBC0B0060C80046683E /* Security.framework */, 214494F80ADC7C8D00E2A2B6 /* SecurityInterface.framework */, @@ -815,54 +786,6 @@ name = Images; sourceTree = ""; }; - 21C0F57512C480210068693F /* ICU */ = { - isa = PBXGroup; - children = ( - 21C0F57F12C480B00068693F /* icu */, - 21C0F59412C481DD0068693F /* ICUMatcher.h */, - 21C0F59512C481DD0068693F /* ICUMatcher.m */, - 21C0F59612C481DD0068693F /* ICUPattern.h */, - 21C0F5D012C48C2E0068693F /* ICUPattern.m */, - 21C0F59712C481DD0068693F /* LICENSE.txt */, - 21C0F59812C481DD0068693F /* NSStringICUAdditions.h */, - 21C0F59912C481DD0068693F /* NSStringICUAdditions.m */, - ); - name = ICU; - sourceTree = ""; - }; - 21C0F57F12C480B00068693F /* icu */ = { - isa = PBXGroup; - children = ( - 21C0F58012C480B00068693F /* LICENSE.html */, - 21C0F58112C480B00068693F /* unicode */, - ); - name = icu; - path = ICU/icu; - sourceTree = ""; - }; - 21C0F58112C480B00068693F /* unicode */ = { - isa = PBXGroup; - children = ( - 21C0F58212C480B00068693F /* parseerr.h */, - 21C0F58312C480B00068693F /* platform.h */, - 21C0F58412C480B00068693F /* putil.h */, - 21C0F58512C480B00068693F /* uconfig.h */, - 21C0F58612C480B00068693F /* udraft.h */, - 21C0F58712C480B00068693F /* uiter.h */, - 21C0F58812C480B00068693F /* umachine.h */, - 21C0F58912C480B00068693F /* uregex.h */, - 21C0F58A12C480B00068693F /* urename.h */, - 21C0F58B12C480B00068693F /* ustring.h */, - 21C0F58C12C480B00068693F /* utf.h */, - 21C0F58D12C480B00068693F /* utf16.h */, - 21C0F58E12C480B00068693F /* utf8.h */, - 21C0F58F12C480B00068693F /* utf_old.h */, - 21C0F59012C480B00068693F /* utypes.h */, - 21C0F59112C480B00068693F /* uversion.h */, - ); - path = unicode; - sourceTree = ""; - }; 21F0793710EC5E21004FE56F /* Sync Services */ = { isa = PBXGroup; children = ( @@ -933,7 +856,6 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( - 21C0F57512C480210068693F /* ICU */, 21F07C7010EDED87004FE56F /* BSJSON */, 2182B38E106B2286008641E4 /* RBSplitView */, 21F1CD490B3A38CB001FB5F6 /* HotKeys */, @@ -1117,8 +1039,6 @@ 21286596128B14F10013820A /* Dies ist der Titel einer Notiz.nvhelp in Resources */, 21286597128B14F10013820A /* Kontaktdaten.nvhelp in Resources */, 21286598128B14F10013820A /* Wie funktioniert dieses Programm?.nvhelp in Resources */, - 21C0F59212C480B00068693F /* LICENSE.html in Resources */, - 21C0F59B12C481DD0068693F /* LICENSE.txt in Resources */, 21C0F8A212C7E7160068693F /* Fonts & Colors.tiff in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1205,9 +1125,6 @@ 212C6952110E1940004DD82C /* TitlebarButton.m in Sources */, 21B548FA112F307E00E163A1 /* NotationDirectoryManager.m in Sources */, 57F27FB91197407400C63ACF /* SearchCommand.m in Sources */, - 21C0F59A12C481DD0068693F /* ICUMatcher.m in Sources */, - 21C0F59C12C481DD0068693F /* NSStringICUAdditions.m in Sources */, - 21C0F5D112C48C2E0068693F /* ICUPattern.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1575,6 +1492,7 @@ "$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_4)", "\"$(SRCROOT)/French.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", + "\"$(SRCROOT)\"", ); FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Versions/A/Frameworks\""; FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)\""; @@ -1643,6 +1561,7 @@ "$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_4)", "\"$(SRCROOT)/French.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", + "\"$(SRCROOT)\"", ); FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Versions/A/Frameworks\""; FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)\""; @@ -1702,6 +1621,7 @@ "$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_4)", "\"$(SRCROOT)/French.lproj/RBSplitView(Sno).ibplugin/Contents/Frameworks\"", + "\"$(SRCROOT)\"", ); FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Versions/A/Frameworks\""; FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)\"";