Compare commits

...

25 Commits

Author SHA1 Message Date
Kazuki Sakamoto 2a0760567b MacVim Snapshot 87
Binary targets OS X 10.8(Mountain Lion), 10.9(Mavericks), 10.10(Yosemite), and 10.11(El Capitan)

- Vim patch 7.4.972
- Import QLStephen to quick-look MacVim file types
- Fix redraw and redrawstatus issue

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.5
- Ruby 2.0
2015-12-16 18:50:18 -08:00
Kazuki Sakamoto 2d3163f649 Merge pull request #175 from macvim-dev/fix/redraw_redrawstatus
Do flush in ex_redraw and ex_redrawstatus
2015-12-16 18:35:41 -08:00
Kazuki Sakamoto e7ca3fe789 Do flush in ex_redraw and ex_redrawstatus
Fix #174
2015-12-15 08:58:29 -08:00
Kazuki Sakamoto ddc5c148e8 Merge remote-tracking branch 'vim/master' 2015-12-13 08:44:46 -08:00
Bram Moolenaar a988496706 patch 7.4.972
Problem:    Memory leak when there is an error in setting an option.
Solution:   Free the saved value (Christian Brabandt)
2015-12-13 15:08:56 +01:00
Bram Moolenaar 099fdde0f0 patch 7.4.971
Problem:    The asin() function can't be used.
Solution:   Sort the function table properly. (Watiko)
2015-12-13 14:45:21 +01:00
Kazuki Sakamoto 01672932c6 Merge remote-tracking branch 'vim/master' 2015-12-12 20:57:10 -08:00
Bram Moolenaar 9ec021a2b0 patch 7.4.970
Problem:    Rare crash in getvcol(). (Timo Mihaljov)
Solution:   Check for the buffer being NULL in init_preedit_start_col.
            (Hirohito Higashi, Christian Brabandt)
2015-12-12 16:23:29 +01:00
Kazuki Sakamoto abca1283d2 Merge pull request #172 from macvim-dev/feature/quicklook
Import QLStephen to quick-look MacVim file types
2015-12-12 01:09:56 -08:00
Kazuki Sakamoto 518ae7168a Import QLStephen to quick-look MacVim file types 2015-12-12 01:05:23 -08:00
Kazuki Sakamoto 92dabee8ac MacVim Snapshot 86
Binary targets OS X 10.8(Mountain Lion), 10.9(Mavericks), 10.10(Yosemite), and 10.11(El Capitan)

- Vim patch 7.4.969
- Add MMNoTitleBarWindow and MMUseMouseTime

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.5
- Ruby 2.0
2015-12-11 14:34:30 -08:00
Kazuki Sakamoto 45fa1f955f s/Key// 2015-12-11 14:33:57 -08:00
Kazuki Sakamoto 421df8e160 Merge pull request #171 from macvim-dev/feature/doc_defaults
Add MMNoTitleBarWindowKey and MMUseMouseTime short description
2015-12-11 14:28:46 -08:00
Kazuki Sakamoto 584eb4b164 Add MMNoTitleBarWindowKey and MMUseMouseTime short description 2015-12-11 14:27:50 -08:00
Kazuki Sakamoto f1d0ecd1c8 Merge remote-tracking branch 'vim/master' 2015-12-11 14:15:07 -08:00
Bram Moolenaar 35be4534c0 patch 7.4.969
Problem:    Compiler warnings on Windowx x64 build.
Solution:   Add type casts. (Mike Williams)
2015-12-11 22:38:36 +01:00
Bram Moolenaar b65c749ac5 patch 7.4.968
Problem:    test86 and test87 are flaky in Appveyor.
Solution:   Reduce the count from 8 to 7. (suggested by ZyX)
2015-12-11 20:53:58 +01:00
Bram Moolenaar 6b90351786 patch 7.4.967
Problem:    Cross compilation on MS-windows doesn't work well.
Solution:   Tidy up cross compilation across architectures with Visual Studio.
            (Mike Williams)
2015-12-11 19:38:44 +01:00
Bram Moolenaar 49222bee65 patch 7.4.966
Problem:    Configure doesn't work with a space in a path.
Solution:   Put paths in quotes. (James McCoy, close #525)
2015-12-11 18:11:30 +01:00
Bram Moolenaar 941aea2b97 patch 7.4.965
Problem:    On FreeBSD /dev/fd/ files are special.
Solution:   Use is_dev_fd_file() also for FreeBSD. (Derek Schrock, closes #521)
2015-12-11 17:14:27 +01:00
Bram Moolenaar 91376b6387 patch 7.4.964
Problem:    Test 87 doesn't work in a shadow directory.
Solution:   Handle the extra subdirectory. (James McCoy, closes #515)
2015-12-11 16:17:02 +01:00
Kazuki Sakamoto e387a4c606 Merge pull request #168 from macvim-dev/feature/mousetime
Add MMUseMouseTime, Revise #77
2015-12-09 19:09:53 -08:00
Kazuki Sakamoto cbd8ff0cb4 Add MMUseMouseTime, Revise #77
`MMUseMouseTime` allows to override the time threshold for detecting multiple
mouse down events using Vim `mousetime` option.

    $ defaults write org.vim.MacVim MMUseMouseTime -bool TRUE
2015-12-09 15:02:36 -08:00
Kazuki Sakamoto 11bd9b9b1d Merge pull request #111 from macvim-dev/feature/no_title_bar_window
MMNoTitleBarWindowKey for hiding titlebar
2015-12-08 20:50:53 -08:00
Kazuki Sakamoto fb26de78b0 MMNoTitleBarWindowKey for hiding titlebar 2015-12-07 21:13:47 -08:00
35 changed files with 4199 additions and 53 deletions
+6 -1
View File
@@ -97,8 +97,13 @@ src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.mode1v3
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.pbxuser
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/xcuserdata
src/MacVim/PSMTabBarControl/build
src/MacVim/PSMTabBarControl/build
src/MacVim/qlstephen/QuickLookStephen.xcodeproj/*.mode1
src/MacVim/qlstephen/QuickLookStephen.xcodeproj/*.mode1v3
src/MacVim/qlstephen/QuickLookStephen.xcodeproj/*.pbxuser
src/MacVim/qlstephen/QuickLookStephen.xcodeproj/xcuserdata
src/MacVim/qlstephen/build
src/MacVim/build
src/MacVim/DerivedData
src/TAGS
src/Vim
src/auto/config.cache
+2
View File
@@ -259,6 +259,7 @@ MMDialogsTrackPwd open/save dialogs track the Vim pwd [bool]
MMLoginShellArgument login shell parameter [string]
MMLoginShellCommand which shell to use to launch Vim [string]
MMNoFontSubstitution disable automatic font substitution [bool]
MMNoTitleBarWindow hide title bar [bool]
MMShowAddTabButton enable "add tab" button on tabline [bool]
MMTabMaxWidth maximum width of a tab [int]
MMTabMinWidth minimum width of a tab [int]
@@ -269,6 +270,7 @@ MMTextInsetRight text area offset in pixels [int]
MMTextInsetTop text area offset in pixels [int]
MMTexturedWindow use brushed metal window (Tiger only) [bool]
MMTranslateCtrlClick interpret ctrl-click as right-click [bool]
MMUseMouseTime use mousetime to detect multiple clicks [bool]
MMVerticalSplit files open in vertical splits [bool]
MMZoomBoth zoom button maximizes both directions [bool]
+2
View File
@@ -46,6 +46,8 @@ Dmitry Vazhov\
\
Thank you to {\field{\*\fldinst{HYPERLINK "http://www.positivespinmedia.com"}}{\fldrslt Positive Spin Media}} for the PSMTabBarControl Framework.\
\
Thank you to {\field{\*\fldinst{HYPERLINK "https://whomwah.github.io/qlstephen/"}}{\fldrslt Duncan Robertson}} for the QLStephen QuickLook plugin.\
\
Toolbar icons by {\field{\*\fldinst{HYPERLINK "http://www.mattballdesign.com/"}}{\fldrslt Matt Ball}} (free Developer Icons), {\field{\*\fldinst{HYPERLINK "http://www.jonasraskdesign.com/"}}{\fldrslt Jonas Rask}} (Danish Royalty Free icon set), and {\field{\*\fldinst{HYPERLINK "http://www.everaldo.com"}}{\fldrslt Everaldo Coelho}} (Crystal Project Icons, released under LGPL license).\
\
Revamped MacVim icon by RIC.\
+1 -1
View File
@@ -1256,7 +1256,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>85</string>
<string>87</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
+3 -2
View File
@@ -1844,6 +1844,7 @@ static void netbeansReadCallback(CFSocketRef s,
[NSNumber numberWithBool:mmta], @"p_mmta",
[NSNumber numberWithInt:numTabs], @"numTabs",
[NSNumber numberWithInt:fuoptions_flags], @"fullScreenOptions",
[NSNumber numberWithLong:p_mouset], @"p_mouset",
nil];
// Put the state before all other messages.
@@ -1932,12 +1933,12 @@ static void netbeansReadCallback(CFSocketRef s,
int col = *((int*)bytes); bytes += sizeof(int);
int button = *((int*)bytes); bytes += sizeof(int);
int flags = *((int*)bytes); bytes += sizeof(int);
int count = *((int*)bytes); bytes += sizeof(int);
int repeat = *((int*)bytes); bytes += sizeof(int);
button = eventButtonNumberToVimMouseButton(button);
if (button >= 0) {
flags = eventModifierFlagsToVimMouseModMask(flags);
gui_send_mouse_event(button, col, row, count>1, flags);
gui_send_mouse_event(button, col, row, repeat, flags);
}
} else if (MouseUpMsgID == msgid) {
if (!data) return;
+2
View File
@@ -35,6 +35,8 @@
BOOL interpretKeyEventsSwallowedKey;
NSEvent *currentEvent;
NSMutableDictionary *signImages;
BOOL useMouseTime;
NSDate *mouseDownTime;
// Input Manager
NSRange imRange;
+22 -2
View File
@@ -80,6 +80,11 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
signImages = [[NSMutableDictionary alloc] init];
useMouseTime =
[[NSUserDefaults standardUserDefaults] boolForKey:MMUseMouseTimeKey];
if (useMouseTime)
mouseDownTime = [[NSDate date] retain];
return self;
}
@@ -91,6 +96,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
[markedText release]; markedText = nil;
[markedTextAttributes release]; markedTextAttributes = nil;
[signImages release]; signImages = nil;
[mouseDownTime release]; mouseDownTime = nil;
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
if (asciiImSource) {
@@ -380,7 +386,21 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
int button = [event buttonNumber];
int flags = [event modifierFlags];
int count = [event clickCount];
int repeat = 0;
if (useMouseTime) {
// Use Vim mouseTime option to handle multiple mouse down events
NSDate *now = [[NSDate date] retain];
id mouset = [[[self vimController] vimState] objectForKey:@"p_mouset"];
NSTimeInterval interval =
[now timeIntervalSinceDate:mouseDownTime] * 1000.0;
if (interval < (NSTimeInterval)[mouset longValue])
repeat = 1;
mouseDownTime = now;
} else {
repeat = [event clickCount] > 1;
}
NSMutableData *data = [NSMutableData data];
// If desired, intepret Ctrl-Click as a right mouse click.
@@ -398,7 +418,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
[data appendBytes:&col length:sizeof(int)];
[data appendBytes:&button length:sizeof(int)];
[data appendBytes:&flags length:sizeof(int)];
[data appendBytes:&count length:sizeof(int)];
[data appendBytes:&repeat length:sizeof(int)];
[[self vimController] sendMessage:MouseDownMsgID data:data];
}
+19
View File
@@ -108,6 +108,14 @@ static CGSSetWindowBackgroundBlurRadiusFunction* GetCGSSetWindowBackgroundBlurRa
[super dealloc];
}
- (BOOL) canBecomeMainWindow {
return YES;
}
- (BOOL) canBecomeKeyWindow {
return YES;
}
- (BOOL)hideTablineSeparator:(BOOL)hide
{
BOOL isHidden = [tablineSeparator isHidden];
@@ -227,4 +235,15 @@ static CGSSetWindowBackgroundBlurRadiusFunction* GetCGSSetWindowBackgroundBlurRa
#endif
}
- (void)setToolbar:(NSToolbar *)toolbar
{
if ([[NSUserDefaults standardUserDefaults]
boolForKey:MMNoTitleBarWindowKey]) {
// MacVim can't have toolbar with No title bar setting.
return;
}
[super setToolbar:toolbar];
}
@end // MMWindow
+6
View File
@@ -130,6 +130,12 @@
| NSMiniaturizableWindowMask | NSResizableWindowMask
| NSUnifiedTitleAndToolbarWindowMask;
if ([[NSUserDefaults standardUserDefaults]
boolForKey:MMNoTitleBarWindowKey]) {
// No title bar setting
styleMask &= ~NSTitledWindowMask;
}
// Use textured background on Leopard or later (skip the 'if' on Tiger for
// polished metal window).
if ([[NSUserDefaults standardUserDefaults] boolForKey:MMTexturedWindowKey]
@@ -65,6 +65,7 @@
1DE9B9500D341AB8008FEDD4 /* MMWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DE9B94E0D341AB8008FEDD4 /* MMWindow.m */; };
1DED78600C6DE43D0079945F /* vimrc in Copy Vim Runtime Files */ = {isa = PBXBuildFile; fileRef = 1DED785F0C6DE43D0079945F /* vimrc */; };
1DFE25A50C527BC4003000F7 /* PSMTabBarControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; };
52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */ = {isa = PBXBuildFile; fileRef = 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
@@ -86,6 +87,20 @@
remoteGlobalIDString = 53DF68FC067E5B5A0090B5B0;
remoteInfo = PSMTabBarControlFramework;
};
52818AFE1C1C075300F59085 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 8D576316048677EA00EA77CD;
remoteInfo = QuickLookStephen;
};
52818B001C1C084100F59085 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 8D57630D048677EA00EA77CD;
remoteInfo = QuickLookStephen;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -124,6 +139,17 @@
name = "Copy Vim Runtime Files";
runOnlyForDeploymentPostprocessing = 0;
};
52818B021C1C088000F59085 /* Copy QuickLookPlugin */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = ../Library/QuickLook;
dstSubfolderSpec = 6;
files = (
52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */,
);
name = "Copy QuickLookPlugin";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
@@ -209,6 +235,7 @@
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>"; };
32CA4F630368D1EE00C91783 /* MacVim_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacVim_Prefix.pch; sourceTree = "<group>"; };
52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = QuickLookStephen.xcodeproj; path = qlstephen/QuickLookStephen.xcodeproj; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* MacVim.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MacVim.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@@ -367,6 +394,7 @@
29B97317FDCFA39411CA2CEA /* Resources */,
1DE602460C587F760055263D /* Vim Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
52818AF81C1C073400F59085 /* QuickLook Plugin */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = MacVim;
@@ -406,6 +434,22 @@
name = Frameworks;
sourceTree = "<group>";
};
52818AF81C1C073400F59085 /* QuickLook Plugin */ = {
isa = PBXGroup;
children = (
52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */,
);
name = "QuickLook Plugin";
sourceTree = "<group>";
};
52818AFB1C1C075300F59085 /* Products */ = {
isa = PBXGroup;
children = (
52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -418,6 +462,7 @@
8D11072E0486CEB800E47090 /* Frameworks */,
1D0DCAD80BA3604D00B6CCFA /* Copy Executables */,
1D9EB2840C366D7B0074B739 /* Copy Frameworks */,
52818B021C1C088000F59085 /* Copy QuickLookPlugin */,
1DE608B80C58807F0055263D /* Copy Vim Runtime Files */,
1D1C31F00EFFBFD6003FE9A5 /* Make Document Icons */,
);
@@ -425,6 +470,7 @@
);
dependencies = (
1D493DCD0C5254A400AB718C /* PBXTargetDependency */,
52818B011C1C084100F59085 /* PBXTargetDependency */,
);
name = MacVim;
productInstallPath = "$(HOME)/Applications";
@@ -458,6 +504,10 @@
ProductGroup = 1D493DB40C52533B00AB718C /* Products */;
ProjectRef = 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */;
},
{
ProductGroup = 52818AFB1C1C075300F59085 /* Products */;
ProjectRef = 52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */;
},
);
projectRoot = "";
targets = (
@@ -474,6 +524,13 @@
remoteRef = 1D493DB80C52533B00AB718C /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = QLStephen.qlgenerator;
remoteRef = 52818AFE1C1C075300F59085 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
@@ -574,6 +631,11 @@
name = PSMTabBarControlFramework;
targetProxy = 1D493DCC0C5254A400AB718C /* PBXContainerItemProxy */;
};
52818B011C1C084100F59085 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = QuickLookStephen;
targetProxy = 52818B001C1C084100F59085 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
+2
View File
@@ -37,6 +37,7 @@ extern NSString *MMTranslateCtrlClickKey;
extern NSString *MMTopLeftPointKey;
extern NSString *MMOpenInCurrentWindowKey;
extern NSString *MMNoFontSubstitutionKey;
extern NSString *MMNoTitleBarWindowKey;
extern NSString *MMLoginShellKey;
extern NSString *MMUntitledWindowKey;
extern NSString *MMTexturedWindowKey;
@@ -54,6 +55,7 @@ extern NSString *MMUseInlineImKey;
#endif // INCLUDE_OLD_IM_CODE
extern NSString *MMSuppressTerminationAlertKey;
extern NSString *MMNativeFullScreenKey;
extern NSString *MMUseMouseTimeKey;
// Enum for MMUntitledWindowKey
+2
View File
@@ -29,6 +29,7 @@ NSString *MMTranslateCtrlClickKey = @"MMTranslateCtrlClick";
NSString *MMTopLeftPointKey = @"MMTopLeftPoint";
NSString *MMOpenInCurrentWindowKey = @"MMOpenInCurrentWindow";
NSString *MMNoFontSubstitutionKey = @"MMNoFontSubstitution";
NSString *MMNoTitleBarWindowKey = @"MMNoTitleBarWindow";
NSString *MMLoginShellKey = @"MMLoginShell";
NSString *MMUntitledWindowKey = @"MMUntitledWindow";
NSString *MMTexturedWindowKey = @"MMTexturedWindow";
@@ -46,6 +47,7 @@ NSString *MMUseInlineImKey = @"MMUseInlineIm";
#endif // INCLUDE_OLD_IM_CODE
NSString *MMSuppressTerminationAlertKey = @"MMSuppressTerminationAlert";
NSString *MMNativeFullScreenKey = @"MMNativeFullScreen";
NSString *MMUseMouseTimeKey = @"MMUseMouseTime";
Binary file not shown.
@@ -0,0 +1,55 @@
#include <CoreFoundation/CoreFoundation.h>
#include <CoreServices/CoreServices.h>
#include <QuickLook/QuickLook.h>
#import <Foundation/Foundation.h>
#import "QLSFileAttributes.h"
// Generate a preview for the document with the given url
OSStatus GeneratePreviewForURL(void *thisInterface,
QLPreviewRequestRef request,
CFURLRef url,
CFStringRef contentTypeUTI,
CFDictionaryRef options) {
@autoreleasepool {
if (QLPreviewRequestIsCancelled(request))
return noErr;
QLSFileAttributes *magicAttributes =
[QLSFileAttributes attributesForItemAtURL:(__bridge NSURL *)url];
if (!magicAttributes) {
NSLog(@"QLStephen: Could not determine attribtues of file %@", url);
return noErr;
}
if (!magicAttributes.isTextFile) {
return noErr;
}
if (magicAttributes.fileEncoding == kCFStringEncodingInvalidId) {
NSLog(@"QLStephen: Could not determine encoding of file %@", url);
return noErr;
}
NSDictionary *previewProperties = @{
(NSString *)kQLPreviewPropertyStringEncodingKey : @( magicAttributes.fileEncoding ),
(NSString *)kQLPreviewPropertyWidthKey : @700,
(NSString *)kQLPreviewPropertyHeightKey : @800
};
QLPreviewRequestSetURLRepresentation(
request,
url,
kUTTypePlainText,
(__bridge CFDictionaryRef)previewProperties);
return noErr;
}
}
void CancelPreviewGeneration(void* thisInterface, QLPreviewRequestRef preview) {
// implement only if supported
}
@@ -0,0 +1,164 @@
#include <CoreFoundation/CoreFoundation.h>
#include <CoreServices/CoreServices.h>
#include <QuickLook/QuickLook.h>
#import <Foundation/Foundation.h>
#import "RegexKitLite.h"
#import "QLSFileAttributes.h"
/**
* This dictionary is used for a file with no extension. It maps the MIME type
* (as returned by file(1)) onto an appropriate thumbnail badge.
*/
static NSDictionary *mimeTypeToBadgeMap() {
return @{
@"application/xml": @"xml",
@"text/x-c" : @"C",
@"text/x-c++" : @"C++",
@"text/x-shellscript" : @"shell",
@"text/x-php" : @"php",
@"text/x-python" : @"python",
@"text/x-perl" : @"perl",
@"text/x-ruby" : @"ruby"
};
}
/**
* Some formats, e.g. Makefiles, have well-known names and no extension.
*/
static NSDictionary *filenameRegexToBadgeMap() {
return @{
@"Makefile" : @"make"
};
}
/**
* @return the string that should be used to badge the thumbnail.
*/
static NSString *ThumbnailBadgeForItemWithAttributes(
QLSFileAttributes *attributes) {
NSString *fileExtension = attributes.url.pathExtension;
NSString *fileName = attributes.url.lastPathComponent;
__block NSString *badge;
// Do we have a file extension? If so, use it as a badge if it's not too
// long.
if (![fileExtension isEqualToString:@""]) {
badge = fileExtension;
// Is the file extension too long to be reasonably displayed in a
// thumbnail? If so, fall back on the additional tests.
// FIXME: use some better test to determine an appropriate length.
// FIXME: perhaps we should truncate the extension (at the end? in the
// middle?) to fit as much in the thumbnail as possible.
if (badge.length >= 10)
badge = nil;
}
// Do we have a well-known MIME type? Note that we only do this test if we
// have no file extension. file(1) might wrongly guess the MIME type, and it
// would be annoying if the file extension were to say one thing and the
// badge another.
if (!badge && [fileExtension isEqualToString:@""]) {
NSDictionary *map = mimeTypeToBadgeMap();
badge = map[attributes.mimeType];
}
// Does the filename match a known pattern? If so, use the appropriate badge.
if (!badge && [fileExtension isEqualToString:@""]) {
NSDictionary *map = filenameRegexToBadgeMap();
[map enumerateKeysAndObjectsUsingBlock:
^(NSString *regex, NSString *candidateBadge, BOOL *stop) {
if ([fileName rkl_isMatchedByRegex:regex]) {
badge = candidateBadge;
*stop = true;
}
}];
}
// Do we have an executable text file? If so, assume it's a script of some
// sort.
if (!badge) {
NSFileManager *fm = [NSFileManager new];
BOOL isExecutable = [fm isExecutableFileAtPath:attributes.url.path];
if (isExecutable)
badge = @"script";
}
// No other tests passed? Just badge it with "txt". I would use "text",
// except that the OS X text QuickLook generator uses "txt", and we ought
// to be consistent with it.
if (!badge) {
badge = @"txt";
}
return [badge uppercaseString];
}
/* -----------------------------------------------------------------------------
Generate a thumbnail for file
This function's job is to create thumbnail for designated file as fast as
possible
-------------------------------------------------------------------------- */
OSStatus GenerateThumbnailForURL(void *thisInterface,
QLThumbnailRequestRef request,
CFURLRef url,
CFStringRef contentTypeUTI,
CFDictionaryRef options,
CGSize maxSize) {
@autoreleasepool {
if (QLThumbnailRequestIsCancelled(request))
return noErr;
QLSFileAttributes *magicAttributes
= [QLSFileAttributes attributesForItemAtURL:(__bridge NSURL *)url];
if (!magicAttributes) {
NSLog(@"QLStephen: Could not determine attribtues of file %@", url);
return noErr;
}
if (!magicAttributes.isTextFile) {
// NSLog(@"QLStephen: I don't think %@ is a text file", url);
return noErr;
}
if (magicAttributes.fileEncoding == kCFStringEncodingInvalidId) {
NSLog(@"QLStephen: Could not determine encoding of file %@", url);
return noErr;
}
NSDictionary *previewProperties = @{
(NSString *)kQLPreviewPropertyStringEncodingKey : @( magicAttributes.fileEncoding )
};
NSString *badge = ThumbnailBadgeForItemWithAttributes(magicAttributes);
NSDictionary *properties = @{
(NSString *)kQLThumbnailPropertyExtensionKey : badge
};
QLThumbnailRequestSetThumbnailWithURLRepresentation(
request,
url,
kUTTypePlainText,
(__bridge CFDictionaryRef)previewProperties,
(__bridge CFDictionaryRef)properties);
return noErr;
}
}
void CancelThumbnailGeneration(void* thisInterface,
QLThumbnailRequestRef thumbnail) {
// implement only if supported
}
+69
View File
@@ -0,0 +1,69 @@
<?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>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>PlainText</string>
<key>CFBundleTypeRole</key>
<string>QLGenerator</string>
<key>LSItemContentTypes</key>
<array>
<string>public.data</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>XML</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>QLStephen</string>
<key>CFBundleShortVersionString</key>
<string>1.4</string>
<key>CFBundleVersion</key>
<string>1.4.2</string>
<key>CFPlugInDynamicRegisterFunction</key>
<string></string>
<key>CFPlugInDynamicRegistration</key>
<string>NO</string>
<key>CFPlugInFactories</key>
<dict>
<key>0CCF41BD-5E94-487C-B19D-FAADBD387609</key>
<string>QuickLookGeneratorPluginFactory</string>
</dict>
<key>CFPlugInTypes</key>
<dict>
<key>5E2D9680-5022-40FA-B806-43349622E5B9</key>
<array>
<string>0CCF41BD-5E94-487C-B19D-FAADBD387609</string>
</array>
</dict>
<key>CFPlugInUnloadFunction</key>
<string></string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2013 Duncan Robertson. All rights reserved.</string>
<key>QLNeedsToBeRunInMainThread</key>
<true/>
<key>QLPreviewHeight</key>
<real>600</real>
<key>QLPreviewWidth</key>
<real>800</real>
<key>QLSupportsConcurrentRequests</key>
<true/>
<key>QLThumbnailMinimumSize</key>
<real>17</real>
</dict>
</plist>
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Duncan Robertson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+21
View File
@@ -0,0 +1,21 @@
//
// QLSMagicFileAttributes.h
// QuickLookStephen
//
// Created by Nick Hutchinson on 31/07/12.
#import <Foundation/Foundation.h>
@interface QLSFileAttributes : NSObject
+ (instancetype)attributesForItemAtURL:(NSURL *)aURL;
@property (readonly) NSURL *url;
@property (readonly) BOOL isTextFile;
@property (readonly) NSString *mimeType;
@property (readonly) CFStringEncoding fileEncoding;
@end
+119
View File
@@ -0,0 +1,119 @@
//
// QLSMagicFileAttributes.m
// QuickLookStephen
//
// Created by Nick Hutchinson on 31/07/12.
//
#import "QLSFileAttributes.h"
#import "RegexKitLite.h"
@interface QLSFileAttributes ()
@property (readwrite) BOOL isTextFile;
@property (readwrite) NSString *mimeType;
@property (readwrite) CFStringEncoding fileEncoding;
@property (readwrite) NSURL *url;
@end
@implementation QLSFileAttributes
+ (instancetype)attributesForItemAtURL:(NSURL *)aURL
{
NSString *magicString = [self magicStringForItemAtURL:aURL];
if (!magicString) return nil;
NSArray *matches = [magicString rkl_captureComponentsMatchedByRegex:
@"(\\S+/\\S+); charset=(\\S+)"];
if (![matches count]) return nil;
NSString *mimeType = matches[1];
NSString *charset = matches[2];
BOOL mimeTypeIsTextual = [self mimeTypeIsTextual:mimeType];
CFStringEncoding encoding =
CFStringConvertIANACharSetNameToEncoding((CFStringRef)charset);
QLSFileAttributes *attributes = [QLSFileAttributes new];
attributes.fileEncoding = encoding;
attributes.isTextFile = mimeTypeIsTextual;
attributes.mimeType = mimeType;
attributes.url = aURL;
return attributes;
}
////////////////////////////////////////////////////////////////////////////////
// Private Methods
////////////////////////////////////////////////////////////////////////////////
+ (NSString *)magicStringForItemAtURL:(NSURL *)aURL
{
NSString *path = [aURL path];
NSParameterAssert(path);
NSMutableDictionary *environment =
[NSProcessInfo.processInfo.environment mutableCopy];
environment[@"LC_ALL"] = @"en_US.UTF-8";
NSTask *task = [NSTask new];
task.launchPath = @"/usr/bin/file";
task.arguments = @[@"--mime", @"--brief", path];
task.environment = environment;
task.standardOutput = [NSPipe new];
[task launch];
NSData *output =
[[task.standardOutput fileHandleForReading] readDataToEndOfFile];
[task waitUntilExit];
if (task.terminationReason != NSTaskTerminationReasonExit
|| task.terminationStatus != 0) {
return nil;
}
NSCharacterSet *whitespaceCharset =
[NSCharacterSet whitespaceAndNewlineCharacterSet];
NSString *stringOutput =
[[NSString alloc] initWithData:output encoding:NSUTF8StringEncoding];
stringOutput =
[stringOutput stringByTrimmingCharactersInSet:whitespaceCharset];
return stringOutput;
}
/**
* @return YES if mimeType contains "text", or if the mime type conforms to the
* public.text UTI.
*/
+ (BOOL)mimeTypeIsTextual:(NSString *)mimeType
{
NSArray *components = [mimeType componentsSeparatedByString:@"/"];
if (components.count != 2)
return NO;
if ([components[0] rangeOfString:@"text"].location != NSNotFound)
return YES;
NSString *UTType =
CFBridgingRelease(UTTypeCreatePreferredIdentifierForTag(
kUTTagClassMIMEType,
(__bridge CFStringRef)mimeType,
kUTTypeData));
if (UTTypeConformsTo((__bridge CFStringRef)UTType, kUTTypeText)) {
return YES;
}
return NO;
}
@end
@@ -0,0 +1,297 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
0107ABFF15C76F2900C65F1A /* QLSFileAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = 0107ABFD15C76F2900C65F1A /* QLSFileAttributes.m */; };
0149EB3B15F2E8E4003AB298 /* RegexKitLite.m in Sources */ = {isa = PBXBuildFile; fileRef = 0149EB3915F2E8E4003AB298 /* RegexKitLite.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
0149EB3E15F2E9A3003AB298 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0149EB3D15F2E9A3003AB298 /* libicucore.dylib */; };
2C05A19C06CAA52B00D84F6F /* GeneratePreviewForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C05A19B06CAA52B00D84F6F /* GeneratePreviewForURL.m */; };
61E3BCFB0870B4F2002186A0 /* GenerateThumbnailForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 61E3BCFA0870B4F2002186A0 /* GenerateThumbnailForURL.m */; };
8D576312048677EA00EA77CD /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 08FB77B6FE84183AC02AAC07 /* main.c */; settings = {ATTRIBUTES = (); }; };
8D576314048677EA00EA77CD /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */; };
8D5B49A804867FD3000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8D5B49A704867FD3000E48DA /* InfoPlist.strings */; };
AE02F6EB0EDDFA6400CBA17D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE02F6EA0EDDFA6400CBA17D /* Cocoa.framework */; };
C86B05270671AA6E00DD9006 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C86B05260671AA6E00DD9006 /* CoreServices.framework */; };
F28CFBFD0A3EC0AF000ABFF5 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F28CFBFC0A3EC0AF000ABFF5 /* ApplicationServices.framework */; };
F28CFC030A3EC0C6000ABFF5 /* QuickLook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F28CFC020A3EC0C6000ABFF5 /* QuickLook.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
0107ABFC15C76F2900C65F1A /* QLSFileAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QLSFileAttributes.h; sourceTree = "<group>"; };
0107ABFD15C76F2900C65F1A /* QLSFileAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QLSFileAttributes.m; sourceTree = "<group>"; };
0149EB3815F2E8E4003AB298 /* RegexKitLite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegexKitLite.h; sourceTree = "<group>"; };
0149EB3915F2E8E4003AB298 /* RegexKitLite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegexKitLite.m; sourceTree = "<group>"; };
0149EB3D15F2E9A3003AB298 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; };
089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
08FB77B6FE84183AC02AAC07 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
2C05A19B06CAA52B00D84F6F /* GeneratePreviewForURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratePreviewForURL.m; sourceTree = "<group>"; usesTabs = 0; };
61E3BCFA0870B4F2002186A0 /* GenerateThumbnailForURL.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = GenerateThumbnailForURL.m; sourceTree = "<group>"; };
8D576316048677EA00EA77CD /* QLStephen.qlgenerator */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = QLStephen.qlgenerator; sourceTree = BUILT_PRODUCTS_DIR; };
8D576317048677EA00EA77CD /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
AE02F6EA0EDDFA6400CBA17D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
C86B05260671AA6E00DD9006 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
F28CFBFC0A3EC0AF000ABFF5 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
F28CFC020A3EC0C6000ABFF5 /* QuickLook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickLook.framework; path = /System/Library/Frameworks/QuickLook.framework; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8D576313048677EA00EA77CD /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0149EB3E15F2E9A3003AB298 /* libicucore.dylib in Frameworks */,
8D576314048677EA00EA77CD /* CoreFoundation.framework in Frameworks */,
C86B05270671AA6E00DD9006 /* CoreServices.framework in Frameworks */,
F28CFBFD0A3EC0AF000ABFF5 /* ApplicationServices.framework in Frameworks */,
F28CFC030A3EC0C6000ABFF5 /* QuickLook.framework in Frameworks */,
AE02F6EB0EDDFA6400CBA17D /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
0149EB3F15F2EC37003AB298 /* Third-Party */ = {
isa = PBXGroup;
children = (
0149EB3815F2E8E4003AB298 /* RegexKitLite.h */,
0149EB3915F2E8E4003AB298 /* RegexKitLite.m */,
);
name = "Third-Party";
sourceTree = "<group>";
};
089C166AFE841209C02AAC07 /* QuickLookStephen */ = {
isa = PBXGroup;
children = (
0149EB3F15F2EC37003AB298 /* Third-Party */,
08FB77AFFE84173DC02AAC07 /* Source */,
089C167CFE841241C02AAC07 /* Resources */,
089C1671FE841209C02AAC07 /* External Frameworks and Libraries */,
19C28FB6FE9D52B211CA2CBB /* Products */,
);
name = QuickLookStephen;
sourceTree = "<group>";
};
089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
0149EB3D15F2E9A3003AB298 /* libicucore.dylib */,
AE02F6EA0EDDFA6400CBA17D /* Cocoa.framework */,
F28CFC020A3EC0C6000ABFF5 /* QuickLook.framework */,
F28CFBFC0A3EC0AF000ABFF5 /* ApplicationServices.framework */,
C86B05260671AA6E00DD9006 /* CoreServices.framework */,
0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */,
);
name = "External Frameworks and Libraries";
sourceTree = "<group>";
};
089C167CFE841241C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
8D576317048677EA00EA77CD /* Info.plist */,
8D5B49A704867FD3000E48DA /* InfoPlist.strings */,
);
name = Resources;
sourceTree = "<group>";
};
08FB77AFFE84173DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
61E3BCFA0870B4F2002186A0 /* GenerateThumbnailForURL.m */,
2C05A19B06CAA52B00D84F6F /* GeneratePreviewForURL.m */,
08FB77B6FE84183AC02AAC07 /* main.c */,
0107ABFC15C76F2900C65F1A /* QLSFileAttributes.h */,
0107ABFD15C76F2900C65F1A /* QLSFileAttributes.m */,
);
name = Source;
sourceTree = "<group>";
};
19C28FB6FE9D52B211CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8D576316048677EA00EA77CD /* QLStephen.qlgenerator */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D57630D048677EA00EA77CD /* QuickLookStephen */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2CA3261E0896AD4900168862 /* Build configuration list for PBXNativeTarget "QuickLookStephen" */;
buildPhases = (
8D57630F048677EA00EA77CD /* Resources */,
8D576311048677EA00EA77CD /* Sources */,
8D576313048677EA00EA77CD /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = QuickLookStephen;
productName = QuickLookStephen;
productReference = 8D576316048677EA00EA77CD /* QLStephen.qlgenerator */;
productType = "com.apple.product-type.bundle";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
089C1669FE841209C02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0720;
};
buildConfigurationList = 2CA326220896AD4900168862 /* Build configuration list for PBXProject "QuickLookStephen" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 089C166AFE841209C02AAC07 /* QuickLookStephen */;
projectDirPath = "";
projectRoot = "";
targets = (
8D57630D048677EA00EA77CD /* QuickLookStephen */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8D57630F048677EA00EA77CD /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D5B49A804867FD3000E48DA /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8D576311048677EA00EA77CD /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D576312048677EA00EA77CD /* main.c in Sources */,
2C05A19C06CAA52B00D84F6F /* GeneratePreviewForURL.m in Sources */,
61E3BCFB0870B4F2002186A0 /* GenerateThumbnailForURL.m in Sources */,
0107ABFF15C76F2900C65F1A /* QLSFileAttributes.m in Sources */,
0149EB3B15F2E8E4003AB298 /* RegexKitLite.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
8D5B49A704867FD3000E48DA /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
089C167EFE841241C02AAC07 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
2CA3261F0896AD4900168862 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.whomwah.quicklookstephen;
PRODUCT_NAME = QLStephen;
WRAPPER_EXTENSION = qlgenerator;
};
name = Debug;
};
2CA326200896AD4900168862 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.whomwah.quicklookstephen;
PRODUCT_NAME = QLStephen;
WRAPPER_EXTENSION = qlgenerator;
};
name = Release;
};
2CA326230896AD4900168862 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_PREPROCESSOR_DEFINITIONS = "RKL_PREPEND_TO_METHODS=rkl_";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
WARNING_CFLAGS = (
"-Wextra",
"-Wall",
"-Wno-unused-parameter",
);
};
name = Debug;
};
2CA326240896AD4900168862 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_C_LANGUAGE_STANDARD = c99;
GCC_PREPROCESSOR_DEFINITIONS = "RKL_PREPEND_TO_METHODS=rkl_";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
SDKROOT = macosx;
WARNING_CFLAGS = (
"-Wextra",
"-Wall",
"-Wno-unused-parameter",
);
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
2CA3261E0896AD4900168862 /* Build configuration list for PBXNativeTarget "QuickLookStephen" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2CA3261F0896AD4900168862 /* Debug */,
2CA326200896AD4900168862 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2CA326220896AD4900168862 /* Build configuration list for PBXProject "QuickLookStephen" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2CA326230896AD4900168862 /* Debug */,
2CA326240896AD4900168862 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 089C1669FE841209C02AAC07 /* Project object */;
}
+72
View File
@@ -0,0 +1,72 @@
## !! UPDATE !!
Hi all. I'm afriad I don't have time to maintain this project any more. I see the issues mounting but I don't have time to answer them. This was a pet project some time ago and I still use the plugin daily and it works just fine for me in it's current form. If anyone would like to step forward and be added a contributor to move it forward, please send me a message.
Duncan
## Reinforcement have arrived :-)
I have volunteered to bring Duncan's excellent QL plugin a bit more up to date. Don't expect to much though. I will focus on backlogged pull requests to begin with.
Tomas
# QuicklookStephen
QLStephen is a QuickLook plugin that lets you view plain text files without a file extension. Files like:
README
INSTALL
Capfile
CHANGELOG
etc...
## Installation
### Pre-compiled
* [Download the latest version of QuickLookStephen](https://github.com/whomwah/qlstephen/releases)
* Unzip
* Copy the file into `/Library/QuickLook` or `~/Library/QuickLook`
(You can create the `QuickLook` folder if it doesnt exist)
### Manually Compiled
Compliling the project yourself? Just copy the generated `QLStephen.qlgenerator`
file into the relevant `QuickLook` folder (as above).
## Trouble?
If youve installed the plugin, but dont see any changes:
- Make sure you are editing (a) the correct plist of (b) the correct bundle.
(For example, you might have two `QLStephen` plugins. Its possible the plugin in
another directory—perhaps `/Library/QuickLook/`—is what is being read.)
- Run `qlmanage -r` in the Terminal. (This will restart QuickLook, which reloads all plugins.)
## Why “QLStephen”?
Because I was listening to [Adam and Joe](http://www.bbc.co.uk/blogs/adamandjoe/2009/06/test-1.shtml) when I first wrote it.
## Authors
**Original author:** Duncan Robertson
Special thanks to the following people for submitting patches over the years:
* [Guillermo Ignacio Enriquez Gutierrez](https://github.com/nacho4d)
* [Rob Lourens](https://github.com/roblourens)
* [Avi Flax](https://github.com/aviflax)
* [Tony](https://github.com/Zearin)
* [Nicholas Hutchinson](https://github.com/nickhutchinson)
## Contributing
* Fork the project
* Send a pull request
* Dont change the build number (Ill do that when I release a new version)
+295
View File
@@ -0,0 +1,295 @@
//
// RegexKitLite.h
// http://regexkit.sourceforge.net/
// Licensed under the terms of the BSD License, as specified below.
//
/*
Copyright (c) 2008-2010, John Engelhart
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 Zang Industries 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 HOLDERS 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 COPYRIGHT
OWNER OR 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.
*/
#ifdef __OBJC__
#import <Foundation/NSArray.h>
#import <Foundation/NSError.h>
#import <Foundation/NSObjCRuntime.h>
#import <Foundation/NSRange.h>
#import <Foundation/NSString.h>
#endif // __OBJC__
#include <limits.h>
#include <stdint.h>
#include <sys/types.h>
#include <TargetConditionals.h>
#include <AvailabilityMacros.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef REGEXKITLITE_VERSION_DEFINED
#define REGEXKITLITE_VERSION_DEFINED
#define _RKL__STRINGIFY(b) #b
#define _RKL_STRINGIFY(a) _RKL__STRINGIFY(a)
#define _RKL_JOIN_VERSION(a,b) _RKL_STRINGIFY(a##.##b)
#define _RKL_VERSION_STRING(a,b) _RKL_JOIN_VERSION(a,b)
#define REGEXKITLITE_VERSION_MAJOR 4
#define REGEXKITLITE_VERSION_MINOR 0
#define REGEXKITLITE_VERSION_CSTRING _RKL_VERSION_STRING(REGEXKITLITE_VERSION_MAJOR, REGEXKITLITE_VERSION_MINOR)
#define REGEXKITLITE_VERSION_NSSTRING @REGEXKITLITE_VERSION_CSTRING
#endif // REGEXKITLITE_VERSION_DEFINED
#if !defined(RKL_BLOCKS) && defined(NS_BLOCKS_AVAILABLE) && (NS_BLOCKS_AVAILABLE == 1)
#define RKL_BLOCKS 1
#endif
#if defined(RKL_BLOCKS) && (RKL_BLOCKS == 1)
#define _RKL_BLOCKS_ENABLED 1
#endif // defined(RKL_BLOCKS) && (RKL_BLOCKS == 1)
#if defined(_RKL_BLOCKS_ENABLED) && !defined(__BLOCKS__)
#warning RegexKitLite support for Blocks is enabled, but __BLOCKS__ is not defined. This compiler may not support Blocks, in which case the behavior is undefined. This will probably cause numerous compiler errors.
#endif // defined(_RKL_BLOCKS_ENABLED) && !defined(__BLOCKS__)
// For Mac OS X < 10.5.
#ifndef NSINTEGER_DEFINED
#define NSINTEGER_DEFINED
#if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
typedef long NSInteger;
typedef unsigned long NSUInteger;
#define NSIntegerMin LONG_MIN
#define NSIntegerMax LONG_MAX
#define NSUIntegerMax ULONG_MAX
#else // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
typedef int NSInteger;
typedef unsigned int NSUInteger;
#define NSIntegerMin INT_MIN
#define NSIntegerMax INT_MAX
#define NSUIntegerMax UINT_MAX
#endif // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
#endif // NSINTEGER_DEFINED
#ifndef RKLREGEXOPTIONS_DEFINED
#define RKLREGEXOPTIONS_DEFINED
// These must be identical to their ICU regex counterparts. See http://www.icu-project.org/userguide/regexp.html
enum {
RKLNoOptions = 0,
RKLCaseless = 2,
RKLComments = 4,
RKLDotAll = 32,
RKLMultiline = 8,
RKLUnicodeWordBoundaries = 256
};
typedef uint32_t RKLRegexOptions; // This must be identical to the ICU 'flags' argument type.
#endif // RKLREGEXOPTIONS_DEFINED
#ifndef RKLREGEXENUMERATIONOPTIONS_DEFINED
#define RKLREGEXENUMERATIONOPTIONS_DEFINED
enum {
RKLRegexEnumerationNoOptions = 0UL,
RKLRegexEnumerationCapturedStringsNotRequired = 1UL << 9,
RKLRegexEnumerationReleaseStringReturnedByReplacementBlock = 1UL << 10,
RKLRegexEnumerationFastCapturedStringsXXX = 1UL << 11,
};
typedef NSUInteger RKLRegexEnumerationOptions;
#endif // RKLREGEXENUMERATIONOPTIONS_DEFINED
#ifndef _REGEXKITLITE_H_
#define _REGEXKITLITE_H_
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465)
#define RKL_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
#else
#define RKL_DEPRECATED_ATTRIBUTE
#endif
#if defined(NS_REQUIRES_NIL_TERMINATION)
#define RKL_REQUIRES_NIL_TERMINATION NS_REQUIRES_NIL_TERMINATION
#else // defined(NS_REQUIRES_NIL_TERMINATION)
#define RKL_REQUIRES_NIL_TERMINATION
#endif // defined(NS_REQUIRES_NIL_TERMINATION)
// This requires a few levels of rewriting to get the desired results.
#define _RKL_CONCAT_2(c,d) c ## d
#define _RKL_CONCAT(a,b) _RKL_CONCAT_2(a,b)
#ifdef RKL_PREPEND_TO_METHODS
#define RKL_METHOD_PREPEND(x) _RKL_CONCAT(RKL_PREPEND_TO_METHODS, x)
#else // RKL_PREPEND_TO_METHODS
#define RKL_METHOD_PREPEND(x) x
#endif // RKL_PREPEND_TO_METHODS
// If it looks like low memory notifications might be available, add code to register and respond to them.
// This is (should be) harmless if it turns out that this isn't the case, since the notification that we register for,
// UIApplicationDidReceiveMemoryWarningNotification, is dynamically looked up via dlsym().
#if ((defined(TARGET_OS_EMBEDDED) && (TARGET_OS_EMBEDDED != 0)) || (defined(TARGET_OS_IPHONE) && (TARGET_OS_IPHONE != 0))) && (!defined(RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS) || (RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS != 0))
#define RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS 1
#endif
#ifdef __OBJC__
// NSException exception name.
extern NSString * const RKLICURegexException;
// NSError error domains and user info keys.
extern NSString * const RKLICURegexErrorDomain;
extern NSString * const RKLICURegexEnumerationOptionsErrorKey;
extern NSString * const RKLICURegexErrorCodeErrorKey;
extern NSString * const RKLICURegexErrorNameErrorKey;
extern NSString * const RKLICURegexLineErrorKey;
extern NSString * const RKLICURegexOffsetErrorKey;
extern NSString * const RKLICURegexPreContextErrorKey;
extern NSString * const RKLICURegexPostContextErrorKey;
extern NSString * const RKLICURegexRegexErrorKey;
extern NSString * const RKLICURegexRegexOptionsErrorKey;
extern NSString * const RKLICURegexReplacedCountErrorKey;
extern NSString * const RKLICURegexReplacedStringErrorKey;
extern NSString * const RKLICURegexReplacementStringErrorKey;
extern NSString * const RKLICURegexSubjectRangeErrorKey;
extern NSString * const RKLICURegexSubjectStringErrorKey;
@interface NSString (RegexKitLiteAdditions)
+ (void)RKL_METHOD_PREPEND(clearStringCache);
// Although these are marked as deprecated, a bug in GCC prevents a warning from being issues for + class methods. Filed bug with Apple, #6736857.
+ (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex RKL_DEPRECATED_ATTRIBUTE;
+ (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex options:(RKLRegexOptions)options error:(NSError **)error RKL_DEPRECATED_ATTRIBUTE;
- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex;
- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex range:(NSRange)range;
- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error;
- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex;
- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex inRange:(NSRange)range;
- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error;
- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex;
- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex capture:(NSInteger)capture;
- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex inRange:(NSRange)range;
- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error;
- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex;
- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex capture:(NSInteger)capture;
- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex inRange:(NSRange)range;
- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error;
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement;
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange;
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error;
//// >= 3.0
- (NSInteger)RKL_METHOD_PREPEND(captureCount);
- (NSInteger)RKL_METHOD_PREPEND(captureCountWithOptions):(RKLRegexOptions)options error:(NSError **)error;
- (BOOL)RKL_METHOD_PREPEND(isRegexValid);
- (BOOL)RKL_METHOD_PREPEND(isRegexValidWithOptions):(RKLRegexOptions)options error:(NSError **)error;
- (void)RKL_METHOD_PREPEND(flushCachedRegexData);
- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex;
- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex capture:(NSInteger)capture;
- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex range:(NSRange)range;
- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range capture:(NSInteger)capture error:(NSError **)error;
- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex;
- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range;
- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error;
//// >= 4.0
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList;
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count;
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList;
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count;
#ifdef _RKL_BLOCKS_ENABLED
- (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
- (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
- (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
- (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
#endif // _RKL_BLOCKS_ENABLED
@end
@interface NSMutableString (RegexKitLiteAdditions)
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement;
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange;
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error;
//// >= 4.0
#ifdef _RKL_BLOCKS_ENABLED
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
#endif // _RKL_BLOCKS_ENABLED
@end
#endif // __OBJC__
#endif // _REGEXKITLITE_H_
#ifdef __cplusplus
} // extern "C"
#endif
File diff suppressed because it is too large Load Diff
+218
View File
@@ -0,0 +1,218 @@
//==============================================================================
//
// DO NO MODIFY THE CONTENT OF THIS FILE
//
// This file contains the generic CFPlug-in code necessary for your generator
// To complete your generator implement the function in GenerateThumbnailForURL/GeneratePreviewForURL.c
//
//==============================================================================
#include <CoreFoundation/CoreFoundation.h>
#include <CoreFoundation/CFPlugInCOM.h>
#include <CoreServices/CoreServices.h>
#include <QuickLook/QuickLook.h>
// -----------------------------------------------------------------------------
// constants
// -----------------------------------------------------------------------------
// Don't modify this line
#define PLUGIN_ID "0CCF41BD-5E94-487C-B19D-FAADBD387609"
//
// Below is the generic glue code for all plug-ins.
//
// You should not have to modify this code aside from changing
// names if you decide to change the names defined in the Info.plist
//
// -----------------------------------------------------------------------------
// typedefs
// -----------------------------------------------------------------------------
// The thumbnail generation function to be implemented in GenerateThumbnailForURL.c
OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thumbnail, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options, CGSize maxSize);
void CancelThumbnailGeneration(void* thisInterface, QLThumbnailRequestRef thumbnail);
// The preview generation function to be implemented in GeneratePreviewForURL.c
OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options);
void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview);
// The layout for an instance of QuickLookGeneratorPlugIn
typedef struct __QuickLookGeneratorPluginType
{
void *conduitInterface;
CFUUIDRef factoryID;
UInt32 refCount;
} QuickLookGeneratorPluginType;
// -----------------------------------------------------------------------------
// prototypes
// -----------------------------------------------------------------------------
// Forward declaration for the IUnknown implementation.
//
QuickLookGeneratorPluginType *AllocQuickLookGeneratorPluginType(CFUUIDRef inFactoryID);
void DeallocQuickLookGeneratorPluginType(QuickLookGeneratorPluginType *thisInstance);
HRESULT QuickLookGeneratorQueryInterface(void *thisInstance,REFIID iid,LPVOID *ppv);
void *QuickLookGeneratorPluginFactory(CFAllocatorRef allocator,CFUUIDRef typeID);
ULONG QuickLookGeneratorPluginAddRef(void *thisInstance);
ULONG QuickLookGeneratorPluginRelease(void *thisInstance);
// -----------------------------------------------------------------------------
// myInterfaceFtbl definition
// -----------------------------------------------------------------------------
// The QLGeneratorInterfaceStruct function table.
//
static QLGeneratorInterfaceStruct myInterfaceFtbl = {
NULL,
QuickLookGeneratorQueryInterface,
QuickLookGeneratorPluginAddRef,
QuickLookGeneratorPluginRelease,
NULL,
NULL,
NULL,
NULL
};
// -----------------------------------------------------------------------------
// AllocQuickLookGeneratorPluginType
// -----------------------------------------------------------------------------
// Utility function that allocates a new instance.
// You can do some initial setup for the generator here if you wish
// like allocating globals etc...
//
QuickLookGeneratorPluginType *AllocQuickLookGeneratorPluginType(CFUUIDRef inFactoryID)
{
QuickLookGeneratorPluginType *theNewInstance;
theNewInstance = (QuickLookGeneratorPluginType *)malloc(sizeof(QuickLookGeneratorPluginType));
memset(theNewInstance,0,sizeof(QuickLookGeneratorPluginType));
/* Point to the function table Malloc enough to store the stuff and copy the filler from myInterfaceFtbl over */
theNewInstance->conduitInterface = malloc(sizeof(QLGeneratorInterfaceStruct));
memcpy(theNewInstance->conduitInterface,&myInterfaceFtbl,sizeof(QLGeneratorInterfaceStruct));
/* Retain and keep an open instance refcount for each factory. */
theNewInstance->factoryID = CFRetain(inFactoryID);
CFPlugInAddInstanceForFactory(inFactoryID);
/* This function returns the IUnknown interface so set the refCount to one. */
theNewInstance->refCount = 1;
return theNewInstance;
}
// -----------------------------------------------------------------------------
// DeallocQuickLookGeneratorPluginType
// -----------------------------------------------------------------------------
// Utility function that deallocates the instance when
// the refCount goes to zero.
// In the current implementation generator interfaces are never deallocated
// but implement this as this might change in the future
//
void DeallocQuickLookGeneratorPluginType(QuickLookGeneratorPluginType *thisInstance)
{
CFUUIDRef theFactoryID;
theFactoryID = thisInstance->factoryID;
/* Free the conduitInterface table up */
free(thisInstance->conduitInterface);
/* Free the instance structure */
free(thisInstance);
if (theFactoryID){
CFPlugInRemoveInstanceForFactory(theFactoryID);
CFRelease(theFactoryID);
}
}
// -----------------------------------------------------------------------------
// QuickLookGeneratorQueryInterface
// -----------------------------------------------------------------------------
// Implementation of the IUnknown QueryInterface function.
//
HRESULT QuickLookGeneratorQueryInterface(void *thisInstance,REFIID iid,LPVOID *ppv)
{
CFUUIDRef interfaceID;
interfaceID = CFUUIDCreateFromUUIDBytes(kCFAllocatorDefault,iid);
if (CFEqual(interfaceID,kQLGeneratorCallbacksInterfaceID)){
/* If the Right interface was requested, bump the ref count,
* set the ppv parameter equal to the instance, and
* return good status.
*/
((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->GenerateThumbnailForURL = GenerateThumbnailForURL;
((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->CancelThumbnailGeneration = CancelThumbnailGeneration;
((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->GeneratePreviewForURL = GeneratePreviewForURL;
((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->CancelPreviewGeneration = CancelPreviewGeneration;
((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType*)thisInstance)->conduitInterface)->AddRef(thisInstance);
*ppv = thisInstance;
CFRelease(interfaceID);
return S_OK;
}else{
/* Requested interface unknown, bail with error. */
*ppv = NULL;
CFRelease(interfaceID);
return E_NOINTERFACE;
}
}
// -----------------------------------------------------------------------------
// QuickLookGeneratorPluginAddRef
// -----------------------------------------------------------------------------
// Implementation of reference counting for this type. Whenever an interface
// is requested, bump the refCount for the instance. NOTE: returning the
// refcount is a convention but is not required so don't rely on it.
//
ULONG QuickLookGeneratorPluginAddRef(void *thisInstance)
{
((QuickLookGeneratorPluginType *)thisInstance )->refCount += 1;
return ((QuickLookGeneratorPluginType*) thisInstance)->refCount;
}
// -----------------------------------------------------------------------------
// QuickLookGeneratorPluginRelease
// -----------------------------------------------------------------------------
// When an interface is released, decrement the refCount.
// If the refCount goes to zero, deallocate the instance.
//
ULONG QuickLookGeneratorPluginRelease(void *thisInstance)
{
((QuickLookGeneratorPluginType*)thisInstance)->refCount -= 1;
if (((QuickLookGeneratorPluginType*)thisInstance)->refCount == 0){
DeallocQuickLookGeneratorPluginType((QuickLookGeneratorPluginType*)thisInstance );
return 0;
}else{
return ((QuickLookGeneratorPluginType*) thisInstance )->refCount;
}
}
// -----------------------------------------------------------------------------
// QuickLookGeneratorPluginFactory
// -----------------------------------------------------------------------------
void *QuickLookGeneratorPluginFactory(CFAllocatorRef allocator,CFUUIDRef typeID)
{
QuickLookGeneratorPluginType *result;
CFUUIDRef uuid;
/* If correct type is being requested, allocate an
* instance of kQLGeneratorTypeID and return the IUnknown interface.
*/
if (CFEqual(typeID,kQLGeneratorTypeID)){
uuid = CFUUIDCreateFromString(kCFAllocatorDefault,CFSTR(PLUGIN_ID));
result = AllocQuickLookGeneratorPluginType(uuid);
CFRelease(uuid);
return result;
}
/* If the requested type is incorrect, return NULL. */
return NULL;
}
+12 -8
View File
@@ -211,20 +211,24 @@ OBJDIR = $(OBJDIR)d
! ifdef CPU
ASSEMBLY_ARCHITECTURE=$(CPU)
# Using I386 for $ASSEMBLY_ARCHITECTURE doesn't work for VC7.
! if ("$(ASSEMBLY_ARCHITECTURE)" == "i386") || ("$(ASSEMBLY_ARCHITECTURE)" == "I386")
ASSEMBLY_ARCHITECTURE = x86
! endif
! else
CPU = $(PROCESSOR_ARCHITECTURE)
ASSEMBLY_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
! if ("$(CPU)" == "x86") || ("$(CPU)" == "X86")
! if "$(CPU)" == "I386"
CPU = i386
! endif
! else # !CPU
CPU = i386
! ifdef PLATFORM
! if ("$(PLATFORM)" == "x64") || ("$(PLATFORM)" == "X64")
CPU = AMD64
! elseif ("$(PLATFORM)" != "x86") && ("$(PLATFORM)" != "X86")
! error *** ERROR Unknown target platform "$(PLATFORM)". Make aborted.
! endif
! endif # !PLATFORM
! endif
!else # !PROCESSOR_ARCHITECTURE
# We're on Windows 95
CPU = i386
!endif # !PROCESSOR_ARCHITECTURE
ASSEMBLY_ARCHITECTURE=$(CPU)
OBJDIR = $(OBJDIR)$(CPU)
# Build a retail version by default
@@ -415,7 +419,7 @@ CPUARG =
!endif
!else
# VC8/9/10 only allows specifying SSE architecture but only for 32bit
!if "$(ASSEMBLY_ARCHITECTURE)" == "x86" && "$(CPUNR)" == "pentium4"
!if "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "pentium4"
CPUARG = /arch:SSE2
!endif
!endif
+15 -15
View File
@@ -5064,7 +5064,7 @@ $as_echo "$vi_cv_version_plain_lua" >&6; }
if test "x$vi_cv_with_luajit" != "xno" && test "X$vi_cv_version_luajit" != "X"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua.h can be found in $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit" >&5
$as_echo_n "checking if lua.h can be found in $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit... " >&6; }
if test -f $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit/lua.h; then
if test -f "$vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit/lua.h"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
LUA_INC=/luajit-$vi_cv_version_luajit
@@ -5073,7 +5073,7 @@ $as_echo "yes" >&6; }
if test "X$LUA_INC" = "X"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua.h can be found in $vi_cv_path_lua_pfx/include" >&5
$as_echo_n "checking if lua.h can be found in $vi_cv_path_lua_pfx/include... " >&6; }
if test -f $vi_cv_path_lua_pfx/include/lua.h; then
if test -f "$vi_cv_path_lua_pfx/include/lua.h"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
@@ -5081,7 +5081,7 @@ $as_echo "yes" >&6; }
$as_echo "no" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua" >&5
$as_echo_n "checking if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua... " >&6; }
if test -f $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h; then
if test -f "$vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
LUA_INC=/lua$vi_cv_version_lua
@@ -5332,7 +5332,7 @@ $as_echo "$vi_cv_path_mzscheme_pfx" >&6; }
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include" >&5
$as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include... " >&6; }
if test -f $vi_cv_path_mzscheme_pfx/include/scheme.h; then
if test -f "$vi_cv_path_mzscheme_pfx/include/scheme.h"; then
SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
@@ -5341,7 +5341,7 @@ $as_echo "yes" >&6; }
$as_echo "no" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt" >&5
$as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt... " >&6; }
if test -f $vi_cv_path_mzscheme_pfx/include/plt/scheme.h; then
if test -f "$vi_cv_path_mzscheme_pfx/include/plt/scheme.h"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt
@@ -5350,7 +5350,7 @@ $as_echo "yes" >&6; }
$as_echo "no" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket" >&5
$as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket... " >&6; }
if test -f $vi_cv_path_mzscheme_pfx/include/racket/scheme.h; then
if test -f "$vi_cv_path_mzscheme_pfx/include/racket/scheme.h"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket
@@ -5419,16 +5419,16 @@ $as_echo "no" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for racket collects directory" >&5
$as_echo_n "checking for racket collects directory... " >&6; }
if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then
if test -d "$vi_cv_path_mzscheme_pfx/lib/plt/collects"; then
SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/
else
if test -d $vi_cv_path_mzscheme_pfx/lib/racket/collects; then
if test -d "$vi_cv_path_mzscheme_pfx/lib/racket/collects"; then
SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/
else
if test -d $vi_cv_path_mzscheme_pfx/share/racket/collects; then
if test -d "$vi_cv_path_mzscheme_pfx/share/racket/collects"; then
SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/
else
if test -d $vi_cv_path_mzscheme_pfx/collects; then
if test -d "$vi_cv_path_mzscheme_pfx/collects"; then
SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/
fi
fi
@@ -6912,7 +6912,7 @@ fi
if test "X$vi_cv_path_tcl" != "X"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Tcl version" >&5
$as_echo_n "checking Tcl version... " >&6; }
if echo 'exit [expr [info tclversion] < 8.0]' | $vi_cv_path_tcl - ; then
if echo 'exit [expr [info tclversion] < 8.0]' | "$vi_cv_path_tcl" - ; then
tclver=`echo 'puts [info tclversion]' | $vi_cv_path_tcl -`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tclver - OK" >&5
$as_echo "$tclver - OK" >&6; };
@@ -6949,10 +6949,10 @@ $as_echo_n "checking for location of tclConfig.sh script... " >&6; }
tclcnf="/System/Library/Frameworks/Tcl.framework"
fi
for try in $tclcnf; do
if test -f $try/tclConfig.sh; then
if test -f "$try/tclConfig.sh"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $try/tclConfig.sh" >&5
$as_echo "$try/tclConfig.sh" >&6; }
. $try/tclConfig.sh
. "$try/tclConfig.sh"
TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"`
TCL_DEFS=`echo $TCL_DEFS | sed -e 's/\\\\ /\\\\X/g' | tr ' ' '\012' | sed -e '/^[^-]/d' -e '/^-[^D]/d' -e '/-D[^_]/d' -e 's/-D_/ -D_/' | tr '\012' ' ' | sed -e 's/\\\\X/\\\\ /g'`
break
@@ -6969,10 +6969,10 @@ $as_echo_n "checking for Tcl library by myself... " >&6; }
for ver in "" $tclver ; do
for try in $tcllib ; do
trylib=tcl$ver$ext
if test -f $try/lib$trylib ; then
if test -f "$try/lib$trylib" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $try/lib$trylib" >&5
$as_echo "$try/lib$trylib" >&6; }
TCL_LIBS="-L$try -ltcl$ver -ldl -lm"
TCL_LIBS="-L\"$try\" -ltcl$ver -ldl -lm"
if test "`(uname) 2>/dev/null`" = SunOS &&
uname -r | grep '^5' >/dev/null; then
TCL_LIBS="$TCL_LIBS -R $try"
+15 -15
View File
@@ -565,19 +565,19 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
fi
if test "x$vi_cv_with_luajit" != "xno" && test "X$vi_cv_version_luajit" != "X"; then
AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit)
if test -f $vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit/lua.h; then
if test -f "$vi_cv_path_lua_pfx/include/luajit-$vi_cv_version_luajit/lua.h"; then
AC_MSG_RESULT(yes)
LUA_INC=/luajit-$vi_cv_version_luajit
fi
fi
if test "X$LUA_INC" = "X"; then
AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include)
if test -f $vi_cv_path_lua_pfx/include/lua.h; then
if test -f "$vi_cv_path_lua_pfx/include/lua.h"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua)
if test -f $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h; then
if test -f "$vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h"; then
AC_MSG_RESULT(yes)
LUA_INC=/lua$vi_cv_version_lua
else
@@ -753,19 +753,19 @@ if test "$enable_mzschemeinterp" = "yes"; then
SCHEME_INC=
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include)
if test -f $vi_cv_path_mzscheme_pfx/include/scheme.h; then
if test -f "$vi_cv_path_mzscheme_pfx/include/scheme.h"; then
SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt)
if test -f $vi_cv_path_mzscheme_pfx/include/plt/scheme.h; then
if test -f "$vi_cv_path_mzscheme_pfx/include/plt/scheme.h"; then
AC_MSG_RESULT(yes)
SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket)
if test -f $vi_cv_path_mzscheme_pfx/include/racket/scheme.h; then
if test -f "$vi_cv_path_mzscheme_pfx/include/racket/scheme.h"; then
AC_MSG_RESULT(yes)
SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket
else
@@ -828,16 +828,16 @@ if test "$enable_mzschemeinterp" = "yes"; then
fi
AC_MSG_CHECKING(for racket collects directory)
if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then
if test -d "$vi_cv_path_mzscheme_pfx/lib/plt/collects"; then
SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/plt/
else
if test -d $vi_cv_path_mzscheme_pfx/lib/racket/collects; then
if test -d "$vi_cv_path_mzscheme_pfx/lib/racket/collects"; then
SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/lib/racket/
else
if test -d $vi_cv_path_mzscheme_pfx/share/racket/collects; then
if test -d "$vi_cv_path_mzscheme_pfx/share/racket/collects"; then
SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/share/racket/
else
if test -d $vi_cv_path_mzscheme_pfx/collects; then
if test -d "$vi_cv_path_mzscheme_pfx/collects"; then
SCHEME_COLLECTS=$vi_cv_path_mzscheme_pfx/
fi
fi
@@ -1698,7 +1698,7 @@ if test "$enable_tclinterp" = "yes"; then
fi
if test "X$vi_cv_path_tcl" != "X"; then
AC_MSG_CHECKING(Tcl version)
if echo 'exit [[expr [info tclversion] < 8.0]]' | $vi_cv_path_tcl - ; then
if echo 'exit [[expr [info tclversion] < 8.0]]' | "$vi_cv_path_tcl" - ; then
tclver=`echo 'puts [[info tclversion]]' | $vi_cv_path_tcl -`
AC_MSG_RESULT($tclver - OK);
tclloc=`echo 'set l [[info library]];set i [[string last lib $l]];incr i -2;puts [[string range $l 0 $i]]' | $vi_cv_path_tcl -`
@@ -1732,9 +1732,9 @@ if test "$enable_tclinterp" = "yes"; then
tclcnf="/System/Library/Frameworks/Tcl.framework"
fi
for try in $tclcnf; do
if test -f $try/tclConfig.sh; then
if test -f "$try/tclConfig.sh"; then
AC_MSG_RESULT($try/tclConfig.sh)
. $try/tclConfig.sh
. "$try/tclConfig.sh"
dnl use eval, because tcl 8.2 includes ${TCL_DBGX}
TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"`
dnl Use $TCL_DEFS for -D_THREAD_SAFE et al. But only use the
@@ -1752,9 +1752,9 @@ if test "$enable_tclinterp" = "yes"; then
for ver in "" $tclver ; do
for try in $tcllib ; do
trylib=tcl$ver$ext
if test -f $try/lib$trylib ; then
if test -f "$try/lib$trylib" ; then
AC_MSG_RESULT($try/lib$trylib)
TCL_LIBS="-L$try -ltcl$ver -ldl -lm"
TCL_LIBS="-L\"$try\" -ltcl$ver -ldl -lm"
if test "`(uname) 2>/dev/null`" = SunOS &&
uname -r | grep '^5' >/dev/null; then
TCL_LIBS="$TCL_LIBS -R $try"
+3 -1
View File
@@ -8074,11 +8074,13 @@ static struct fst
{"argidx", 0, 0, f_argidx},
{"arglistid", 0, 2, f_arglistid},
{"argv", 0, 1, f_argv},
#ifdef FEAT_FLOAT
{"asin", 1, 1, f_asin}, /* WJMc */
#endif
{"assert_equal", 2, 3, f_assert_equal},
{"assert_false", 1, 2, f_assert_false},
{"assert_true", 1, 2, f_assert_true},
#ifdef FEAT_FLOAT
{"asin", 1, 1, f_asin}, /* WJMc */
{"atan", 1, 1, f_atan},
{"atan2", 2, 2, f_atan2},
#endif
+8
View File
@@ -9662,6 +9662,10 @@ ex_redraw(eap)
need_wait_return = FALSE;
out_flush();
#ifdef FEAT_GUI_MACVIM
if (gui.in_use)
gui_macvim_flush();
#endif
}
/*
@@ -9685,6 +9689,10 @@ ex_redrawstatus(eap)
RedrawingDisabled = r;
p_lz = p;
out_flush();
# ifdef FEAT_GUI_MACVIM
if (gui.in_use)
gui_macvim_flush();
# endif
#endif
}
+1 -1
View File
@@ -27,7 +27,7 @@
/* Is there any system that doesn't have access()? */
#define USE_MCH_ACCESS
#if defined(sun) && defined(S_ISCHR)
#if (defined(sun) || defined(__FreeBSD__)) && defined(S_ISCHR)
# define OPEN_CHR_FILES
static int is_dev_fd_file(char_u *fname);
#endif
+1 -1
View File
@@ -4552,7 +4552,7 @@ init_preedit_start_col(void)
{
if (State & CMDLINE)
preedit_start_col = cmdline_getvcol_cursor();
else if (curwin != NULL)
else if (curwin != NULL && curwin->w_buffer != NULL)
getvcol(curwin, &curwin->w_cursor, &preedit_start_col, NULL, NULL);
/* Prevent that preediting marks the buffer as changed. */
xim_changed_while_preediting = curbuf->b_changed;
+7 -2
View File
@@ -3352,8 +3352,8 @@ set_init_1()
if (opt_idx >= 0)
{
#if !defined(HAVE_AVAIL_MEM) && !defined(HAVE_TOTAL_MEM)
if ((long)options[opt_idx].def_val[VI_DEFAULT] > (long)n
|| (long)options[opt_idx].def_val[VI_DEFAULT] == 0L)
if ((long)(long_i)options[opt_idx].def_val[VI_DEFAULT] > (long)n
|| (long)(long_i)options[opt_idx].def_val[VI_DEFAULT] == 0L)
#endif
options[opt_idx].def_val[VI_DEFAULT] = (char_u *)n;
}
@@ -5050,7 +5050,12 @@ do_set(arg, opt_flags)
/* If error detected, print the error message. */
if (errmsg != NULL)
{
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
vim_free(saved_origval);
#endif
goto skip;
}
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
if (saved_origval != NULL)
{
+1 -1
View File
@@ -370,7 +370,7 @@ EOF
:sleep 1
:py t.running = False
:py t.join()
:py l[0] = t.t > 8 # check if the background thread is working
:py l[0] = t.t > 7 # check if the background thread is working
:py del time
:py del threading
:py del t
+14 -3
View File
@@ -367,7 +367,7 @@ EOF
:sleep 1
:py3 t.running = False
:py3 t.join()
:py3 l[0] = t.t > 8 # check if the background thread is working
:py3 l[0] = t.t > 7 # check if the background thread is working
:py3 del time
:py3 del threading
:py3 del t
@@ -910,8 +910,19 @@ fnamemodify = vim.Function('fnamemodify')
cb.append(str(fnamemodify('.', ':p:h:t')))
cb.append(vim.eval('@%'))
os.chdir('..')
cb.append(str(fnamemodify('.', ':p:h:t')))
cb.append(vim.eval('@%').replace(os.path.sep, '/'))
path = fnamemodify('.', ':p:h:t')
if path != b'src':
# Running tests from a shadow directory, so move up another level
# This will result in @% looking like shadow/testdir/test87.in, hence the
# slicing to remove the leading path and path separator
os.chdir('..')
cb.append(str(fnamemodify('.', ':p:h:t')))
cb.append(vim.eval('@%')[len(path)+1:].replace(os.path.sep, '/'))
os.chdir(path)
else:
cb.append(str(fnamemodify('.', ':p:h:t')))
cb.append(vim.eval('@%').replace(os.path.sep, '/'))
del path
os.chdir('testdir')
cb.append(str(fnamemodify('.', ':p:h:t')))
cb.append(vim.eval('@%'))
+18
View File
@@ -756,6 +756,24 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
972,
/**/
971,
/**/
970,
/**/
969,
/**/
968,
/**/
967,
/**/
966,
/**/
965,
/**/
964,
/**/
963,
/**/