mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Merge branch 'master' into macvim73
This commit is contained in:
Executable → Regular
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -1,43 +0,0 @@
|
||||
/* vi:set ts=8 sts=4 sw=4 ft=objc:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <Security/Authorization.h>
|
||||
|
||||
|
||||
@interface AuthorizedShellCommand : NSObject {
|
||||
|
||||
NSArray *commands;
|
||||
|
||||
AuthorizationRef authorizationRef;
|
||||
|
||||
}
|
||||
|
||||
// Pass an array of dictionaries. Each dictionary has to have the following
|
||||
// keys:
|
||||
//
|
||||
// * MMCommand: The command to execute, an NSString (e.g. @"/usr/bin/rm").
|
||||
// * MMArguments: An array of NSStrings, the arguments that are passed to
|
||||
// the command.
|
||||
//
|
||||
- (AuthorizedShellCommand *)initWithCommands:(NSArray *)theCommands;
|
||||
|
||||
// Runs the command passed in the constructor.
|
||||
- (OSStatus)run;
|
||||
|
||||
// This pops up the permission dialog. Called by run.
|
||||
- (OSStatus)askUserForPermission;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
extern NSString *MMCommand;
|
||||
extern NSString *MMArguments;
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
/* vi:set ts=8 sts=4 sw=4 ft=objc:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
/*
|
||||
* AuthorizedCommand
|
||||
*
|
||||
* Runs a set of shell commands which may require authorization. Displays a
|
||||
* gui dialog to ask the user for authorized access.
|
||||
*/
|
||||
|
||||
#import "AuthorizedShellCommand.h"
|
||||
#import <Security/AuthorizationTags.h>
|
||||
|
||||
|
||||
@implementation AuthorizedShellCommand
|
||||
|
||||
- (AuthorizedShellCommand *)initWithCommands:(NSArray *)theCommands
|
||||
{
|
||||
if (![super init])
|
||||
return nil;
|
||||
|
||||
commands = [theCommands retain];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[super dealloc];
|
||||
[commands release];
|
||||
}
|
||||
|
||||
- (OSStatus)run
|
||||
{
|
||||
OSStatus err;
|
||||
int i;
|
||||
const char** arguments = NULL;
|
||||
AuthorizationFlags flags = kAuthorizationFlagDefaults;
|
||||
|
||||
err = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
|
||||
flags, &authorizationRef);
|
||||
if (err != errAuthorizationSuccess)
|
||||
return err;
|
||||
|
||||
if ((err = [self askUserForPermission]) != errAuthorizationSuccess) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
NSEnumerator* myIterator = [commands objectEnumerator];
|
||||
NSDictionary* currCommand;
|
||||
|
||||
while ((currCommand = [myIterator nextObject])) {
|
||||
/* do something useful with currCommand */
|
||||
FILE *ioPipe = NULL;
|
||||
char junk[256];
|
||||
|
||||
const char* toolPath = [[currCommand objectForKey:MMCommand] UTF8String];
|
||||
NSArray* argumentStrings = [currCommand objectForKey:MMArguments];
|
||||
arguments = (const char**)malloc(
|
||||
([argumentStrings count] + 1) * sizeof(char*));
|
||||
|
||||
for (i = 0; i < [argumentStrings count]; ++i) {
|
||||
arguments[i] = [[argumentStrings objectAtIndex:i] UTF8String];
|
||||
}
|
||||
arguments[i] = NULL;
|
||||
|
||||
err = AuthorizationExecuteWithPrivileges (authorizationRef, toolPath,
|
||||
kAuthorizationFlagDefaults, (char*const*)arguments, &ioPipe);
|
||||
if (err != errAuthorizationSuccess)
|
||||
goto cleanup;
|
||||
|
||||
#if 0
|
||||
// We use the pipe to signal us when the command has completed
|
||||
char *p;
|
||||
do {
|
||||
p = fgets(junk, sizeof(junk), ioPipe);
|
||||
} while (p);
|
||||
#else
|
||||
for(;;)
|
||||
{
|
||||
int bytesRead = read (fileno (ioPipe),
|
||||
junk, sizeof (junk));
|
||||
if (bytesRead < 1) break;
|
||||
write (fileno (stdout), junk, bytesRead);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (arguments != NULL) {
|
||||
free(arguments);
|
||||
arguments = NULL;
|
||||
}
|
||||
fclose(ioPipe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
cleanup:
|
||||
AuthorizationFree(authorizationRef, kAuthorizationFlagDefaults);
|
||||
authorizationRef = 0;
|
||||
|
||||
if (arguments != NULL)
|
||||
free(arguments);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
- (OSStatus)askUserForPermission
|
||||
{
|
||||
int i;
|
||||
|
||||
assert(authorizationRef != 0);
|
||||
|
||||
// The documentation for AuthorizationItem says that `value` should be
|
||||
// the path to the full posix path for kAuthorizationRightExecute. But
|
||||
// the installer sample "Calling a Privileged Installer" sets it to NULL.
|
||||
// Gotta love Apple's documentation.
|
||||
//
|
||||
// If you don't set `value` correctly, you'll get an
|
||||
// `errAuthorizationToolEnvironmentError` when you try to execute the
|
||||
// command.
|
||||
AuthorizationItem* authItems =
|
||||
malloc([commands count] * sizeof(AuthorizationItem));
|
||||
for (i = 0; i < [commands count]; ++i) {
|
||||
authItems[i].name = kAuthorizationRightExecute;
|
||||
authItems[i].value = (void*)
|
||||
[[[commands objectAtIndex:i] objectForKey:MMCommand] UTF8String];
|
||||
authItems[i].valueLength = strlen(authItems[i].value);
|
||||
authItems[i].flags = 0;
|
||||
}
|
||||
|
||||
AuthorizationRights rights = {
|
||||
[commands count], authItems
|
||||
};
|
||||
|
||||
OSStatus err = AuthorizationCopyRights(authorizationRef, &rights, NULL,
|
||||
kAuthorizationFlagInteractionAllowed |
|
||||
kAuthorizationFlagPreAuthorize |
|
||||
kAuthorizationFlagExtendRights
|
||||
, NULL);
|
||||
|
||||
free(authItems);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NSString *MMCommand = @"MMCommand";
|
||||
NSString *MMArguments = @"MMArguments";
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
//
|
||||
// CTGradient.h
|
||||
//
|
||||
// Created by Chad Weider on 2/14/07.
|
||||
// Writtin by Chad Weider.
|
||||
//
|
||||
// Released into public domain on 4/10/08.
|
||||
//
|
||||
// Version: 1.8
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
typedef struct _CTGradientElement
|
||||
{
|
||||
float red, green, blue, alpha;
|
||||
float position;
|
||||
|
||||
struct _CTGradientElement *nextElement;
|
||||
} CTGradientElement;
|
||||
|
||||
typedef enum _CTBlendingMode
|
||||
{
|
||||
CTLinearBlendingMode,
|
||||
CTChromaticBlendingMode,
|
||||
CTInverseChromaticBlendingMode
|
||||
} CTGradientBlendingMode;
|
||||
|
||||
|
||||
@interface CTGradient : NSObject <NSCopying, NSCoding>
|
||||
{
|
||||
CTGradientElement* elementList;
|
||||
CTGradientBlendingMode blendingMode;
|
||||
|
||||
CGFunctionRef gradientFunction;
|
||||
}
|
||||
|
||||
+ (id)gradientWithBeginningColor:(NSColor *)begin endingColor:(NSColor *)end;
|
||||
|
||||
+ (id)aquaSelectedGradient;
|
||||
+ (id)aquaNormalGradient;
|
||||
+ (id)aquaPressedGradient;
|
||||
|
||||
+ (id)unifiedSelectedGradient;
|
||||
+ (id)unifiedNormalGradient;
|
||||
+ (id)unifiedPressedGradient;
|
||||
+ (id)unifiedDarkGradient;
|
||||
|
||||
+ (id)sourceListSelectedGradient;
|
||||
+ (id)sourceListUnselectedGradient;
|
||||
|
||||
+ (id)rainbowGradient;
|
||||
+ (id)hydrogenSpectrumGradient;
|
||||
|
||||
- (CTGradient *)gradientWithAlphaComponent:(float)alpha;
|
||||
|
||||
- (CTGradient *)addColorStop:(NSColor *)color atPosition:(float)position; //positions given relative to [0,1]
|
||||
- (CTGradient *)removeColorStopAtIndex:(unsigned)index;
|
||||
- (CTGradient *)removeColorStopAtPosition:(float)position;
|
||||
|
||||
- (CTGradientBlendingMode)blendingMode;
|
||||
- (NSColor *)colorStopAtIndex:(unsigned)index;
|
||||
- (NSColor *)colorAtPosition:(float)position;
|
||||
|
||||
|
||||
- (void)drawSwatchInRect:(NSRect)rect;
|
||||
- (void)fillRect:(NSRect)rect angle:(float)angle; //fills rect with axial gradient
|
||||
// angle in degrees
|
||||
- (void)radialFillRect:(NSRect)rect; //fills rect with radial gradient
|
||||
// gradient from center outwards
|
||||
- (void)fillBezierPath:(NSBezierPath *)path angle:(float)angle;
|
||||
- (void)radialFillBezierPath:(NSBezierPath *)path;
|
||||
|
||||
@end
|
||||
File diff suppressed because it is too large
Load Diff
@@ -45,8 +45,4 @@ The default font in MacVim, DejaVu Sans Mono, is based on the Bitstream Vera\'99
|
||||
\
|
||||
Thanks to Andy Matuschak for {\field{\*\fldinst{HYPERLINK "http://sparkle.andymatuschak.org/"}}{\fldrslt Sparkle}}.\
|
||||
\
|
||||
Thanks to Dave Batton for {\field{\*\fldinst{HYPERLINK "http://www.mere-mortal-software.com/blog/details.php?d=2007-03-11&c=show"}}{\fldrslt DBPrefsWindowController}}.\
|
||||
\
|
||||
Thanks to Allan Odgaard for making the "Edit in TextMate" input manager source code available, and also to Chris Eidhof and Eelco Lempsink for modifying it so that it could be used with any ODB capable editor.\
|
||||
\
|
||||
Thanks to Damien Guard for {\field{\*\fldinst{HYPERLINK "http://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released"}}{\fldrslt Envy Code R}} (used in MacVim's 16x16 document icons).}
|
||||
+103
-574
@@ -2,13 +2,13 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">10C540</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">732</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.25</string>
|
||||
<string key="IBDocument.HIToolboxVersion">458.00</string>
|
||||
<string key="IBDocument.SystemVersion">10F569</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">762</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.29</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">732</string>
|
||||
<string key="NS.object.0">762</string>
|
||||
</object>
|
||||
<array class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<integer value="620"/>
|
||||
@@ -28,10 +28,6 @@
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSUserDefaultsController" id="547503666">
|
||||
<array class="NSMutableArray" key="NSDeclaredKeys">
|
||||
<string>MM</string>
|
||||
<string>MMRenderer</string>
|
||||
</array>
|
||||
<bool key="NSSharedInstance">YES</bool>
|
||||
</object>
|
||||
<object class="NSCustomView" id="225936320">
|
||||
@@ -490,7 +486,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="193610391"/>
|
||||
<reference key="NSBackgroundColor" ref="821672772"/>
|
||||
<object class="NSColor" key="NSTextColor" id="1020327546">
|
||||
<object class="NSColor" key="NSTextColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">disabledControlTextColor</string>
|
||||
@@ -713,242 +709,55 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<string key="NSFrameSize">{483, 290}</string>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSCustomView" id="443205242">
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="NSBox" id="1041056912">
|
||||
<reference key="NSNextResponder" ref="443205242"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="NSView" id="887541683">
|
||||
<reference key="NSNextResponder" ref="1041056912"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="NSButton" id="841479415">
|
||||
<reference key="NSNextResponder" ref="887541683"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{12, 115}, {96, 32}}</string>
|
||||
<reference key="NSSuperview" ref="887541683"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="624692609">
|
||||
<int key="NSCellFlags">604110336</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Uninstall</string>
|
||||
<reference key="NSSupport" ref="398275172"/>
|
||||
<reference key="NSControlView" ref="841479415"/>
|
||||
<int key="NSButtonFlags">-2038284033</int>
|
||||
<int key="NSButtonFlags2">1</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="799826912">
|
||||
<reference key="NSNextResponder" ref="887541683"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{15, 14}, {417, 51}}</string>
|
||||
<reference key="NSSuperview" ref="887541683"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="10311595">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">4194304</int>
|
||||
<string key="NSContents">External Editor is a bit of a hack. It could make other applications unstable, and it could stop working in new versions of OS X. But it usually works well, and uninstallation completely removes it.</string>
|
||||
<reference key="NSSupport" ref="398275172"/>
|
||||
<reference key="NSControlView" ref="799826912"/>
|
||||
<reference key="NSBackgroundColor" ref="821672772"/>
|
||||
<reference key="NSTextColor" ref="481736603"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSPopUpButton" id="635472630">
|
||||
<reference key="NSNextResponder" ref="887541683"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{211, 227}, {152, 26}}</string>
|
||||
<reference key="NSSuperview" ref="887541683"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSPopUpButtonCell" key="NSCell" id="545964422">
|
||||
<int key="NSCellFlags">-1539178944</int>
|
||||
<int key="NSCellFlags2">2048</int>
|
||||
<reference key="NSSupport" ref="398275172"/>
|
||||
<reference key="NSControlView" ref="635472630"/>
|
||||
<int key="NSButtonFlags">109199615</int>
|
||||
<int key="NSButtonFlags2">1</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">400</int>
|
||||
<int key="NSPeriodicInterval">75</int>
|
||||
<nil key="NSMenuItem"/>
|
||||
<bool key="NSMenuItemRespectAlignment">YES</bool>
|
||||
<object class="NSMenu" key="NSMenu" id="89589003">
|
||||
<string key="NSTitle">OtherViews</string>
|
||||
<array class="NSMutableArray" key="NSMenuItems"/>
|
||||
</object>
|
||||
<int key="NSSelectedIndex">-1</int>
|
||||
<int key="NSPreferredEdge">1</int>
|
||||
<bool key="NSUsesItemFromMenu">YES</bool>
|
||||
<bool key="NSAltersState">YES</bool>
|
||||
<int key="NSArrowPosition">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="249474193">
|
||||
<reference key="NSNextResponder" ref="887541683"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{12, 221}, {96, 32}}</string>
|
||||
<reference key="NSSuperview" ref="887541683"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="213101514">
|
||||
<int key="NSCellFlags">604110336</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Install</string>
|
||||
<reference key="NSSupport" ref="398275172"/>
|
||||
<reference key="NSControlView" ref="249474193"/>
|
||||
<int key="NSButtonFlags">-2038284033</int>
|
||||
<int key="NSButtonFlags2">1</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="548095870">
|
||||
<reference key="NSNextResponder" ref="887541683"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{107, 159}, {325, 14}}</string>
|
||||
<reference key="NSSuperview" ref="887541683"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="982688187">
|
||||
<int key="NSCellFlags">67239488</int>
|
||||
<int key="NSCellFlags2">272761856</int>
|
||||
<string key="NSContents">(version)</string>
|
||||
<reference key="NSSupport" ref="26"/>
|
||||
<reference key="NSControlView" ref="548095870"/>
|
||||
<reference key="NSBackgroundColor" ref="821672772"/>
|
||||
<reference key="NSTextColor" ref="1020327546"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="664524879">
|
||||
<reference key="NSNextResponder" ref="887541683"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{107, 231}, {102, 17}}</string>
|
||||
<reference key="NSSuperview" ref="887541683"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="906295134">
|
||||
<int key="NSCellFlags">67239488</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">External Editor:</string>
|
||||
<reference key="NSSupport" ref="398275172"/>
|
||||
<reference key="NSControlView" ref="664524879"/>
|
||||
<reference key="NSBackgroundColor" ref="821672772"/>
|
||||
<reference key="NSTextColor" ref="481736603"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="808161291">
|
||||
<reference key="NSNextResponder" ref="887541683"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{107, 181}, {325, 42}}</string>
|
||||
<reference key="NSSuperview" ref="887541683"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="760604180">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">4325376</int>
|
||||
<string key="NSContents">Use this to write mails or to fill in web forms with your favorite editor. Save and close the file in your editor to copy the result back to the original application.</string>
|
||||
<reference key="NSSupport" ref="26"/>
|
||||
<reference key="NSControlView" ref="808161291"/>
|
||||
<reference key="NSBackgroundColor" ref="821672772"/>
|
||||
<reference key="NSTextColor" ref="1020327546"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="228008295">
|
||||
<reference key="NSNextResponder" ref="887541683"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{15, 73}, {417, 34}}</string>
|
||||
<reference key="NSSuperview" ref="887541683"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="979053968">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">4194304</int>
|
||||
<string key="NSContents">You must restart applications that should notice any change you make above.</string>
|
||||
<reference key="NSSupport" ref="398275172"/>
|
||||
<reference key="NSControlView" ref="228008295"/>
|
||||
<reference key="NSBackgroundColor" ref="821672772"/>
|
||||
<reference key="NSTextColor" ref="481736603"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="627992137">
|
||||
<reference key="NSNextResponder" ref="887541683"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{107, 125}, {325, 14}}</string>
|
||||
<reference key="NSSuperview" ref="887541683"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="641980577">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">1078067200</int>
|
||||
<string key="NSContents">This completely removes the External Editor functionality.</string>
|
||||
<reference key="NSSupport" ref="26"/>
|
||||
<reference key="NSControlView" ref="627992137"/>
|
||||
<reference key="NSBackgroundColor" ref="821672772"/>
|
||||
<reference key="NSTextColor" ref="1020327546"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="554064415">
|
||||
<reference key="NSNextResponder" ref="887541683"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{15, 265}, {417, 34}}</string>
|
||||
<reference key="NSSuperview" ref="887541683"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="483958140">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">4194304</int>
|
||||
<string key="NSContents">Add “Edit in External Editor…” to the Edit menu of other applications like Mail or Safari.</string>
|
||||
<reference key="NSSupport" ref="398275172"/>
|
||||
<reference key="NSControlView" ref="554064415"/>
|
||||
<reference key="NSBackgroundColor" ref="821672772"/>
|
||||
<reference key="NSTextColor" ref="481736603"/>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{1, 1}, {447, 309}}</string>
|
||||
<reference key="NSSuperview" ref="1041056912"/>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{17, 16}, {449, 325}}</string>
|
||||
<reference key="NSSuperview" ref="443205242"/>
|
||||
<string key="NSOffsets">{0, 0}</string>
|
||||
<object class="NSTextFieldCell" key="NSTitleCell">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents">External Editor</string>
|
||||
<reference key="NSSupport" ref="26"/>
|
||||
<object class="NSColor" key="NSBackgroundColor">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">textBackgroundColor</string>
|
||||
<reference key="NSColor" ref="208863654"/>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<reference key="NSContentView" ref="887541683"/>
|
||||
<int key="NSBorderType">1</int>
|
||||
<int key="NSBoxType">0</int>
|
||||
<int key="NSTitlePosition">2</int>
|
||||
<bool key="NSTransparent">NO</bool>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{483, 361}</string>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSCustomView" id="836854791">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="NSButton" id="818542525">
|
||||
<reference key="NSNextResponder" ref="836854791"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{18, 92}, {174, 18}}</string>
|
||||
<reference key="NSSuperview" ref="836854791"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="948343868">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents">Draw marked text inline</string>
|
||||
<reference key="NSSupport" ref="398275172"/>
|
||||
<reference key="NSControlView" ref="818542525"/>
|
||||
<int key="NSButtonFlags">1211912703</int>
|
||||
<int key="NSButtonFlags2">2</int>
|
||||
<reference key="NSNormalImage" ref="385062508"/>
|
||||
<reference key="NSAlternateImage" ref="426852917"/>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="536705090">
|
||||
<reference key="NSNextResponder" ref="836854791"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 20}, {444, 70}}</string>
|
||||
<reference key="NSSuperview" ref="836854791"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="581527358">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
<int key="NSCellFlags2">272760832</int>
|
||||
<string key="NSContents">This option causes marked text to be rendered like normal text which is very convenient when using a complex input method (e.g. Kotoeri). However, it has some known limitations which may be circumvented by disabling this option (e.g. mapping to "dead keys" may not work). Note that without this option the experimental renderer will not draw marked text at all.</string>
|
||||
<reference key="NSSupport" ref="26"/>
|
||||
<reference key="NSControlView" ref="536705090"/>
|
||||
<reference key="NSBackgroundColor" ref="821672772"/>
|
||||
<object class="NSColor" key="NSTextColor" id="1006868929">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="747671808">
|
||||
<reference key="NSNextResponder" ref="836854791"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{18, 132}, {190, 18}}</string>
|
||||
<string key="NSFrame">{{18, 228}, {190, 18}}</string>
|
||||
<reference key="NSSuperview" ref="836854791"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="266098397">
|
||||
@@ -970,7 +779,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<object class="NSTextField" id="864999293">
|
||||
<reference key="NSNextResponder" ref="836854791"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 102}, {449, 28}}</string>
|
||||
<string key="NSFrame">{{17, 198}, {449, 28}}</string>
|
||||
<reference key="NSSuperview" ref="836854791"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="526715553">
|
||||
@@ -980,16 +789,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<reference key="NSSupport" ref="26"/>
|
||||
<reference key="NSControlView" ref="864999293"/>
|
||||
<reference key="NSBackgroundColor" ref="821672772"/>
|
||||
<object class="NSColor" key="NSTextColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
<reference key="NSTextColor" ref="1006868929"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="538640217">
|
||||
<reference key="NSNextResponder" ref="836854791"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{18, 78}, {133, 18}}</string>
|
||||
<string key="NSFrame">{{18, 174}, {133, 18}}</string>
|
||||
<reference key="NSSuperview" ref="836854791"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="1057999425">
|
||||
@@ -1011,7 +817,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<object class="NSTextField" id="202792916">
|
||||
<reference key="NSNextResponder" ref="836854791"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 20}, {449, 56}}</string>
|
||||
<string key="NSFrame">{{17, 116}, {449, 56}}</string>
|
||||
<reference key="NSSuperview" ref="836854791"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="894089534">
|
||||
@@ -1031,7 +837,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{483, 168}</string>
|
||||
<string key="NSFrameSize">{483, 264}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
@@ -1078,62 +884,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
</object>
|
||||
<int key="connectionID">171</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">integrationPreferences</string>
|
||||
<reference key="source" ref="816709129"/>
|
||||
<reference key="destination" ref="443205242"/>
|
||||
</object>
|
||||
<int key="connectionID">192</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">editors</string>
|
||||
<reference key="source" ref="816709129"/>
|
||||
<reference key="destination" ref="635472630"/>
|
||||
</object>
|
||||
<int key="connectionID">222</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">installOdbButton</string>
|
||||
<reference key="source" ref="816709129"/>
|
||||
<reference key="destination" ref="249474193"/>
|
||||
</object>
|
||||
<int key="connectionID">245</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">uninstallOdbButton</string>
|
||||
<reference key="source" ref="816709129"/>
|
||||
<reference key="destination" ref="841479415"/>
|
||||
</object>
|
||||
<int key="connectionID">246</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">uninstallOdb:</string>
|
||||
<reference key="source" ref="816709129"/>
|
||||
<reference key="destination" ref="841479415"/>
|
||||
</object>
|
||||
<int key="connectionID">266</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">installOdb:</string>
|
||||
<reference key="source" ref="816709129"/>
|
||||
<reference key="destination" ref="249474193"/>
|
||||
</object>
|
||||
<int key="connectionID">286</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">obdBundleVersionLabel</string>
|
||||
<reference key="source" ref="816709129"/>
|
||||
<reference key="destination" ref="548095870"/>
|
||||
</object>
|
||||
<int key="connectionID">308</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">selectedTag: values.MMOpenLayout</string>
|
||||
@@ -1274,6 +1024,22 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
</object>
|
||||
<int key="connectionID">1000</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">value: values.MMUseInlineIm</string>
|
||||
<reference key="source" ref="818542525"/>
|
||||
<reference key="destination" ref="547503666"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="818542525"/>
|
||||
<reference key="NSDestination" ref="547503666"/>
|
||||
<string key="NSLabel">value: values.MMUseInlineIm</string>
|
||||
<string key="NSBinding">value</string>
|
||||
<string key="NSKeyPath">values.MMUseInlineIm</string>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">1016</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
@@ -1435,32 +1201,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
</array>
|
||||
<reference key="parent" ref="225936320"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">191</int>
|
||||
<reference key="object" ref="443205242"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="1041056912"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">Integration</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">213</int>
|
||||
<reference key="object" ref="1041056912"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="841479415"/>
|
||||
<reference ref="799826912"/>
|
||||
<reference ref="635472630"/>
|
||||
<reference ref="249474193"/>
|
||||
<reference ref="548095870"/>
|
||||
<reference ref="664524879"/>
|
||||
<reference ref="808161291"/>
|
||||
<reference ref="228008295"/>
|
||||
<reference ref="627992137"/>
|
||||
<reference ref="554064415"/>
|
||||
</array>
|
||||
<reference key="parent" ref="443205242"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">620</int>
|
||||
<reference key="object" ref="836854791"/>
|
||||
@@ -1469,6 +1209,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<reference ref="538640217"/>
|
||||
<reference ref="864999293"/>
|
||||
<reference ref="747671808"/>
|
||||
<reference ref="536705090"/>
|
||||
<reference ref="818542525"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">Advanced</string>
|
||||
@@ -1638,148 +1380,41 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<reference key="parent" ref="249595117"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">195</int>
|
||||
<reference key="object" ref="841479415"/>
|
||||
<int key="objectID">1001</int>
|
||||
<reference key="object" ref="536705090"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="624692609"/>
|
||||
<reference ref="581527358"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1041056912"/>
|
||||
<reference key="parent" ref="836854791"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">981</int>
|
||||
<reference key="object" ref="624692609"/>
|
||||
<reference key="parent" ref="841479415"/>
|
||||
<int key="objectID">1004</int>
|
||||
<reference key="object" ref="581527358"/>
|
||||
<reference key="parent" ref="536705090"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">211</int>
|
||||
<reference key="object" ref="799826912"/>
|
||||
<int key="objectID">1013</int>
|
||||
<reference key="object" ref="818542525"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="10311595"/>
|
||||
<reference ref="948343868"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1041056912"/>
|
||||
<reference key="parent" ref="836854791"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">983</int>
|
||||
<reference key="object" ref="10311595"/>
|
||||
<reference key="parent" ref="799826912"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">201</int>
|
||||
<reference key="object" ref="635472630"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="545964422"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1041056912"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">982</int>
|
||||
<reference key="object" ref="545964422"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="89589003"/>
|
||||
</array>
|
||||
<reference key="parent" ref="635472630"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">203</int>
|
||||
<reference key="object" ref="89589003"/>
|
||||
<reference key="parent" ref="545964422"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">193</int>
|
||||
<reference key="object" ref="249474193"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="213101514"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1041056912"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">980</int>
|
||||
<reference key="object" ref="213101514"/>
|
||||
<reference key="parent" ref="249474193"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">306</int>
|
||||
<reference key="object" ref="548095870"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="982688187"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1041056912"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">984</int>
|
||||
<reference key="object" ref="982688187"/>
|
||||
<reference key="parent" ref="548095870"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">334</int>
|
||||
<reference key="object" ref="664524879"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="906295134"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1041056912"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">985</int>
|
||||
<reference key="object" ref="906295134"/>
|
||||
<reference key="parent" ref="664524879"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">336</int>
|
||||
<reference key="object" ref="808161291"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="760604180"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1041056912"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">986</int>
|
||||
<reference key="object" ref="760604180"/>
|
||||
<reference key="parent" ref="808161291"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">338</int>
|
||||
<reference key="object" ref="228008295"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="979053968"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1041056912"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">987</int>
|
||||
<reference key="object" ref="979053968"/>
|
||||
<reference key="parent" ref="228008295"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">340</int>
|
||||
<reference key="object" ref="627992137"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="641980577"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1041056912"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">988</int>
|
||||
<reference key="object" ref="641980577"/>
|
||||
<reference key="parent" ref="627992137"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">367</int>
|
||||
<reference key="object" ref="554064415"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="483958140"/>
|
||||
</array>
|
||||
<reference key="parent" ref="1041056912"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">989</int>
|
||||
<reference key="object" ref="483958140"/>
|
||||
<reference key="parent" ref="554064415"/>
|
||||
<int key="objectID">1014</int>
|
||||
<reference key="object" ref="948343868"/>
|
||||
<reference key="parent" ref="818542525"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="-3.ImportedFromIB2"/>
|
||||
<string key="1001.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="1001.ImportedFromIB2"/>
|
||||
<string key="1004.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1013.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="1014.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="115.IBEditorWindowLastContentRect">{{329, 705}, {483, 290}}</string>
|
||||
<string key="115.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="115.ImportedFromIB2"/>
|
||||
@@ -1809,32 +1444,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<boolean value="YES" key="138.ImportedFromIB2"/>
|
||||
<string key="139.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="139.ImportedFromIB2"/>
|
||||
<string key="191.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="191.ImportedFromIB2"/>
|
||||
<string key="193.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="193.ImportedFromIB2"/>
|
||||
<string key="195.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="195.ImportedFromIB2"/>
|
||||
<string key="201.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="201.ImportedFromIB2"/>
|
||||
<string key="203.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="203.ImportedFromIB2"/>
|
||||
<string key="211.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="211.ImportedFromIB2"/>
|
||||
<string key="213.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="213.ImportedFromIB2"/>
|
||||
<string key="306.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="306.ImportedFromIB2"/>
|
||||
<string key="334.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="334.ImportedFromIB2"/>
|
||||
<string key="336.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="336.ImportedFromIB2"/>
|
||||
<string key="338.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="338.ImportedFromIB2"/>
|
||||
<string key="340.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="340.ImportedFromIB2"/>
|
||||
<string key="367.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="367.ImportedFromIB2"/>
|
||||
<string key="427.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="427.ImportedFromIB2"/>
|
||||
<string key="429.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -1849,7 +1458,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<boolean value="YES" key="544.ImportedFromIB2"/>
|
||||
<string key="58.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="58.ImportedFromIB2"/>
|
||||
<string key="620.IBEditorWindowLastContentRect">{{329, 804}, {483, 168}}</string>
|
||||
<string key="620.IBEditorWindowLastContentRect">{{605, 600}, {483, 264}}</string>
|
||||
<string key="620.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES" key="620.ImportedFromIB2"/>
|
||||
<string key="782.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -1878,16 +1487,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<string key="977.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="978.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="979.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="980.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="981.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="982.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="983.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="984.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="985.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="986.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="987.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="988.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="989.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="990.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="991.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="992.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -1899,7 +1498,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">1000</int>
|
||||
<int key="maxID">1016</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
@@ -1935,20 +1534,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MMPreferenceController</string>
|
||||
<string key="superclassName">DBPrefsWindowController</string>
|
||||
<dictionary class="NSMutableDictionary" key="actions">
|
||||
<string key="installOdb:">id</string>
|
||||
<string key="openInCurrentWindowSelectionChanged:">id</string>
|
||||
<string key="uninstallOdb:">id</string>
|
||||
</dictionary>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<string key="NS.key.0">openInCurrentWindowSelectionChanged:</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="outlets">
|
||||
<string key="advancedPreferences">NSView</string>
|
||||
<string key="editors">NSPopUpButton</string>
|
||||
<string key="generalPreferences">NSView</string>
|
||||
<string key="installOdbButton">NSButton</string>
|
||||
<string key="integrationPreferences">NSView</string>
|
||||
<string key="layoutPopUpButton">NSPopUpButton</string>
|
||||
<string key="obdBundleVersionLabel">NSTextField</string>
|
||||
<string key="uninstallOdbButton">NSButton</string>
|
||||
</dictionary>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
@@ -1984,68 +1577,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PlugInInterface.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<dictionary class="NSMutableDictionary" key="actions">
|
||||
<string key="didAdjustSubviews:">RBSplitView</string>
|
||||
<string key="willAdjustSubviews:">RBSplitView</string>
|
||||
</dictionary>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="120214458">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">RBSplitView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBUserSource</string>
|
||||
<string key="minorKey"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">RBSplitSubview</string>
|
||||
<string key="superclassName">NSView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">RBSplitSubview.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">RBSplitSubview</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="119043790">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">RBSplitViewPrivateDefines.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">RBSplitSubview</string>
|
||||
<string key="superclassName">NSView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBUserSource</string>
|
||||
<string key="minorKey"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">RBSplitView</string>
|
||||
<string key="superclassName">RBSplitSubview</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">delegate</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<reference key="sourceIdentifier" ref="120214458"/>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">RBSplitView</string>
|
||||
<reference key="sourceIdentifier" ref="119043790"/>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">RBSplitView</string>
|
||||
<string key="superclassName">RBSplitSubview</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBUserSource</string>
|
||||
<string key="minorKey"/>
|
||||
@@ -2104,14 +1635,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSBox</string>
|
||||
<string key="superclassName">NSView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSBox.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSButton</string>
|
||||
<string key="superclassName">NSControl</string>
|
||||
@@ -2551,12 +2074,18 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
|
||||
</array>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
|
||||
<integer value="1050" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<string key="IBDocument.LastKnownRelativeProjectPath">../../MacVim.xcodeproj</string>
|
||||
<string key="IBDocument.LastKnownRelativeProjectPath">../MacVim.xcodeproj</string>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
|
||||
<string key="NSMenuCheckmark">{9, 8}</string>
|
||||
<string key="NSMenuMixedState">{7, 2}</string>
|
||||
<string key="NSSwitch">{15, 15}</string>
|
||||
</dictionary>
|
||||
</data>
|
||||
</archive>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 1010 B |
@@ -35,10 +35,6 @@
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
FSEventStreamRef fsEventStream;
|
||||
#endif
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
NSMenuItem *plugInMenuItem;
|
||||
#endif
|
||||
}
|
||||
|
||||
+ (MMAppController *)sharedInstance;
|
||||
@@ -51,12 +47,6 @@
|
||||
- (NSArray *)filterOpenFiles:(NSArray *)filenames;
|
||||
- (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args;
|
||||
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
- (void)addItemToPlugInMenu:(NSMenuItem *)item;
|
||||
- (void)removeItemFromPlugInMenu:(NSMenuItem *)item;
|
||||
#endif
|
||||
|
||||
- (IBAction)newWindow:(id)sender;
|
||||
- (IBAction)newWindowAndActivate:(id)sender;
|
||||
- (IBAction)fileOpen:(id)sender;
|
||||
|
||||
@@ -42,11 +42,6 @@
|
||||
#import "MMVimController.h"
|
||||
#import "MMWindowController.h"
|
||||
#import "Miscellaneous.h"
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
#import "MMPlugInManager.h"
|
||||
#endif
|
||||
|
||||
#import <unistd.h>
|
||||
#import <CoreServices/CoreServices.h>
|
||||
|
||||
@@ -142,11 +137,6 @@ typedef struct
|
||||
toCommandLine:(NSArray **)cmdline;
|
||||
- (NSString *)workingDirectoryForArguments:(NSDictionary *)args;
|
||||
- (NSScreen *)screenContainingPoint:(NSPoint)pt;
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
- (void)removePlugInMenu;
|
||||
- (void)addPlugInMenuToMenu:(NSMenu *)mainMenu;
|
||||
#endif
|
||||
@end
|
||||
|
||||
|
||||
@@ -216,9 +206,6 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
@"", MMLoginShellCommandKey,
|
||||
@"", MMLoginShellArgumentKey,
|
||||
[NSNumber numberWithBool:YES], MMDialogsTrackPwdKey,
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
[NSNumber numberWithBool:YES], MMShowLeftPlugInContainerKey,
|
||||
#endif
|
||||
[NSNumber numberWithInt:3], MMOpenLayoutKey,
|
||||
[NSNumber numberWithBool:NO], MMVerticalSplitKey,
|
||||
[NSNumber numberWithInt:0], MMPreloadCacheSizeKey,
|
||||
@@ -253,17 +240,6 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
pidArguments = [NSMutableDictionary new];
|
||||
inputQueues = [NSMutableDictionary new];
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
NSString *plugInTitle = NSLocalizedString(@"Plug-In",
|
||||
@"Plug-In menu title");
|
||||
plugInMenuItem = [[NSMenuItem alloc] initWithTitle:plugInTitle
|
||||
action:NULL
|
||||
keyEquivalent:@""];
|
||||
NSMenu *submenu = [[NSMenu alloc] initWithTitle:plugInTitle];
|
||||
[plugInMenuItem setSubmenu:submenu];
|
||||
[submenu release];
|
||||
#endif
|
||||
|
||||
// NOTE: Do not use the default connection since the Logitech Control
|
||||
// Center (LCC) input manager steals and this would cause MacVim to
|
||||
// never open any windows. (This is a bug in LCC but since they are
|
||||
@@ -298,9 +274,6 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
[openSelectionString release]; openSelectionString = nil;
|
||||
[recentFilesMenuItem release]; recentFilesMenuItem = nil;
|
||||
[defaultMainMenu release]; defaultMainMenu = nil;
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
[plugInMenuItem release]; plugInMenuItem = nil;
|
||||
#endif
|
||||
[appMenuItemTemplate release]; appMenuItemTemplate = nil;
|
||||
|
||||
[super dealloc];
|
||||
@@ -399,9 +372,6 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)notification
|
||||
{
|
||||
[NSApp setServicesProvider:self];
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
[[MMPlugInManager sharedManager] loadAllPlugIns];
|
||||
#endif
|
||||
|
||||
if ([self maxPreloadCacheSize] > 0) {
|
||||
[self scheduleVimControllerPreloadAfterDelay:2];
|
||||
@@ -633,10 +603,6 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
|
||||
[self stopWatchingVimDir];
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
[[MMPlugInManager sharedManager] unloadAllPlugIns];
|
||||
#endif
|
||||
|
||||
#if MM_HANDLE_XCODE_MOD_EVENT
|
||||
[[NSAppleEventManager sharedAppleEventManager]
|
||||
removeEventHandlerForEventClass:'KAHL'
|
||||
@@ -889,12 +855,6 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
}
|
||||
}
|
||||
[NSApp setWindowsMenu:windowsMenu];
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
// Move plugin menu from old to new main menu.
|
||||
[self removePlugInMenu];
|
||||
[self addPlugInMenuToMenu:mainMenu];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (NSArray *)filterOpenFiles:(NSArray *)filenames
|
||||
@@ -1052,24 +1012,6 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
return openOk;
|
||||
}
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
- (void)addItemToPlugInMenu:(NSMenuItem *)item
|
||||
{
|
||||
NSMenu *menu = [plugInMenuItem submenu];
|
||||
[menu addItem:item];
|
||||
if ([menu numberOfItems] == 1)
|
||||
[self addPlugInMenuToMenu:[NSApp mainMenu]];
|
||||
}
|
||||
|
||||
- (void)removeItemFromPlugInMenu:(NSMenuItem *)item
|
||||
{
|
||||
NSMenu *menu = [plugInMenuItem submenu];
|
||||
[menu removeItem:item];
|
||||
if ([menu numberOfItems] == 0)
|
||||
[self removePlugInMenu];
|
||||
}
|
||||
#endif
|
||||
|
||||
- (IBAction)newWindow:(id)sender
|
||||
{
|
||||
ASLogDebug(@"Open new window");
|
||||
@@ -1810,29 +1752,6 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
return dict;
|
||||
}
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
- (void)removePlugInMenu
|
||||
{
|
||||
if ([plugInMenuItem menu])
|
||||
[[plugInMenuItem menu] removeItem:plugInMenuItem];
|
||||
}
|
||||
|
||||
- (void)addPlugInMenuToMenu:(NSMenu *)mainMenu
|
||||
{
|
||||
NSMenu *windowsMenu = [mainMenu findWindowsMenu];
|
||||
|
||||
if ([[plugInMenuItem submenu] numberOfItems] > 0) {
|
||||
int idx = windowsMenu ? [mainMenu indexOfItemWithSubmenu:windowsMenu]
|
||||
: -1;
|
||||
if (idx > 0) {
|
||||
[mainMenu insertItem:plugInMenuItem atIndex:idx];
|
||||
} else {
|
||||
[mainMenu addItem:plugInMenuItem];
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
- (void)scheduleVimControllerPreloadAfterDelay:(NSTimeInterval)delay
|
||||
{
|
||||
[self performSelector:@selector(preloadVimController:)
|
||||
|
||||
@@ -69,6 +69,7 @@ enum { MMMaxCellsPerChar = 2 };
|
||||
// MMTextView methods
|
||||
//
|
||||
- (void)deleteSign:(NSString *)signName;
|
||||
- (void)setToolTipAtMousePoint:(NSString *)string;
|
||||
- (void)setPreEditRow:(int)row column:(int)col;
|
||||
- (void)setMouseShape:(int)shape;
|
||||
- (void)setAntialias:(BOOL)state;
|
||||
|
||||
@@ -338,6 +338,12 @@ defaultLineHeightForFont(NSFont *font)
|
||||
|
||||
- (void)deleteSign:(NSString *)signName
|
||||
{
|
||||
// ONLY in Core Text!
|
||||
}
|
||||
|
||||
- (void)setToolTipAtMousePoint:(NSString *)string
|
||||
{
|
||||
// ONLY in Core Text!
|
||||
}
|
||||
|
||||
- (void)setPreEditRow:(int)row column:(int)col
|
||||
@@ -481,32 +487,6 @@ defaultLineHeightForFont(NSFont *font)
|
||||
[helper mouseMoved:event];
|
||||
}
|
||||
|
||||
- (void)mouseEntered:(NSEvent *)event
|
||||
{
|
||||
[helper mouseEntered:event];
|
||||
}
|
||||
|
||||
- (void)mouseExited:(NSEvent *)event
|
||||
{
|
||||
[helper mouseExited:event];
|
||||
}
|
||||
|
||||
- (void)setFrame:(NSRect)frame
|
||||
{
|
||||
[super setFrame:frame];
|
||||
[helper setFrame:frame];
|
||||
}
|
||||
|
||||
- (void)viewDidMoveToWindow
|
||||
{
|
||||
[helper viewDidMoveToWindow];
|
||||
}
|
||||
|
||||
- (void)viewWillMoveToWindow:(NSWindow *)newWindow
|
||||
{
|
||||
[helper viewWillMoveToWindow:newWindow];
|
||||
}
|
||||
|
||||
- (NSMenu*)menuForEvent:(NSEvent *)event
|
||||
{
|
||||
// HACK! Return nil to disable default popup menus (Vim provides its own).
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
#import "vim.h"
|
||||
|
||||
|
||||
#ifdef FEAT_BEVAL
|
||||
// Seconds to delay balloon evaluation after mouse event (subtracted from
|
||||
// p_bdlay).
|
||||
extern NSTimeInterval MMBalloonEvalInternalDelay;
|
||||
#endif
|
||||
|
||||
|
||||
@interface MMBackend : NSObject <MMBackendProtocol, MMVimServerProtocol,
|
||||
@@ -55,6 +60,9 @@
|
||||
CFRunLoopSourceRef netbeansRunLoopSource;
|
||||
int winposX;
|
||||
int winposY;
|
||||
#ifdef FEAT_BEVAL
|
||||
NSString *lastToolTip;
|
||||
#endif
|
||||
}
|
||||
|
||||
+ (MMBackend *)sharedInstance;
|
||||
@@ -150,6 +158,10 @@
|
||||
- (void)messageFromNetbeans;
|
||||
- (void)setNetbeansSocket:(int)socket;
|
||||
|
||||
#ifdef FEAT_BEVAL
|
||||
- (void)setLastToolTip:(NSString *)toolTip;
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
+65
-1
@@ -46,6 +46,12 @@
|
||||
|
||||
static unsigned MMServerMax = 1000;
|
||||
|
||||
#ifdef FEAT_BEVAL
|
||||
// Seconds to delay balloon evaluation after mouse event (subtracted from
|
||||
// p_bdlay so that this effectively becomes the smallest possible delay).
|
||||
NSTimeInterval MMBalloonEvalInternalDelay = 0.1;
|
||||
#endif
|
||||
|
||||
// TODO: Move to separate file.
|
||||
static int eventModifierFlagsToVimModMask(int modifierFlags);
|
||||
static int eventModifierFlagsToVimMouseModMask(int modifierFlags);
|
||||
@@ -152,7 +158,6 @@ static struct specialkey
|
||||
extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
|
||||
|
||||
|
||||
@interface NSString (MMServerNameCompare)
|
||||
- (NSComparisonResult)serverNameCompare:(NSString *)string;
|
||||
@end
|
||||
@@ -192,6 +197,9 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
- (void)redrawScreen;
|
||||
- (void)handleFindReplace:(NSDictionary *)args;
|
||||
- (void)handleMarkedText:(NSData *)data;
|
||||
#ifdef FEAT_BEVAL
|
||||
- (void)bevalCallback:(id)sender;
|
||||
#endif
|
||||
@end
|
||||
|
||||
|
||||
@@ -268,6 +276,9 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
[sysColorDict release]; sysColorDict = nil;
|
||||
[colorDict release]; colorDict = nil;
|
||||
[vimServerConnection release]; vimServerConnection = nil;
|
||||
#ifdef FEAT_BEVAL
|
||||
[lastToolTip release]; lastToolTip = nil;
|
||||
#endif
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
@@ -1669,6 +1680,16 @@ static void netbeansReadCallback(CFSocketRef s,
|
||||
kCFRunLoopCommonModes);
|
||||
}
|
||||
|
||||
#ifdef FEAT_BEVAL
|
||||
- (void)setLastToolTip:(NSString *)toolTip
|
||||
{
|
||||
if (toolTip != lastToolTip) {
|
||||
[lastToolTip release];
|
||||
lastToolTip = [toolTip copy];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@end // MMBackend
|
||||
|
||||
|
||||
@@ -1891,6 +1912,22 @@ static void netbeansReadCallback(CFSocketRef s,
|
||||
int col = *((int*)bytes); bytes += sizeof(int);
|
||||
|
||||
gui_mouse_moved(col, row);
|
||||
|
||||
#ifdef FEAT_BEVAL
|
||||
if (p_beval && balloonEval) {
|
||||
balloonEval->x = col;
|
||||
balloonEval->y = row;
|
||||
|
||||
// Update the balloon eval message after a slight delay (to avoid
|
||||
// calling it too often).
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self
|
||||
selector:@selector(bevalCallback:)
|
||||
object:nil];
|
||||
[self performSelector:@selector(bevalCallback:)
|
||||
withObject:nil
|
||||
afterDelay:MMBalloonEvalInternalDelay];
|
||||
}
|
||||
#endif
|
||||
} else if (AddInputMsgID == msgid) {
|
||||
NSString *string = [[NSString alloc] initWithData:data
|
||||
encoding:NSUTF8StringEncoding];
|
||||
@@ -2894,6 +2931,33 @@ static void netbeansReadCallback(CFSocketRef s,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FEAT_BEVAL
|
||||
- (void)bevalCallback:(id)sender
|
||||
{
|
||||
if (!(p_beval && balloonEval))
|
||||
return;
|
||||
|
||||
if (balloonEval->msgCB != NULL) {
|
||||
// HACK! We have no way of knowing whether the balloon evaluation
|
||||
// worked or not, so we keep track of it using a local tool tip
|
||||
// variable. (The reason we need to know is due to how the Cocoa tool
|
||||
// tips work: if there is no tool tip we must set it to nil explicitly
|
||||
// or it might never go away.)
|
||||
[self setLastToolTip:nil];
|
||||
|
||||
(*balloonEval->msgCB)(balloonEval, 0);
|
||||
|
||||
[[MMBackend sharedInstance] queueMessage:SetTooltipMsgID properties:
|
||||
[NSDictionary dictionaryWithObject:(lastToolTip ? lastToolTip : @"")
|
||||
forKey:@"toolTip"]];
|
||||
|
||||
// NOTE: We have to explicitly stop the run loop since timer events do
|
||||
// not cause CFRunLoopRunInMode() to exit.
|
||||
CFRunLoopStop(CFRunLoopGetCurrent());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@end // MMBackend (Private)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
/* vi:set ts=8 sts=4 sw=4 ft=objc:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
/*
|
||||
* MMCoreTextView+ToolTip
|
||||
*
|
||||
* Cocoa's tool tip interface does not allow changing the tool tip without the
|
||||
* user moving the mouse outside the view and then back again. This category
|
||||
* takes care of this problem.
|
||||
*
|
||||
* The tool tip code was borrowed from the Chromium project which in turn had
|
||||
* borrowed it from WebKit (copyright and comments are below). Some minor
|
||||
* changes were made to adapt the code to MacVim.
|
||||
*/
|
||||
|
||||
#import "MMCoreTextView.h"
|
||||
|
||||
|
||||
// Below is the nasty tooltip stuff -- copied from WebKit's WebHTMLView.mm
|
||||
// with minor modifications for code style and commenting.
|
||||
//
|
||||
// The 'public' interface is -setToolTipAtMousePoint:. This differs from
|
||||
// -setToolTip: in that the updated tooltip takes effect immediately,
|
||||
// without the user's having to move the mouse out of and back into the view.
|
||||
//
|
||||
// Unfortunately, doing this requires sending fake mouseEnter/Exit events to
|
||||
// the view, which in turn requires overriding some internal tracking-rect
|
||||
// methods (to keep track of its owner & userdata, which need to be filled out
|
||||
// in the fake events.) --snej 7/6/09
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
|
||||
* (C) 2006, 2007 Graham Dennis (graham.dennis@gmail.com)
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. 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.
|
||||
* 3. Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
|
||||
*/
|
||||
|
||||
// Any non-zero value will do, but using something recognizable might help us
|
||||
// debug some day.
|
||||
static const NSTrackingRectTag kTrackingRectTag = 0xBADFACE;
|
||||
|
||||
|
||||
@implementation MMCoreTextView (ToolTip)
|
||||
|
||||
// Override of a public NSView method, replacing the inherited functionality.
|
||||
// See above for rationale.
|
||||
- (NSTrackingRectTag)addTrackingRect:(NSRect)rect
|
||||
owner:(id)owner
|
||||
userData:(void *)data
|
||||
assumeInside:(BOOL)assumeInside
|
||||
{
|
||||
//DCHECK(trackingRectOwner_ == nil);
|
||||
trackingRectOwner_ = owner;
|
||||
trackingRectUserData_ = data;
|
||||
return kTrackingRectTag;
|
||||
}
|
||||
|
||||
// Override of (apparently) a private NSView method(!) See above for rationale.
|
||||
- (NSTrackingRectTag)_addTrackingRect:(NSRect)rect
|
||||
owner:(id)owner
|
||||
userData:(void *)data
|
||||
assumeInside:(BOOL)assumeInside
|
||||
useTrackingNum:(int)tag
|
||||
{
|
||||
//DCHECK(tag == 0 || tag == kTrackingRectTag);
|
||||
//DCHECK(trackingRectOwner_ == nil);
|
||||
trackingRectOwner_ = owner;
|
||||
trackingRectUserData_ = data;
|
||||
return kTrackingRectTag;
|
||||
}
|
||||
|
||||
// Override of (apparently) a private NSView method(!) See above for rationale.
|
||||
- (void)_addTrackingRects:(NSRect *)rects
|
||||
owner:(id)owner
|
||||
userDataList:(void **)userDataList
|
||||
assumeInsideList:(BOOL *)assumeInsideList
|
||||
trackingNums:(NSTrackingRectTag *)trackingNums
|
||||
count:(int)count
|
||||
{
|
||||
//DCHECK(count == 1);
|
||||
//DCHECK(trackingNums[0] == 0 || trackingNums[0] == kTrackingRectTag);
|
||||
//DCHECK(trackingRectOwner_ == nil);
|
||||
trackingRectOwner_ = owner;
|
||||
trackingRectUserData_ = userDataList[0];
|
||||
trackingNums[0] = kTrackingRectTag;
|
||||
}
|
||||
|
||||
// Override of a public NSView method, replacing the inherited functionality.
|
||||
// See above for rationale.
|
||||
- (void)removeTrackingRect:(NSTrackingRectTag)tag
|
||||
{
|
||||
if (tag == 0)
|
||||
return;
|
||||
|
||||
if (tag == kTrackingRectTag) {
|
||||
trackingRectOwner_ = nil;
|
||||
return;
|
||||
}
|
||||
|
||||
if (tag == lastToolTipTag_) {
|
||||
[super removeTrackingRect:tag];
|
||||
lastToolTipTag_ = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// If any other tracking rect is being removed, we don't know how it was
|
||||
// created and it's possible there's a leak involved (see Radar 3500217).
|
||||
//NOTREACHED();
|
||||
}
|
||||
|
||||
// Override of (apparently) a private NSView method(!)
|
||||
- (void)_removeTrackingRects:(NSTrackingRectTag *)tags count:(int)count
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < count; ++i) {
|
||||
int tag = tags[i];
|
||||
if (tag == 0)
|
||||
continue;
|
||||
//DCHECK(tag == kTrackingRectTag);
|
||||
trackingRectOwner_ = nil;
|
||||
}
|
||||
}
|
||||
|
||||
// Sends a fake NSMouseExited event to the view for its current tracking rect.
|
||||
- (void)_sendToolTipMouseExited
|
||||
{
|
||||
// Nothing matters except window, trackingNumber, and userData.
|
||||
int windowNumber = [[self window] windowNumber];
|
||||
NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSMouseExited
|
||||
location:NSMakePoint(0, 0)
|
||||
modifierFlags:0
|
||||
timestamp:0
|
||||
windowNumber:windowNumber
|
||||
context:NULL
|
||||
eventNumber:0
|
||||
trackingNumber:kTrackingRectTag
|
||||
userData:trackingRectUserData_];
|
||||
[trackingRectOwner_ mouseExited:fakeEvent];
|
||||
}
|
||||
|
||||
// Sends a fake NSMouseEntered event to the view for its current tracking rect.
|
||||
- (void)_sendToolTipMouseEntered
|
||||
{
|
||||
// Nothing matters except window, trackingNumber, and userData.
|
||||
int windowNumber = [[self window] windowNumber];
|
||||
NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSMouseEntered
|
||||
location:NSMakePoint(0, 0)
|
||||
modifierFlags:0
|
||||
timestamp:0
|
||||
windowNumber:windowNumber
|
||||
context:NULL
|
||||
eventNumber:0
|
||||
trackingNumber:kTrackingRectTag
|
||||
userData:trackingRectUserData_];
|
||||
[trackingRectOwner_ mouseEntered:fakeEvent];
|
||||
}
|
||||
|
||||
// Sets the view's current tooltip, to be displayed at the current mouse
|
||||
// location. (This does not make the tooltip appear -- as usual, it only
|
||||
// appears after a delay.) Pass null to remove the tooltip.
|
||||
- (void)setToolTipAtMousePoint:(NSString *)string
|
||||
{
|
||||
// If the mouse is outside the view, then clear the tooltip (otherwise the
|
||||
// tooltip may appear outside the view which looks weird!).
|
||||
NSPoint pt = [[self window] mouseLocationOutsideOfEventStream];
|
||||
if (!NSMouseInRect([self convertPoint:pt fromView:nil], [self frame], NO))
|
||||
string = nil;
|
||||
|
||||
NSString *toolTip = [string length] == 0 ? nil : string;
|
||||
NSString *oldToolTip = toolTip_;
|
||||
if ((toolTip == nil || oldToolTip == nil) ? toolTip == oldToolTip
|
||||
: [toolTip isEqualToString:oldToolTip]) {
|
||||
return;
|
||||
}
|
||||
if (oldToolTip) {
|
||||
[self _sendToolTipMouseExited];
|
||||
[oldToolTip release];
|
||||
}
|
||||
toolTip_ = [toolTip copy];
|
||||
if (toolTip) {
|
||||
// See radar 3500217 for why we remove all tooltips
|
||||
// rather than just the single one we created.
|
||||
[self removeAllToolTips];
|
||||
NSRect wideOpenRect = NSMakeRect(-100000, -100000, 200000, 200000);
|
||||
lastToolTipTag_ = [self addToolTipRect:wideOpenRect
|
||||
owner:self
|
||||
userData:NULL];
|
||||
[self _sendToolTipMouseEntered];
|
||||
}
|
||||
}
|
||||
|
||||
// NSView calls this to get the text when displaying the tooltip.
|
||||
- (NSString *)view:(NSView *)view
|
||||
stringForToolTip:(NSToolTipTag)tag
|
||||
point:(NSPoint)point
|
||||
userData:(void *)data
|
||||
{
|
||||
return [[toolTip_ copy] autorelease];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -38,6 +38,12 @@
|
||||
unsigned maxlen;
|
||||
CGGlyph *glyphs;
|
||||
CGSize *advances;
|
||||
|
||||
// These are used in MMCoreTextView+ToolTip.m
|
||||
id trackingRectOwner_; // (not retained)
|
||||
void *trackingRectUserData_;
|
||||
NSTrackingRectTag lastToolTipTag_;
|
||||
NSString* toolTip_;
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame;
|
||||
@@ -97,7 +103,14 @@
|
||||
- (NSSize)desiredSize;
|
||||
- (NSSize)minSize;
|
||||
- (NSSize)constrainRows:(int *)rows columns:(int *)cols toSize:(NSSize)size;
|
||||
@end
|
||||
|
||||
|
||||
//
|
||||
// This category is defined in MMCoreTextView+ToolTip.m
|
||||
//
|
||||
@interface MMCoreTextView (ToolTip)
|
||||
- (void)setToolTipAtMousePoint:(NSString *)string;
|
||||
@end
|
||||
|
||||
#endif // !MM_ENABLE_ATSUI
|
||||
|
||||
@@ -519,32 +519,6 @@ defaultAdvanceForFont(CTFontRef fontRef)
|
||||
[helper mouseMoved:event];
|
||||
}
|
||||
|
||||
- (void)mouseEntered:(NSEvent *)event
|
||||
{
|
||||
[helper mouseEntered:event];
|
||||
}
|
||||
|
||||
- (void)mouseExited:(NSEvent *)event
|
||||
{
|
||||
[helper mouseExited:event];
|
||||
}
|
||||
|
||||
- (void)setFrame:(NSRect)frame
|
||||
{
|
||||
[super setFrame:frame];
|
||||
[helper setFrame:frame];
|
||||
}
|
||||
|
||||
- (void)viewDidMoveToWindow
|
||||
{
|
||||
[helper viewDidMoveToWindow];
|
||||
}
|
||||
|
||||
- (void)viewWillMoveToWindow:(NSWindow *)newWindow
|
||||
{
|
||||
[helper viewWillMoveToWindow:newWindow];
|
||||
}
|
||||
|
||||
- (NSMenu*)menuForEvent:(NSEvent *)event
|
||||
{
|
||||
// HACK! Return nil to disable default popup menus (Vim provides its own).
|
||||
@@ -592,9 +566,6 @@ defaultAdvanceForFont(CTFontRef fontRef)
|
||||
|
||||
- (void)drawRect:(NSRect)rect
|
||||
{
|
||||
//ASLogTmp(@"count=%d rect=%@", [drawData count],
|
||||
// NSStringFromRect(rect));
|
||||
|
||||
NSGraphicsContext *context = [NSGraphicsContext currentContext];
|
||||
[context setShouldAntialias:antialias];
|
||||
|
||||
|
||||
@@ -89,6 +89,9 @@
|
||||
name:NSWindowDidResignMainNotification
|
||||
object:self];
|
||||
|
||||
// NOTE: Vim needs to process mouse moved events, so enable them here.
|
||||
[self setAcceptsMouseMovedEvents:YES];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/* vi:set ts=8 sts=4 sw=4 ft=objc:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "MMVimController.h"
|
||||
|
||||
|
||||
@interface MMPlugInManager : NSObject {
|
||||
|
||||
NSMutableArray *plugInClasses;
|
||||
}
|
||||
|
||||
- (NSArray *)plugInClasses;
|
||||
|
||||
// Find and load any plugins
|
||||
- (void)loadAllPlugIns;
|
||||
|
||||
// release instances of loaded plugins
|
||||
- (void)unloadAllPlugIns;
|
||||
|
||||
// Return singleton instance of MMPluginManager
|
||||
+ (MMPlugInManager *)sharedManager;
|
||||
|
||||
@end
|
||||
@@ -1,151 +0,0 @@
|
||||
/* vi:set ts=8 sts=4 sw=4 ft=objc:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* MMPlugInManager
|
||||
*
|
||||
* This class is responsible for finding MacVim plugins at startup, loading
|
||||
* them, and keeping track of them.
|
||||
*
|
||||
* Author: Matt Tolton
|
||||
*/
|
||||
|
||||
#import "MacVim.h"
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
|
||||
#import "MMPlugInManager.h"
|
||||
#import "PlugInInterface.h"
|
||||
#import "PlugInImpl.h"
|
||||
|
||||
@implementation MMPlugInManager
|
||||
|
||||
static NSString *ext = @"mmplugin";
|
||||
|
||||
static NSString *appSupportSubpath = @"Application Support/MacVim/PlugIns";
|
||||
|
||||
static MMPlugInManager *plugInManager = nil;
|
||||
|
||||
+ (MMPlugInManager*)sharedManager
|
||||
{
|
||||
if (!plugInManager)
|
||||
plugInManager = [[MMPlugInManager alloc] init];
|
||||
|
||||
return plugInManager;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init]) == nil) return nil;
|
||||
plugInClasses = [[NSMutableArray alloc] init];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
ASLogDebug(@"");
|
||||
|
||||
[plugInClasses release]; plugInClasses = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSArray *)plugInClasses;
|
||||
{
|
||||
return plugInClasses;
|
||||
}
|
||||
|
||||
- (NSMutableArray *)allBundles
|
||||
{
|
||||
NSArray *librarySearchPaths;
|
||||
NSEnumerator *searchPathEnum;
|
||||
NSString *currPath;
|
||||
NSMutableArray *bundleSearchPaths = [NSMutableArray array];
|
||||
NSMutableArray *allBundles = [NSMutableArray array];
|
||||
|
||||
librarySearchPaths = NSSearchPathForDirectoriesInDomains(
|
||||
NSLibraryDirectory, NSAllDomainsMask - NSSystemDomainMask, YES);
|
||||
|
||||
searchPathEnum = [librarySearchPaths objectEnumerator];
|
||||
while(currPath = [searchPathEnum nextObject]) {
|
||||
[bundleSearchPaths addObject:
|
||||
[currPath stringByAppendingPathComponent:appSupportSubpath]];
|
||||
}
|
||||
|
||||
[bundleSearchPaths addObject:
|
||||
[[NSBundle mainBundle] builtInPlugInsPath]];
|
||||
|
||||
searchPathEnum = [bundleSearchPaths objectEnumerator];
|
||||
while(currPath = [searchPathEnum nextObject]) {
|
||||
NSDirectoryEnumerator *bundleEnum;
|
||||
NSString *currBundlePath;
|
||||
bundleEnum = [[NSFileManager defaultManager]
|
||||
enumeratorAtPath:currPath];
|
||||
if(bundleEnum) {
|
||||
while(currBundlePath = [bundleEnum nextObject]) {
|
||||
if([[currBundlePath pathExtension] isEqualToString:ext]) {
|
||||
[allBundles addObject:[currPath
|
||||
stringByAppendingPathComponent:currBundlePath]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return allBundles;
|
||||
}
|
||||
|
||||
- (BOOL)plugInClassIsValid:(Class)class
|
||||
{
|
||||
return [class conformsToProtocol:@protocol(PlugInProtocol)];
|
||||
}
|
||||
|
||||
- (void)loadAllPlugIns
|
||||
{
|
||||
NSMutableArray *bundlePaths;
|
||||
NSEnumerator *pathEnum;
|
||||
NSString *currPath;
|
||||
NSBundle *currBundle;
|
||||
Class currPrincipalClass;
|
||||
|
||||
bundlePaths = [NSMutableArray array];
|
||||
|
||||
[bundlePaths addObjectsFromArray:[self allBundles]];
|
||||
|
||||
pathEnum = [bundlePaths objectEnumerator];
|
||||
while(currPath = [pathEnum nextObject]) {
|
||||
currBundle = [NSBundle bundleWithPath:currPath];
|
||||
if(currBundle) {
|
||||
currPrincipalClass = [currBundle principalClass];
|
||||
if(currPrincipalClass && [self plugInClassIsValid:currPrincipalClass]) {
|
||||
if ([currPrincipalClass initializePlugIn:
|
||||
[MMPlugInAppMediator sharedAppMediator]]) {
|
||||
ASLogInfo(@"Plug-in initialized: %@", currPath);
|
||||
[plugInClasses addObject:currPrincipalClass];
|
||||
} else {
|
||||
ASLogErr(@"Plug-in failed to initialize: %@", currPath);
|
||||
}
|
||||
} else {
|
||||
ASLogErr(@"Plug-in did not conform to protocol: %@", currPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)unloadAllPlugIns
|
||||
{
|
||||
int i, count = [plugInClasses count];
|
||||
for (i = 0; i < count; i++)
|
||||
[[plugInClasses objectAtIndex:i] terminatePlugIn];
|
||||
|
||||
[plugInClasses removeAllObjects];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -12,27 +12,14 @@
|
||||
#import <DBPrefsWindowController.h>
|
||||
|
||||
@interface MMPreferenceController : DBPrefsWindowController {
|
||||
|
||||
IBOutlet NSView *generalPreferences;
|
||||
IBOutlet NSView *integrationPreferences;
|
||||
IBOutlet NSView *advancedPreferences;
|
||||
|
||||
// General pane
|
||||
IBOutlet NSPopUpButton *layoutPopUpButton;
|
||||
|
||||
// Integration pane
|
||||
NSDictionary *supportedOdbEditors;
|
||||
IBOutlet NSPopUpButton *editors;
|
||||
IBOutlet NSButton *installOdbButton;
|
||||
IBOutlet NSButton *uninstallOdbButton;
|
||||
IBOutlet NSTextField* obdBundleVersionLabel;
|
||||
}
|
||||
|
||||
// General pane
|
||||
- (IBAction)openInCurrentWindowSelectionChanged:(id)sender;
|
||||
|
||||
// Integration pane
|
||||
- (IBAction)installOdb:(id)sender;
|
||||
- (IBAction)uninstallOdb:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
#import "AuthorizedShellCommand.h"
|
||||
#import "MMPreferenceController.h"
|
||||
#import "Miscellaneous.h"
|
||||
|
||||
@@ -26,9 +25,11 @@
|
||||
|
||||
#import <dlfcn.h>
|
||||
|
||||
|
||||
NSString* nsImageNamePreferencesGeneral = nil;
|
||||
NSString* nsImageNamePreferencesAdvanced = nil;
|
||||
|
||||
|
||||
static void loadSymbols()
|
||||
{
|
||||
// use dlfcn() instead of the deprecated NSModule api.
|
||||
@@ -40,120 +41,8 @@ static void loadSymbols()
|
||||
}
|
||||
|
||||
|
||||
// The compiler on OS X 10.4 balks at using CFSTR() for globals so we get
|
||||
// around with this some ugly type casting.
|
||||
static CFStringRef ODBEDITOR = (CFStringRef)@"org.slashpunt.edit_in_odbeditor";
|
||||
static CFStringRef ODB_BUNDLE_IDENTIFIER =
|
||||
(CFStringRef)@"ODBEditorBundleIdentifier";
|
||||
static CFStringRef ODB_EDITOR_NAME = (CFStringRef)@"ODBEditorName";
|
||||
static NSString *ODBEDITOR_DIR =
|
||||
@"/Library/InputManagers/Edit in ODBEditor";
|
||||
static NSString *ODBEDITOR_PATH =
|
||||
@"/Library/InputManagers/Edit in ODBEditor/Edit in ODBEditor.bundle";
|
||||
|
||||
|
||||
NSString *kOdbEditorNameNone = @"(None)";
|
||||
NSString *kOdbEditorIdentifierNone = @"";
|
||||
|
||||
NSString *kOdbEditorNameBBEdit = @"BBEdit";
|
||||
NSString *kOdbEditorIdentifierBBEdit = @"com.barebones.bbedit";
|
||||
|
||||
NSString *kOdbEditorNameCSSEdit = @"CSSEdit";
|
||||
NSString *kOdbEditorIdentifierCSSEdit = @"com.macrabbit.cssedit";
|
||||
|
||||
NSString *kOdbEditorNameMacVim = @"MacVim";
|
||||
NSString *kOdbEditorIdentifierMacVim = @"org.vim.MacVim";
|
||||
|
||||
NSString *kOdbEditorNameSmultron = @"Smultron";
|
||||
NSString *kOdbEditorIdentifierSmultron = @"org.smultron.Smultron";
|
||||
|
||||
NSString *kOdbEditorNameSubEthaEdit = @"SubEthaEdit";
|
||||
NSString *kOdbEditorIdentifierSubEthaEdit = @"de.codingmonkeys.SubEthaEdit";
|
||||
|
||||
NSString *kOdbEditorNameTextMate = @"TextMate";
|
||||
NSString *kOdbEditorIdentifierTextMate = @"com.macromates.textmate";
|
||||
|
||||
NSString *kOdbEditorNameTextWrangler = @"TextWrangler";
|
||||
NSString *kOdbEditorIdentifierTextWrangler = @"com.barebones.textwrangler";
|
||||
|
||||
NSString *kOdbEditorNameWriteRoom = @"WriteRoom";
|
||||
NSString *kOdbEditorIdentifierWriteRoom = @"com.hogbaysoftware.WriteRoom";
|
||||
|
||||
|
||||
@interface MMPreferenceController (Private)
|
||||
// Integration pane
|
||||
- (void)updateIntegrationPane;
|
||||
- (void)setOdbEditorByName:(NSString *)name;
|
||||
- (NSString *)odbEditorBundleIdentifier;
|
||||
- (NSString *)odbBundleSourceDir;
|
||||
- (NSString *)versionOfBundle:(NSString *)bundlePath;
|
||||
- (NSString *)odbBundleInstalledVersion;
|
||||
- (NSString *)odbBundleInstallVersion;
|
||||
@end
|
||||
|
||||
@implementation MMPreferenceController
|
||||
|
||||
- (id)initWithWindow:(NSWindow *)window
|
||||
{
|
||||
self = [super initWithWindow:window];
|
||||
if (self == nil)
|
||||
return nil;
|
||||
// taken from Cyberduck. Thanks :-)
|
||||
supportedOdbEditors = [[NSDictionary alloc] initWithObjectsAndKeys:
|
||||
kOdbEditorIdentifierNone, kOdbEditorNameNone,
|
||||
kOdbEditorIdentifierBBEdit, kOdbEditorNameBBEdit,
|
||||
kOdbEditorIdentifierCSSEdit, kOdbEditorNameCSSEdit,
|
||||
kOdbEditorIdentifierMacVim, kOdbEditorNameMacVim,
|
||||
kOdbEditorIdentifierSmultron, kOdbEditorNameSmultron,
|
||||
kOdbEditorIdentifierSubEthaEdit, kOdbEditorNameSubEthaEdit,
|
||||
kOdbEditorIdentifierTextMate, kOdbEditorNameTextMate,
|
||||
kOdbEditorIdentifierTextWrangler, kOdbEditorNameTextWrangler,
|
||||
kOdbEditorIdentifierWriteRoom, kOdbEditorNameWriteRoom,
|
||||
nil];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
ASLogDebug(@"");
|
||||
|
||||
[supportedOdbEditors release]; supportedOdbEditors = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
// fill list of editors in integration pane
|
||||
NSArray *keys = [[supportedOdbEditors allKeys]
|
||||
sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
|
||||
NSMenu *editorsMenu = [editors menu];
|
||||
NSEnumerator *enumerator = [keys objectEnumerator];
|
||||
NSString *key;
|
||||
while ((key = [enumerator nextObject]) != nil) {
|
||||
NSString *identifier = [supportedOdbEditors objectForKey:key];
|
||||
|
||||
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:key
|
||||
action:@selector(odbEditorChanged:)
|
||||
keyEquivalent:@""];
|
||||
[item setTarget:self];
|
||||
if (![identifier isEqualToString:kOdbEditorIdentifierNone]) {
|
||||
NSString *appPath = [[NSWorkspace sharedWorkspace]
|
||||
absolutePathForAppBundleWithIdentifier:identifier];
|
||||
[item setEnabled:appPath != nil];
|
||||
if (appPath != nil) {
|
||||
NSImage *icon = [[NSWorkspace sharedWorkspace]
|
||||
iconForFile:appPath];
|
||||
[icon setSize:NSMakeSize(16, 16)]; // XXX: make res independent
|
||||
[item setImage:icon];
|
||||
}
|
||||
}
|
||||
[editorsMenu addItem:item];
|
||||
[item release];
|
||||
}
|
||||
|
||||
[self updateIntegrationPane];
|
||||
}
|
||||
|
||||
- (void)setupToolbar
|
||||
{
|
||||
loadSymbols();
|
||||
@@ -166,8 +55,6 @@ NSString *kOdbEditorIdentifierWriteRoom = @"com.hogbaysoftware.WriteRoom";
|
||||
[self addView:generalPreferences label:@"General"];
|
||||
}
|
||||
|
||||
[self addView:integrationPreferences label:@"Integration"];
|
||||
|
||||
if (nsImageNamePreferencesAdvanced != NULL) {
|
||||
[self addView:advancedPreferences
|
||||
label:@"Advanced"
|
||||
@@ -194,20 +81,6 @@ NSString *kOdbEditorIdentifierWriteRoom = @"com.hogbaysoftware.WriteRoom";
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)item
|
||||
{
|
||||
if ([item action] == @selector(odbEditorChanged:)) {
|
||||
NSString *identifier = [supportedOdbEditors objectForKey:[item title]];
|
||||
if (identifier == nil)
|
||||
return NO;
|
||||
if ([identifier isEqualToString:kOdbEditorIdentifierNone])
|
||||
return YES;
|
||||
return [[NSWorkspace sharedWorkspace]
|
||||
absolutePathForAppBundleWithIdentifier:identifier] != nil;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (IBAction)openInCurrentWindowSelectionChanged:(id)sender
|
||||
{
|
||||
BOOL openInCurrentWindowSelected = ([[sender selectedCell] tag] != 0);
|
||||
@@ -217,197 +90,4 @@ NSString *kOdbEditorIdentifierWriteRoom = @"com.hogbaysoftware.WriteRoom";
|
||||
[layoutPopUpButton selectItemWithTag:MMLayoutTabs];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Integration pane
|
||||
|
||||
- (void)updateIntegrationPane
|
||||
{
|
||||
// XXX: check validation api.
|
||||
// XXX: call this each time the dialog becomes active (so that if the
|
||||
// user changes settings in terminal, the changes are reflected in the
|
||||
// dialog)
|
||||
|
||||
NSString *versionString = @"";
|
||||
|
||||
// Check if ODB path exists before calling isFilePackageAtPath: otherwise
|
||||
// an error is output to stderr on Tiger.
|
||||
BOOL odbIsInstalled =
|
||||
[[NSFileManager defaultManager] fileExistsAtPath:ODBEDITOR_PATH]
|
||||
&& [[NSWorkspace sharedWorkspace] isFilePackageAtPath:ODBEDITOR_PATH];
|
||||
|
||||
// enable/disable buttons
|
||||
[installOdbButton setTitle:@"Install"];
|
||||
if (odbIsInstalled) {
|
||||
[uninstallOdbButton setEnabled:YES];
|
||||
[editors setEnabled:YES];
|
||||
|
||||
NSString *installVersion = [self odbBundleInstallVersion];
|
||||
NSString *installedVersion = [self odbBundleInstalledVersion];
|
||||
switch ([installedVersion compare:installVersion
|
||||
options:NSNumericSearch]) {
|
||||
case NSOrderedAscending:
|
||||
versionString = [NSString stringWithFormat:
|
||||
@"Latest version is %@, you have %@.",
|
||||
installVersion, installedVersion];
|
||||
[installOdbButton setTitle:@"Update"];
|
||||
[installOdbButton setEnabled:YES];
|
||||
break;
|
||||
case NSOrderedSame:
|
||||
versionString = [NSString stringWithFormat:
|
||||
@"Latest version is %@. You have the latest version.",
|
||||
installVersion];
|
||||
[installOdbButton setEnabled:NO];
|
||||
break;
|
||||
case NSOrderedDescending:
|
||||
versionString = [NSString stringWithFormat:
|
||||
@"Latest version is %@, you have %@.",
|
||||
installVersion, installedVersion];
|
||||
[installOdbButton setEnabled:NO];
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
[installOdbButton setEnabled:YES];
|
||||
[uninstallOdbButton setEnabled:NO];
|
||||
[editors setEnabled:NO];
|
||||
|
||||
versionString = [NSString
|
||||
stringWithFormat:@"Latest version is %@. It is not installed.",
|
||||
[self odbBundleInstallVersion]];
|
||||
}
|
||||
|
||||
[obdBundleVersionLabel setStringValue:versionString];
|
||||
|
||||
// make sure the right editor is selected on the popup button
|
||||
NSString *selectedTitle = kOdbEditorNameNone;
|
||||
NSArray* keys = [supportedOdbEditors
|
||||
allKeysForObject:[self odbEditorBundleIdentifier]];
|
||||
if ([keys count] > 0)
|
||||
selectedTitle = [keys objectAtIndex:0];
|
||||
[editors selectItemWithTitle:selectedTitle];
|
||||
}
|
||||
|
||||
- (void)setOdbEditorByName:(NSString *)name
|
||||
{
|
||||
NSString *identifier = [supportedOdbEditors objectForKey:name];
|
||||
if (identifier != kOdbEditorIdentifierNone) {
|
||||
CFPreferencesSetAppValue(ODB_BUNDLE_IDENTIFIER, identifier, ODBEDITOR);
|
||||
CFPreferencesSetAppValue(ODB_EDITOR_NAME, name, ODBEDITOR);
|
||||
} else {
|
||||
CFPreferencesSetAppValue(ODB_BUNDLE_IDENTIFIER, NULL, ODBEDITOR);
|
||||
CFPreferencesSetAppValue(ODB_EDITOR_NAME, NULL, ODBEDITOR);
|
||||
}
|
||||
CFPreferencesAppSynchronize(ODBEDITOR);
|
||||
}
|
||||
|
||||
// Note that you can't compare the result of this function with ==, you have
|
||||
// to use isStringEqual: (since this returns a new copy of the string).
|
||||
- (NSString *)odbEditorBundleIdentifier
|
||||
{
|
||||
// reading the defaults of a different app is easier with carbon
|
||||
NSString *bundleIdentifier = (NSString*)CFPreferencesCopyAppValue(
|
||||
ODB_BUNDLE_IDENTIFIER, ODBEDITOR);
|
||||
if (bundleIdentifier == nil)
|
||||
return kOdbEditorIdentifierNone;
|
||||
return [bundleIdentifier autorelease];
|
||||
}
|
||||
|
||||
- (void)odbEditorChanged:(id)sender
|
||||
{
|
||||
[self setOdbEditorByName:[sender title]];
|
||||
}
|
||||
|
||||
- (NSString *)odbBundleSourceDir
|
||||
{
|
||||
return [[[NSBundle mainBundle] resourcePath]
|
||||
stringByAppendingString:@"/Edit in ODBEditor"];
|
||||
}
|
||||
|
||||
// Returns the CFBundleVersion of a bundle. This assumes a bundle exists
|
||||
// at bundlePath.
|
||||
- (NSString *)versionOfBundle:(NSString *)bundlePath
|
||||
{
|
||||
// -[NSBundle initWithPath:] caches a bundle, so if the bundle is replaced
|
||||
// with a new bundle on disk, we get the old version. So we can't use it :-(
|
||||
|
||||
NSString *infoPath = [bundlePath
|
||||
stringByAppendingString:@"/Contents/Info.plist"];
|
||||
NSDictionary *info = [NSDictionary dictionaryWithContentsOfFile:infoPath];
|
||||
return [info objectForKey:@"CFBundleVersion"];
|
||||
}
|
||||
|
||||
- (NSString *)odbBundleInstalledVersion
|
||||
{
|
||||
return [self versionOfBundle:ODBEDITOR_PATH];
|
||||
}
|
||||
|
||||
- (NSString *)odbBundleInstallVersion
|
||||
{
|
||||
return [self versionOfBundle:[[self odbBundleSourceDir]
|
||||
stringByAppendingString:@"/Edit in ODBEditor.bundle"]];
|
||||
}
|
||||
|
||||
- (IBAction)installOdb:(id)sender
|
||||
{
|
||||
NSString *source = [self odbBundleSourceDir];
|
||||
|
||||
// It doesn't hurt to rm -rf the InputManager even if it's not there,
|
||||
// the code is simpler that way.
|
||||
NSArray *cmd = [NSArray arrayWithObjects:
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"/bin/rm", MMCommand,
|
||||
[NSArray arrayWithObjects:@"-rf", ODBEDITOR_DIR, nil], MMArguments,
|
||||
nil],
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"/bin/mkdir", MMCommand,
|
||||
[NSArray arrayWithObjects:@"-p", ODBEDITOR_DIR, nil], MMArguments,
|
||||
nil],
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"/bin/cp", MMCommand,
|
||||
[NSArray arrayWithObjects: @"-R",
|
||||
source, @"/Library/InputManagers", nil], MMArguments,
|
||||
nil],
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"/usr/sbin/chown", MMCommand,
|
||||
[NSArray arrayWithObjects: @"-R",
|
||||
@"root:admin", @"/Library/InputManagers", nil], MMArguments,
|
||||
nil],
|
||||
nil
|
||||
];
|
||||
|
||||
AuthorizedShellCommand *au = [[AuthorizedShellCommand alloc]
|
||||
initWithCommands:cmd];
|
||||
OSStatus err = [au run];
|
||||
if (err == errAuthorizationSuccess) {
|
||||
// If the user just installed the input manager and no editor was
|
||||
// selected before, chances are he wants to use MacVim as editor
|
||||
if ([[self odbEditorBundleIdentifier]
|
||||
isEqualToString:kOdbEditorIdentifierNone]) {
|
||||
[self setOdbEditorByName:kOdbEditorNameMacVim];
|
||||
}
|
||||
} else {
|
||||
ASLogErr(@"Failed to install input manager, error is %d", err);
|
||||
}
|
||||
[au release];
|
||||
|
||||
[self updateIntegrationPane];
|
||||
}
|
||||
|
||||
- (IBAction)uninstallOdb:(id)sender
|
||||
{
|
||||
NSArray *cmd = [NSArray arrayWithObject:
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"/bin/rm", MMCommand,
|
||||
[NSArray arrayWithObjects: @"-rf", ODBEDITOR_DIR, nil], MMArguments,
|
||||
nil]];
|
||||
|
||||
AuthorizedShellCommand *au = [[AuthorizedShellCommand alloc]
|
||||
initWithCommands:cmd];
|
||||
OSStatus err = [au run];
|
||||
if (err != errAuthorizationSuccess)
|
||||
ASLogErr(@"Failed to uninstall input manager, error is %d", err);
|
||||
[au release];
|
||||
|
||||
[self updateIntegrationPane];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -64,5 +64,7 @@
|
||||
- (NSRect)rectForRow:(int)row column:(int)col numRows:(int)nr
|
||||
numColumns:(int)nc;
|
||||
|
||||
// NOT IMPLEMENTED (only in Core Text renderer)
|
||||
- (void)deleteSign:(NSString *)signName;
|
||||
- (void)setToolTipAtMousePoint:(NSString *)string;
|
||||
@end
|
||||
|
||||
+6
-26
@@ -494,6 +494,12 @@
|
||||
|
||||
- (void)deleteSign:(NSString *)signName
|
||||
{
|
||||
// ONLY in Core Text!
|
||||
}
|
||||
|
||||
- (void)setToolTipAtMousePoint:(NSString *)string
|
||||
{
|
||||
// ONLY in Core Text!
|
||||
}
|
||||
|
||||
- (BOOL)isOpaque
|
||||
@@ -764,32 +770,6 @@
|
||||
[helper mouseMoved:event];
|
||||
}
|
||||
|
||||
- (void)mouseEntered:(NSEvent *)event
|
||||
{
|
||||
[helper mouseEntered:event];
|
||||
}
|
||||
|
||||
- (void)mouseExited:(NSEvent *)event
|
||||
{
|
||||
[helper mouseExited:event];
|
||||
}
|
||||
|
||||
- (void)setFrame:(NSRect)frame
|
||||
{
|
||||
[super setFrame:frame];
|
||||
[helper setFrame:frame];
|
||||
}
|
||||
|
||||
- (void)viewDidMoveToWindow
|
||||
{
|
||||
[helper viewDidMoveToWindow];
|
||||
}
|
||||
|
||||
- (void)viewWillMoveToWindow:(NSWindow *)newWindow
|
||||
{
|
||||
[helper viewWillMoveToWindow:newWindow];
|
||||
}
|
||||
|
||||
- (NSMenu*)menuForEvent:(NSEvent *)event
|
||||
{
|
||||
// HACK! Return nil to disable NSTextView's popup menus (Vim provides its
|
||||
|
||||
@@ -40,7 +40,6 @@ enum {
|
||||
NSPoint dragPoint;
|
||||
BOOL isAutoscrolling;
|
||||
int mouseShape;
|
||||
NSTrackingRectTag trackingRectTag;
|
||||
NSColor *insertionPointColor;
|
||||
BOOL interpretKeyEventsSwallowedKey;
|
||||
NSEvent *currentEvent;
|
||||
@@ -75,11 +74,6 @@ enum {
|
||||
- (void)mouseUp:(NSEvent *)event;
|
||||
- (void)mouseDragged:(NSEvent *)event;
|
||||
- (void)mouseMoved:(NSEvent *)event;
|
||||
- (void)mouseEntered:(NSEvent *)event;
|
||||
- (void)mouseExited:(NSEvent *)event;
|
||||
- (void)setFrame:(NSRect)frame;
|
||||
- (void)viewDidMoveToWindow;
|
||||
- (void)viewWillMoveToWindow:(NSWindow *)newWindow;
|
||||
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
|
||||
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
|
||||
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
|
||||
|
||||
@@ -458,79 +458,12 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
if (![textView convertPoint:pt toRow:&row column:&col])
|
||||
return;
|
||||
|
||||
// HACK! It seems impossible to get the tracking rects set up before the
|
||||
// view is visible, which means that the first mouseEntered: or
|
||||
// mouseExited: events are never received. This forces us to check if the
|
||||
// mouseMoved: event really happened over the text.
|
||||
int rows, cols;
|
||||
[textView getMaxRows:&rows columns:&cols];
|
||||
if (row >= 0 && row < rows && col >= 0 && col < cols) {
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
|
||||
[data appendBytes:&row length:sizeof(int)];
|
||||
[data appendBytes:&col length:sizeof(int)];
|
||||
[data appendBytes:&row length:sizeof(int)];
|
||||
[data appendBytes:&col length:sizeof(int)];
|
||||
|
||||
[[self vimController] sendMessage:MouseMovedMsgID data:data];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)mouseEntered:(NSEvent *)event
|
||||
{
|
||||
// NOTE: This event is received even when the window is not key; thus we
|
||||
// have to take care not to enable mouse moved events unless our window is
|
||||
// key.
|
||||
if ([[textView window] isKeyWindow]) {
|
||||
[[textView window] setAcceptsMouseMovedEvents:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)mouseExited:(NSEvent *)event
|
||||
{
|
||||
[[textView window] setAcceptsMouseMovedEvents:NO];
|
||||
|
||||
// NOTE: This event is received even when the window is not key; if the
|
||||
// mouse shape is set when our window is not key, the hollow (unfocused)
|
||||
// cursor will become a block (focused) cursor.
|
||||
if ([[textView window] isKeyWindow]) {
|
||||
int shape = 0;
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
[data appendBytes:&shape length:sizeof(int)];
|
||||
[[self vimController] sendMessage:SetMouseShapeMsgID data:data];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setFrame:(NSRect)frame
|
||||
{
|
||||
// When the frame changes we also need to update the tracking rect.
|
||||
[textView removeTrackingRect:trackingRectTag];
|
||||
trackingRectTag = [textView addTrackingRect:[self trackingRect]
|
||||
owner:textView
|
||||
userData:NULL
|
||||
assumeInside:YES];
|
||||
}
|
||||
|
||||
- (void)viewDidMoveToWindow
|
||||
{
|
||||
// Set a tracking rect which covers the text.
|
||||
// NOTE: While the mouse cursor is in this rect the view will receive
|
||||
// 'mouseMoved:' events so that Vim can take care of updating the mouse
|
||||
// cursor.
|
||||
if ([textView window]) {
|
||||
[[textView window] setAcceptsMouseMovedEvents:YES];
|
||||
trackingRectTag = [textView addTrackingRect:[self trackingRect]
|
||||
owner:textView
|
||||
userData:NULL
|
||||
assumeInside:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewWillMoveToWindow:(NSWindow *)newWindow
|
||||
{
|
||||
// Remove tracking rect if view moves or is removed.
|
||||
if ([textView window] && trackingRectTag) {
|
||||
[textView removeTrackingRect:trackingRectTag];
|
||||
trackingRectTag = 0;
|
||||
}
|
||||
[[self vimController] sendMessage:MouseMovedMsgID data:data];
|
||||
}
|
||||
|
||||
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
|
||||
|
||||
@@ -10,10 +10,6 @@
|
||||
|
||||
#import "MacVim.h"
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
#import "PlugInImpl.h"
|
||||
#endif
|
||||
|
||||
|
||||
@class MMWindowController;
|
||||
|
||||
@@ -36,9 +32,6 @@
|
||||
int pid;
|
||||
NSString *serverName;
|
||||
NSDictionary *vimState;
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
MMPlugInInstanceMediator *instanceMediator;
|
||||
#endif
|
||||
BOOL isPreloading;
|
||||
NSDate *creationDate;
|
||||
}
|
||||
@@ -70,7 +63,4 @@
|
||||
- (id)evaluateVimExpressionCocoa:(NSString *)expr
|
||||
errorString:(NSString **)errstr;
|
||||
- (void)processInputQueue:(NSArray *)queue;
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
- (MMPlugInInstanceMediator *)instanceMediator;
|
||||
#endif
|
||||
@end
|
||||
|
||||
@@ -33,10 +33,8 @@
|
||||
#import "MMVimView.h"
|
||||
#import "MMWindowController.h"
|
||||
#import "Miscellaneous.h"
|
||||
#import "MMCoreTextView.h"
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
#import "MMPlugInManager.h"
|
||||
#endif
|
||||
|
||||
static NSString *MMDefaultToolbarImageName = @"Attention";
|
||||
static int MMAlertTextFieldHeight = 22;
|
||||
@@ -56,6 +54,16 @@ static unsigned identifierCounter = 1;
|
||||
static BOOL isUnsafeMessage(int msgid);
|
||||
|
||||
|
||||
// HACK! AppKit private methods from NSToolTipManager. As an alternative to
|
||||
// using private methods, it would be possible to set the user default
|
||||
// NSInitialToolTipDelay (in ms) on app startup, but then it is impossible to
|
||||
// change the balloon delay without closing/reopening a window.
|
||||
@interface NSObject (NSToolTipManagerPrivateAPI)
|
||||
+ (id)sharedToolTipManager;
|
||||
- (void)setInitialToolTipDelay:(double)arg1;
|
||||
@end
|
||||
|
||||
|
||||
@interface MMAlert : NSAlert {
|
||||
NSTextField *textField;
|
||||
}
|
||||
@@ -98,6 +106,7 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
- (void)handleBrowseForFile:(NSDictionary *)attr;
|
||||
- (void)handleShowDialog:(NSDictionary *)attr;
|
||||
- (void)handleDeleteSign:(NSDictionary *)attr;
|
||||
- (void)setToolTipDelay:(NSTimeInterval)seconds;
|
||||
@end
|
||||
|
||||
|
||||
@@ -150,11 +159,6 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
|
||||
[mainMenu addItem:appMenuItem];
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
instanceMediator = [[MMPlugInInstanceMediator alloc]
|
||||
initWithVimController:self];
|
||||
#endif
|
||||
|
||||
isInitialized = YES;
|
||||
|
||||
return self;
|
||||
@@ -166,10 +170,6 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
|
||||
isInitialized = NO;
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
[instanceMediator release]; instanceMediator = nil;
|
||||
#endif
|
||||
|
||||
[serverName release]; serverName = nil;
|
||||
[backendProxy release]; backendProxy = nil;
|
||||
|
||||
@@ -195,13 +195,6 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
return windowController;
|
||||
}
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
- (MMPlugInInstanceMediator *)instanceMediator
|
||||
{
|
||||
return instanceMediator;
|
||||
}
|
||||
#endif
|
||||
|
||||
- (NSDictionary *)vimState
|
||||
{
|
||||
return vimState;
|
||||
@@ -839,6 +832,20 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
int y = *((int*)bytes); bytes += sizeof(int);
|
||||
|
||||
[windowController setTopLeft:NSMakePoint(x,y)];
|
||||
} else if (SetTooltipMsgID == msgid) {
|
||||
id textView = [[windowController vimView] textView];
|
||||
NSDictionary *dict = [NSDictionary dictionaryWithData:data];
|
||||
NSString *toolTip = dict ? [dict objectForKey:@"toolTip"] : nil;
|
||||
if (toolTip && [toolTip length] > 0)
|
||||
[textView setToolTipAtMousePoint:toolTip];
|
||||
else
|
||||
[textView setToolTipAtMousePoint:nil];
|
||||
} else if (SetTooltipDelayMsgID == msgid) {
|
||||
NSDictionary *dict = [NSDictionary dictionaryWithData:data];
|
||||
NSNumber *delay = dict ? [dict objectForKey:@"delay"] : nil;
|
||||
if (delay)
|
||||
[self setToolTipDelay:[delay floatValue]];
|
||||
|
||||
// IMPORTANT: When adding a new message, make sure to update
|
||||
// isUnsafeMessage() if necessary!
|
||||
} else {
|
||||
@@ -1449,6 +1456,23 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
[view deleteSign:[attr objectForKey:@"imgName"]];
|
||||
}
|
||||
|
||||
- (void)setToolTipDelay:(NSTimeInterval)seconds
|
||||
{
|
||||
// HACK! NSToolTipManager is an AppKit private class.
|
||||
static Class TTM = nil;
|
||||
if (!TTM)
|
||||
TTM = NSClassFromString(@"NSToolTipManager");
|
||||
|
||||
if (seconds < 0)
|
||||
seconds = 0;
|
||||
|
||||
if (TTM) {
|
||||
[[TTM sharedToolTipManager] setInitialToolTipDelay:seconds];
|
||||
} else {
|
||||
ASLogNotice(@"Failed to get NSToolTipManager");
|
||||
}
|
||||
}
|
||||
|
||||
@end // MMVimController (Private)
|
||||
|
||||
|
||||
|
||||
+26
-21
@@ -662,17 +662,15 @@ enum {
|
||||
- (void)placeScrollbars
|
||||
{
|
||||
NSRect textViewFrame = [textView frame];
|
||||
BOOL lsbVisible = [self leftScrollbarVisible];
|
||||
BOOL leftSbVisible = NO;
|
||||
BOOL rightSbVisible = NO;
|
||||
BOOL botSbVisible = NO;
|
||||
|
||||
// HACK! Find the lowest left&right vertical scrollbars, as well as the
|
||||
// rightmost horizontal scrollbar. This hack continues further down.
|
||||
//
|
||||
// TODO! Can there be no more than one horizontal scrollbar? If so, the
|
||||
// code can be simplified.
|
||||
// HACK! Find the lowest left&right vertical scrollbars This hack
|
||||
// continues further down.
|
||||
unsigned lowestLeftSbIdx = (unsigned)-1;
|
||||
unsigned lowestRightSbIdx = (unsigned)-1;
|
||||
unsigned rightmostSbIdx = (unsigned)-1;
|
||||
unsigned rowMaxLeft = 0, rowMaxRight = 0, colMax = 0;
|
||||
unsigned rowMaxLeft = 0, rowMaxRight = 0;
|
||||
unsigned i, count = [scrollbars count];
|
||||
for (i = 0; i < count; ++i) {
|
||||
MMScroller *scroller = [scrollbars objectAtIndex:i];
|
||||
@@ -682,14 +680,14 @@ enum {
|
||||
&& range.location >= rowMaxLeft) {
|
||||
rowMaxLeft = range.location;
|
||||
lowestLeftSbIdx = i;
|
||||
leftSbVisible = YES;
|
||||
} else if ([scroller type] == MMScrollerTypeRight
|
||||
&& range.location >= rowMaxRight) {
|
||||
rowMaxRight = range.location;
|
||||
lowestRightSbIdx = i;
|
||||
} else if ([scroller type] == MMScrollerTypeBottom
|
||||
&& range.location >= colMax) {
|
||||
colMax = range.location;
|
||||
rightmostSbIdx = i;
|
||||
rightSbVisible = YES;
|
||||
} else if ([scroller type] == MMScrollerTypeBottom) {
|
||||
botSbVisible = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -704,25 +702,27 @@ enum {
|
||||
if ([scroller type] == MMScrollerTypeBottom) {
|
||||
rect = [textView rectForColumnsInRange:[scroller range]];
|
||||
rect.size.height = [NSScroller scrollerWidth];
|
||||
if (lsbVisible)
|
||||
if (leftSbVisible)
|
||||
rect.origin.x += [NSScroller scrollerWidth];
|
||||
|
||||
// HACK! Make sure the rightmost horizontal scrollbar covers the
|
||||
// text view all the way to the right, otherwise it looks ugly when
|
||||
// the user drags the window to resize.
|
||||
if (i == rightmostSbIdx) {
|
||||
float w = NSMaxX(textViewFrame) - NSMaxX(rect);
|
||||
if (w > 0)
|
||||
rect.size.width += w;
|
||||
}
|
||||
// HACK! Make sure the horizontal scrollbar covers the text view
|
||||
// all the way to the right, otherwise it looks ugly when the user
|
||||
// drags the window to resize.
|
||||
float w = NSMaxX(textViewFrame) - NSMaxX(rect);
|
||||
if (w > 0)
|
||||
rect.size.width += w;
|
||||
|
||||
// Make sure scrollbar rect is bounded by the text view frame.
|
||||
// Also leave some room for the resize indicator on the right in
|
||||
// case there is no right scrollbar.
|
||||
if (rect.origin.x < textViewFrame.origin.x)
|
||||
rect.origin.x = textViewFrame.origin.x;
|
||||
else if (rect.origin.x > NSMaxX(textViewFrame))
|
||||
rect.origin.x = NSMaxX(textViewFrame);
|
||||
if (NSMaxX(rect) > NSMaxX(textViewFrame))
|
||||
rect.size.width -= NSMaxX(rect) - NSMaxX(textViewFrame);
|
||||
if (!rightSbVisible)
|
||||
rect.size.width -= [NSScroller scrollerWidth];
|
||||
if (rect.size.width < 0)
|
||||
rect.size.width = 0;
|
||||
} else {
|
||||
@@ -778,6 +778,11 @@ enum {
|
||||
[scroller setNeedsDisplay:YES];
|
||||
}
|
||||
}
|
||||
|
||||
// HACK: If there is no bottom or right scrollbar the resize indicator will
|
||||
// cover the bottom-right corner of the text view so tell NSWindow not to
|
||||
// draw it in this situation.
|
||||
[[self window] setShowsResizeIndicator:(rightSbVisible||botSbVisible)];
|
||||
}
|
||||
|
||||
- (NSUInteger)representedIndexOfTabViewItem:(NSTabViewItem *)tvi
|
||||
|
||||
@@ -58,6 +58,9 @@
|
||||
[contentView setAutoresizesSubviews:YES];
|
||||
[contentView addSubview:tablineSeparator];
|
||||
|
||||
// NOTE: Vim needs to process mouse moved events, so enable them here.
|
||||
[self setAcceptsMouseMovedEvents:YES];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
+2
-7
@@ -12,13 +12,6 @@
|
||||
#import <asl.h>
|
||||
|
||||
|
||||
//
|
||||
// Uncomment to enable support for MacVim plugins (not to be confused with Vim
|
||||
// plugins!).
|
||||
//
|
||||
//#define MM_ENABLE_PLUGINS
|
||||
|
||||
|
||||
// Taken from /usr/include/AvailabilityMacros.h
|
||||
#ifndef MAC_OS_X_VERSION_10_4
|
||||
# define MAC_OS_X_VERSION_10_4 1040
|
||||
@@ -193,6 +186,8 @@ enum {
|
||||
ZoomMsgID,
|
||||
SetWindowPositionMsgID,
|
||||
DeleteSignMsgID,
|
||||
SetTooltipMsgID,
|
||||
SetTooltipDelayMsgID,
|
||||
LastMsgID // NOTE: MUST BE LAST MESSAGE IN ENUM!
|
||||
};
|
||||
|
||||
|
||||
@@ -96,6 +96,8 @@ char *MessageStrings[] =
|
||||
"ZoomMsgID",
|
||||
"SetWindowPositionMsgID",
|
||||
"DeleteSignMsgID",
|
||||
"SetTooltipMsgID",
|
||||
"SetTooltipDelayMsgID",
|
||||
"END OF MESSAGE IDs" // NOTE: Must be last!
|
||||
};
|
||||
|
||||
|
||||
@@ -9,11 +9,6 @@
|
||||
/* Begin PBXBuildFile section */
|
||||
0395A8330D71ED7800881434 /* DBPrefsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0395A8320D71ED7800881434 /* DBPrefsWindowController.m */; };
|
||||
0395A8AA0D72D88B00881434 /* General.png in Resources */ = {isa = PBXBuildFile; fileRef = 0395A8A90D72D88B00881434 /* General.png */; };
|
||||
0395A95A0D74D47B00881434 /* Integration.png in Resources */ = {isa = PBXBuildFile; fileRef = 0395A9590D74D47B00881434 /* Integration.png */; };
|
||||
0395A9BF0D75D02400881434 /* AuthorizedShellCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 0395A9BE0D75D02400881434 /* AuthorizedShellCommand.m */; };
|
||||
0395A9C30D75D04D00881434 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0395A9C20D75D04D00881434 /* Security.framework */; };
|
||||
0395AA780D76E77800881434 /* Info in Copy ODBEditor */ = {isa = PBXBuildFile; fileRef = 0395AA770D76E77800881434 /* Info */; };
|
||||
0395AAAD0D76E94000881434 /* Edit in ODBEditor.bundle in Copy ODBEditor */ = {isa = PBXBuildFile; fileRef = 0395AA210D76E22700881434 /* Edit in ODBEditor.bundle */; };
|
||||
1D09AB420C6A4D520045497E /* MMTypesetter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D09AB400C6A4D520045497E /* MMTypesetter.m */; };
|
||||
1D0E051C0BA5F83800B6049E /* Colors.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1D0E051B0BA5F83800B6049E /* Colors.plist */; };
|
||||
1D145C7F0E5227CE00691AA0 /* MMTextViewHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D145C7E0E5227CE00691AA0 /* MMTextViewHelper.m */; };
|
||||
@@ -29,6 +24,7 @@
|
||||
1D3D19120CA690FF0004A0A5 /* DejaVuSansMono-BoldOblique.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1D3D190E0CA690FF0004A0A5 /* DejaVuSansMono-BoldOblique.ttf */; };
|
||||
1D3D19130CA690FF0004A0A5 /* DejaVuSansMono-Oblique.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1D3D190F0CA690FF0004A0A5 /* DejaVuSansMono-Oblique.ttf */; };
|
||||
1D3D19140CA690FF0004A0A5 /* DejaVuSansMono.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1D3D19100CA690FF0004A0A5 /* DejaVuSansMono.ttf */; };
|
||||
1D44972211FCA9B400B0630F /* MMCoreTextView+ToolTip.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D44972111FCA9B400B0630F /* MMCoreTextView+ToolTip.m */; };
|
||||
1D493D580C5247BF00AB718C /* Vim in Copy Executables */ = {isa = PBXBuildFile; fileRef = 1D493D570C5247BF00AB718C /* Vim */; };
|
||||
1D493DBA0C52534300AB718C /* PSMTabBarControl.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; };
|
||||
1D60088B0E96A0B2003763F0 /* MMFindReplaceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */; };
|
||||
@@ -78,30 +74,9 @@
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
|
||||
B59228A611F7572F00E7F584 /* MacVim.sdef in Resources */ = {isa = PBXBuildFile; fileRef = B59228A511F7572F00E7F584 /* MacVim.sdef */; };
|
||||
BD476E300DAAD74400F08A5C /* RBSplitSubview.m in Sources */ = {isa = PBXBuildFile; fileRef = BD476E2C0DAAD74400F08A5C /* RBSplitSubview.m */; };
|
||||
BD476E310DAAD74400F08A5C /* RBSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = BD476E2E0DAAD74400F08A5C /* RBSplitView.m */; };
|
||||
BD943D530DA3050B00A02D9B /* PlugInImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = BD943D520DA3050B00A02D9B /* PlugInImpl.m */; };
|
||||
BD9DF0A00DB2BA020025C97C /* PlugInView.nib in Resources */ = {isa = PBXBuildFile; fileRef = BD9DF09F0DB2BA020025C97C /* PlugInView.nib */; };
|
||||
BD9DF0B00DB41E780025C97C /* PlugInGUI.m in Sources */ = {isa = PBXBuildFile; fileRef = BD9DF0AF0DB41E780025C97C /* PlugInGUI.m */; };
|
||||
BD9DF0FB0DB48C860025C97C /* CTGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = BD9DF0FA0DB48C860025C97C /* CTGradient.m */; };
|
||||
BDA8B1120D9F8A8500B3511A /* MMPlugInManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BDA8B1110D9F8A8500B3511A /* MMPlugInManager.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
0395AA200D76E22700881434 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 0395AA190D76E22700881434 /* Edit in ODBEditor.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 8D5B49B6048680CD000E48DA;
|
||||
remoteInfo = "Edit in ODBEditor";
|
||||
};
|
||||
0395AA230D76E2F300881434 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 0395AA190D76E22700881434 /* Edit in ODBEditor.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 8D5B49AC048680CD000E48DA;
|
||||
remoteInfo = "Edit in ODBEditor";
|
||||
};
|
||||
1D493DB80C52533B00AB718C /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */;
|
||||
@@ -119,18 +94,6 @@
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
0395AA790D76E77800881434 /* Copy ODBEditor */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "Edit in ODBEditor";
|
||||
dstSubfolderSpec = 7;
|
||||
files = (
|
||||
0395AAAD0D76E94000881434 /* Edit in ODBEditor.bundle in Copy ODBEditor */,
|
||||
0395AA780D76E77800881434 /* Info in Copy ODBEditor */,
|
||||
);
|
||||
name = "Copy ODBEditor";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
1D0DCAD80BA3604D00B6CCFA /* Copy Executables */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -172,12 +135,6 @@
|
||||
0395A8310D71ED7800881434 /* DBPrefsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBPrefsWindowController.h; sourceTree = "<group>"; };
|
||||
0395A8320D71ED7800881434 /* DBPrefsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DBPrefsWindowController.m; sourceTree = "<group>"; };
|
||||
0395A8A90D72D88B00881434 /* General.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = General.png; sourceTree = "<group>"; };
|
||||
0395A9590D74D47B00881434 /* Integration.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Integration.png; sourceTree = "<group>"; };
|
||||
0395A9BD0D75D02400881434 /* AuthorizedShellCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthorizedShellCommand.h; sourceTree = "<group>"; };
|
||||
0395A9BE0D75D02400881434 /* AuthorizedShellCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthorizedShellCommand.m; sourceTree = "<group>"; };
|
||||
0395A9C20D75D04D00881434 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
|
||||
0395AA190D76E22700881434 /* Edit in ODBEditor.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "Edit in ODBEditor.xcodeproj"; path = "edit-in-odb/Edit in ODBEditor.xcodeproj"; sourceTree = "<group>"; };
|
||||
0395AA770D76E77800881434 /* Info */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = Info; path = "edit-in-odb/Info"; sourceTree = "<group>"; };
|
||||
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
1D09AB3F0C6A4D520045497E /* MMTypesetter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MMTypesetter.h; sourceTree = "<group>"; };
|
||||
@@ -203,6 +160,7 @@
|
||||
1D3D190E0CA690FF0004A0A5 /* DejaVuSansMono-BoldOblique.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "DejaVuSansMono-BoldOblique.ttf"; path = "dejavu-ttf/DejaVuSansMono-BoldOblique.ttf"; sourceTree = "<group>"; };
|
||||
1D3D190F0CA690FF0004A0A5 /* DejaVuSansMono-Oblique.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "DejaVuSansMono-Oblique.ttf"; path = "dejavu-ttf/DejaVuSansMono-Oblique.ttf"; sourceTree = "<group>"; };
|
||||
1D3D19100CA690FF0004A0A5 /* DejaVuSansMono.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = DejaVuSansMono.ttf; path = "dejavu-ttf/DejaVuSansMono.ttf"; sourceTree = "<group>"; };
|
||||
1D44972111FCA9B400B0630F /* MMCoreTextView+ToolTip.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MMCoreTextView+ToolTip.m"; sourceTree = "<group>"; };
|
||||
1D493D570C5247BF00AB718C /* Vim */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = Vim; path = ../Vim; sourceTree = SOURCE_ROOT; };
|
||||
1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PSMTabBarControl.xcodeproj; path = PSMTabBarControl/PSMTabBarControl.xcodeproj; sourceTree = "<group>"; };
|
||||
1D6008820E96886D003763F0 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/FindAndReplace.nib; sourceTree = "<group>"; };
|
||||
@@ -263,21 +221,6 @@
|
||||
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; };
|
||||
B59228A511F7572F00E7F584 /* MacVim.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.sdef; path = MacVim.sdef; sourceTree = "<group>"; };
|
||||
BD476E2B0DAAD74400F08A5C /* RBSplitSubview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RBSplitSubview.h; sourceTree = "<group>"; };
|
||||
BD476E2C0DAAD74400F08A5C /* RBSplitSubview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RBSplitSubview.m; sourceTree = "<group>"; };
|
||||
BD476E2D0DAAD74400F08A5C /* RBSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RBSplitView.h; sourceTree = "<group>"; };
|
||||
BD476E2E0DAAD74400F08A5C /* RBSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RBSplitView.m; sourceTree = "<group>"; };
|
||||
BD476E2F0DAAD74400F08A5C /* RBSplitViewPrivateDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RBSplitViewPrivateDefines.h; sourceTree = "<group>"; };
|
||||
BD943D310DA2EA2500A02D9B /* PlugInInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlugInInterface.h; sourceTree = "<group>"; };
|
||||
BD943D510DA3050B00A02D9B /* PlugInImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlugInImpl.h; sourceTree = "<group>"; };
|
||||
BD943D520DA3050B00A02D9B /* PlugInImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlugInImpl.m; sourceTree = "<group>"; };
|
||||
BD9DF09F0DB2BA020025C97C /* PlugInView.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = PlugInView.nib; sourceTree = "<group>"; };
|
||||
BD9DF0AE0DB41E780025C97C /* PlugInGUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlugInGUI.h; sourceTree = "<group>"; };
|
||||
BD9DF0AF0DB41E780025C97C /* PlugInGUI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlugInGUI.m; sourceTree = "<group>"; };
|
||||
BD9DF0F90DB48C860025C97C /* CTGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CTGradient.h; sourceTree = "<group>"; };
|
||||
BD9DF0FA0DB48C860025C97C /* CTGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CTGradient.m; sourceTree = "<group>"; };
|
||||
BDA8B1100D9F8A8500B3511A /* MMPlugInManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMPlugInManager.h; sourceTree = "<group>"; };
|
||||
BDA8B1110D9F8A8500B3511A /* MMPlugInManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMPlugInManager.m; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -287,7 +230,6 @@
|
||||
files = (
|
||||
1DFE25A50C527BC4003000F7 /* PSMTabBarControl.framework in Frameworks */,
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
|
||||
0395A9C30D75D04D00881434 /* Security.framework in Frameworks */,
|
||||
1D8B5A53104AF9FF002E59D5 /* Carbon.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -295,19 +237,9 @@
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
0395AA1A0D76E22700881434 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0395AA210D76E22700881434 /* Edit in ODBEditor.bundle */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0395AA980D76E86200881434 /* Edit in ODBEditor */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0395AA190D76E22700881434 /* Edit in ODBEditor.xcodeproj */,
|
||||
0395AA770D76E77800881434 /* Info */,
|
||||
);
|
||||
name = "Edit in ODBEditor";
|
||||
sourceTree = "<group>";
|
||||
@@ -315,6 +247,7 @@
|
||||
080E96DDFE201D6D7F000001 /* MacVim Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1D44972111FCA9B400B0630F /* MMCoreTextView+ToolTip.m */,
|
||||
1D6008890E96A0B2003763F0 /* MMFindReplaceController.h */,
|
||||
1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */,
|
||||
1DE63FF90E71820F00959BDB /* MMCoreTextView.h */,
|
||||
@@ -323,15 +256,6 @@
|
||||
1D145C7E0E5227CE00691AA0 /* MMTextViewHelper.m */,
|
||||
1D8059220E118663001699D1 /* Miscellaneous.h */,
|
||||
1D80591D0E1185EA001699D1 /* Miscellaneous.m */,
|
||||
BD9DF0F90DB48C860025C97C /* CTGradient.h */,
|
||||
BD9DF0FA0DB48C860025C97C /* CTGradient.m */,
|
||||
BD476E2B0DAAD74400F08A5C /* RBSplitSubview.h */,
|
||||
BD476E2C0DAAD74400F08A5C /* RBSplitSubview.m */,
|
||||
BD476E2D0DAAD74400F08A5C /* RBSplitView.h */,
|
||||
BD476E2E0DAAD74400F08A5C /* RBSplitView.m */,
|
||||
BD476E2F0DAAD74400F08A5C /* RBSplitViewPrivateDefines.h */,
|
||||
0395A9BD0D75D02400881434 /* AuthorizedShellCommand.h */,
|
||||
0395A9BE0D75D02400881434 /* AuthorizedShellCommand.m */,
|
||||
0395A8310D71ED7800881434 /* DBPrefsWindowController.h */,
|
||||
0395A8320D71ED7800881434 /* DBPrefsWindowController.m */,
|
||||
1DE3F8E80D50F84600052B9E /* MMPreferenceController.h */,
|
||||
@@ -362,13 +286,6 @@
|
||||
1D1474960C56703C0038FA2B /* MacVim.m */,
|
||||
32CA4F630368D1EE00C91783 /* MacVim_Prefix.pch */,
|
||||
29B97316FDCFA39411CA2CEA /* main.m */,
|
||||
BDA8B1100D9F8A8500B3511A /* MMPlugInManager.h */,
|
||||
BDA8B1110D9F8A8500B3511A /* MMPlugInManager.m */,
|
||||
BD943D310DA2EA2500A02D9B /* PlugInInterface.h */,
|
||||
BD943D510DA3050B00A02D9B /* PlugInImpl.h */,
|
||||
BD943D520DA3050B00A02D9B /* PlugInImpl.m */,
|
||||
BD9DF0AE0DB41E780025C97C /* PlugInGUI.h */,
|
||||
BD9DF0AF0DB41E780025C97C /* PlugInGUI.m */,
|
||||
);
|
||||
name = "MacVim Source";
|
||||
sourceTree = "<group>";
|
||||
@@ -484,9 +401,7 @@
|
||||
1D9C602E0EF79C0C0034AD44 /* MacVim.icns */,
|
||||
1D8BEA73104992290069B072 /* FindAndReplace.nib */,
|
||||
0395A8A90D72D88B00881434 /* General.png */,
|
||||
0395A9590D74D47B00881434 /* Integration.png */,
|
||||
1D22374A0E45DF4800E6FFFF /* Advanced.png */,
|
||||
BD9DF09F0DB2BA020025C97C /* PlugInView.nib */,
|
||||
1DD3D51D0D82D4C9006E4320 /* ibeam.png */,
|
||||
1D0F11480D58C77800D5DA09 /* Font */,
|
||||
1DE9726C0C48050600F96A9F /* Toolbar */,
|
||||
@@ -507,7 +422,6 @@
|
||||
children = (
|
||||
1D8B5A52104AF9FF002E59D5 /* Carbon.framework */,
|
||||
0395AA980D76E86200881434 /* Edit in ODBEditor */,
|
||||
0395A9C20D75D04D00881434 /* Security.framework */,
|
||||
1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */,
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
|
||||
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
|
||||
@@ -528,14 +442,12 @@
|
||||
1D0DCAD80BA3604D00B6CCFA /* Copy Executables */,
|
||||
1D9EB2840C366D7B0074B739 /* Copy Frameworks */,
|
||||
1DE608B80C58807F0055263D /* Copy Vim Runtime Files */,
|
||||
0395AA790D76E77800881434 /* Copy ODBEditor */,
|
||||
1D1C31F00EFFBFD6003FE9A5 /* Make Document Icons */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
1D493DCD0C5254A400AB718C /* PBXTargetDependency */,
|
||||
0395AA240D76E2F300881434 /* PBXTargetDependency */,
|
||||
);
|
||||
name = MacVim;
|
||||
productInstallPath = "$(HOME)/Applications";
|
||||
@@ -561,10 +473,6 @@
|
||||
mainGroup = 29B97314FDCFA39411CA2CEA /* MacVim */;
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
{
|
||||
ProductGroup = 0395AA1A0D76E22700881434 /* Products */;
|
||||
ProjectRef = 0395AA190D76E22700881434 /* Edit in ODBEditor.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 1D493DB40C52533B00AB718C /* Products */;
|
||||
ProjectRef = 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */;
|
||||
@@ -578,13 +486,6 @@
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
0395AA210D76E22700881434 /* Edit in ODBEditor.bundle */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.cfbundle;
|
||||
path = "Edit in ODBEditor.bundle";
|
||||
remoteRef = 0395AA200D76E22700881434 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
@@ -611,9 +512,7 @@
|
||||
1D3D19140CA690FF0004A0A5 /* DejaVuSansMono.ttf in Resources */,
|
||||
1DE3F8E70D50F80500052B9E /* Preferences.nib in Resources */,
|
||||
0395A8AA0D72D88B00881434 /* General.png in Resources */,
|
||||
0395A95A0D74D47B00881434 /* Integration.png in Resources */,
|
||||
1DD3D51E0D82D4C9006E4320 /* ibeam.png in Resources */,
|
||||
BD9DF0A00DB2BA020025C97C /* PlugInView.nib in Resources */,
|
||||
1D22374B0E45DF4800E6FFFF /* Advanced.png in Resources */,
|
||||
1DCD00BF0E50B2B700460166 /* Attention.png in Resources */,
|
||||
1DCD00C00E50B2B700460166 /* Copy.png in Resources */,
|
||||
@@ -683,28 +582,17 @@
|
||||
1DE9B9500D341AB8008FEDD4 /* MMWindow.m in Sources */,
|
||||
1DE3F8EB0D50F84600052B9E /* MMPreferenceController.m in Sources */,
|
||||
0395A8330D71ED7800881434 /* DBPrefsWindowController.m in Sources */,
|
||||
0395A9BF0D75D02400881434 /* AuthorizedShellCommand.m in Sources */,
|
||||
1D80591F0E1185EA001699D1 /* Miscellaneous.m in Sources */,
|
||||
BDA8B1120D9F8A8500B3511A /* MMPlugInManager.m in Sources */,
|
||||
BD943D530DA3050B00A02D9B /* PlugInImpl.m in Sources */,
|
||||
BD476E300DAAD74400F08A5C /* RBSplitSubview.m in Sources */,
|
||||
BD476E310DAAD74400F08A5C /* RBSplitView.m in Sources */,
|
||||
BD9DF0B00DB41E780025C97C /* PlugInGUI.m in Sources */,
|
||||
BD9DF0FB0DB48C860025C97C /* CTGradient.m in Sources */,
|
||||
1D145C7F0E5227CE00691AA0 /* MMTextViewHelper.m in Sources */,
|
||||
1D60088B0E96A0B2003763F0 /* MMFindReplaceController.m in Sources */,
|
||||
1DE63FFB0E71820F00959BDB /* MMCoreTextView.m in Sources */,
|
||||
1D44972211FCA9B400B0630F /* MMCoreTextView+ToolTip.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
0395AA240D76E2F300881434 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = "Edit in ODBEditor";
|
||||
targetProxy = 0395AA230D76E2F300881434 /* PBXContainerItemProxy */;
|
||||
};
|
||||
1D493DCD0C5254A400AB718C /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = PSMTabBarControlFramework;
|
||||
|
||||
@@ -45,9 +45,6 @@ extern NSString *MMCurrentPreferencePaneKey;
|
||||
extern NSString *MMLoginShellCommandKey;
|
||||
extern NSString *MMLoginShellArgumentKey;
|
||||
extern NSString *MMDialogsTrackPwdKey;
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
extern NSString *MMShowLeftPlugInContainerKey;
|
||||
#endif
|
||||
extern NSString *MMOpenLayoutKey;
|
||||
extern NSString *MMVerticalSplitKey;
|
||||
extern NSString *MMPreloadCacheSizeKey;
|
||||
|
||||
@@ -37,9 +37,6 @@ NSString *MMCurrentPreferencePaneKey = @"MMCurrentPreferencePane";
|
||||
NSString *MMLoginShellCommandKey = @"MMLoginShellCommand";
|
||||
NSString *MMLoginShellArgumentKey = @"MMLoginShellArgument";
|
||||
NSString *MMDialogsTrackPwdKey = @"MMDialogsTrackPwd";
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
NSString *MMShowLeftPlugInContainerKey = @"MMShowLeftPlugInContainer";
|
||||
#endif
|
||||
NSString *MMOpenLayoutKey = @"MMOpenLayout";
|
||||
NSString *MMVerticalSplitKey = @"MMVerticalSplit";
|
||||
NSString *MMPreloadCacheSizeKey = @"MMPreloadCacheSize";
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/* vi:set ts=8 sts=4 sw=4 ft=objc:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "RBSplitView.h"
|
||||
|
||||
|
||||
@class MMPlugInView;
|
||||
@class MMPlugInViewContainer;
|
||||
@class MMPlugInViewController;
|
||||
|
||||
@interface MMPlugInViewHeader : NSView {
|
||||
IBOutlet MMPlugInViewController *controller;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface MMPlugInView : RBSplitSubview {
|
||||
IBOutlet MMPlugInViewController *controller;
|
||||
}
|
||||
|
||||
- (MMPlugInViewController *)controller;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMPlugInViewController : NSObject {
|
||||
IBOutlet RBSplitSubview *plugInSubview;
|
||||
IBOutlet MMPlugInViewHeader *headerView;
|
||||
IBOutlet NSView *contentView;
|
||||
IBOutlet NSTextField *titleField;
|
||||
}
|
||||
|
||||
- (id)initWithView:(NSView *)view title:(NSString *)title;
|
||||
- (void)moveToContainer:(MMPlugInViewContainer *)container;
|
||||
- (RBSplitSubview *)plugInSubview;
|
||||
- (MMPlugInViewContainer *)container;
|
||||
|
||||
// called when the dropView on the container holding this plugin view was
|
||||
// changed, and this was the current dropView or it is the new dropView
|
||||
- (void)dropViewChanged;
|
||||
@end
|
||||
|
||||
@interface MMPlugInViewContainer : RBSplitView {
|
||||
RBSplitSubview *fillerView;
|
||||
|
||||
// only used during drag and drop
|
||||
MMPlugInView *dropView;
|
||||
}
|
||||
|
||||
- (MMPlugInView *)dropView;
|
||||
@end
|
||||
@@ -1,334 +0,0 @@
|
||||
/* vi:set ts=8 sts=4 sw=4 ft=objc:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* MMPlugInViewHeader
|
||||
*
|
||||
* Essentially just a title bar for a plugin view. Handles drawing the
|
||||
* drag-and-drop line where a new plugin view will be inserted.
|
||||
*
|
||||
* MMPlugInView
|
||||
*
|
||||
* This contains a single view added by a plugin.
|
||||
*
|
||||
* MMPlugInViewContainer
|
||||
*
|
||||
* This contains multiple MMPlugInViews. It handles the drag and drop aspects
|
||||
* of the views, as well.
|
||||
*
|
||||
* Author: Matt Tolton
|
||||
*/
|
||||
#import "MacVim.h"
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
|
||||
#import "PlugInGUI.h"
|
||||
#import "CTGradient.h"
|
||||
|
||||
NSString *MMPlugInViewPboardType = @"MMPlugInViewPboardType";
|
||||
|
||||
@implementation MMPlugInViewHeader
|
||||
|
||||
- (void)mouseDown:(NSEvent *)theEvent
|
||||
{
|
||||
// Make image from view
|
||||
NSView *view = self;
|
||||
[view lockFocus];
|
||||
NSBitmapImageRep *bitmap = [[[NSBitmapImageRep alloc]
|
||||
initWithFocusedViewRect: [view bounds]] autorelease];
|
||||
[view unlockFocus];
|
||||
|
||||
NSImage *image = [[[NSImage alloc] initWithSize: [view bounds].size]
|
||||
autorelease];
|
||||
[image addRepresentation:bitmap];
|
||||
|
||||
NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
|
||||
|
||||
[pboard declareTypes:[NSArray arrayWithObject:MMPlugInViewPboardType]
|
||||
owner:self];
|
||||
|
||||
NSPoint pt = [view convertPoint:[view bounds].origin
|
||||
toView:[controller plugInSubview]];
|
||||
[[controller plugInSubview] dragImage:image
|
||||
at:pt
|
||||
offset:NSMakeSize(0, 0)
|
||||
event:theEvent
|
||||
pasteboard:pboard
|
||||
source:controller
|
||||
slideBack:YES];
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)rect
|
||||
{
|
||||
NSColor *startColor;
|
||||
startColor = [NSColor colorWithCalibratedRed:.600
|
||||
green:.600
|
||||
blue:.600
|
||||
alpha:1.0];
|
||||
|
||||
NSColor *endColor = [NSColor colorWithCalibratedRed:.800
|
||||
green:.800
|
||||
blue:.800
|
||||
alpha:1.0];
|
||||
|
||||
CTGradient *grad = [CTGradient gradientWithBeginningColor:startColor
|
||||
endingColor:endColor];
|
||||
[grad fillRect:[self bounds] angle:90];
|
||||
|
||||
MMPlugInView *dropView = [[controller container] dropView];
|
||||
|
||||
if (dropView == [controller plugInSubview]) {
|
||||
NSRect insertionRect = NSMakeRect(0,[self bounds].size.height - 2,
|
||||
[self bounds].size.width, 2);
|
||||
[[NSColor redColor] set];
|
||||
NSRectFill(insertionRect);
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)isOpaque
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSRect)dragRect
|
||||
{
|
||||
return NSMakeRect(0, [self bounds].size.height - 6, [self bounds].size.width, 6);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation MMPlugInView
|
||||
|
||||
- (MMPlugInViewController *)controller
|
||||
{
|
||||
return controller;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation MMPlugInViewController
|
||||
|
||||
- (id)initWithView:(NSView *)view title:(NSString *)title
|
||||
{
|
||||
if ((self = [super init]) == nil) return nil;
|
||||
|
||||
if (![NSBundle loadNibNamed:@"PlugInView" owner:self])
|
||||
ASLogErr(@"Error loading PlugIn nib");
|
||||
|
||||
[titleField setStringValue:title];
|
||||
|
||||
[plugInSubview setMinDimension:50
|
||||
andMaxDimension:0.0];
|
||||
|
||||
[view setFrame:[contentView bounds]];
|
||||
[contentView addSubview:view];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (RBSplitSubview *)plugInSubview
|
||||
{
|
||||
return plugInSubview;
|
||||
}
|
||||
|
||||
- (void)moveToContainer:(MMPlugInViewContainer *)container
|
||||
{
|
||||
if ([plugInSubview splitView]) {
|
||||
[plugInSubview removeFromSuperview];
|
||||
}
|
||||
[container addSubview:plugInSubview];
|
||||
}
|
||||
|
||||
- (void)moveToContainer:(MMPlugInViewContainer *)container before:(MMPlugInView *)lowerView
|
||||
{
|
||||
if ([plugInSubview splitView]) {
|
||||
[plugInSubview removeFromSuperview];
|
||||
}
|
||||
[container addSubview:plugInSubview positioned:NSWindowBelow relativeTo:lowerView];
|
||||
}
|
||||
|
||||
- (MMPlugInViewHeader *)headerView
|
||||
{
|
||||
return headerView;
|
||||
}
|
||||
|
||||
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal
|
||||
{
|
||||
if (isLocal)
|
||||
return NSDragOperationPrivate;
|
||||
else
|
||||
return NSDragOperationNone;
|
||||
}
|
||||
|
||||
- (void)dropViewChanged {
|
||||
[headerView setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
- (MMPlugInViewContainer *)container {
|
||||
return (MMPlugInViewContainer *)[plugInSubview splitView];
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation MMPlugInViewContainer
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame
|
||||
{
|
||||
if ((self = [super initWithFrame:frame]) == nil) return nil;
|
||||
|
||||
[self registerForDraggedTypes:
|
||||
[NSArray arrayWithObjects:MMPlugInViewPboardType, nil]];
|
||||
|
||||
[self setVertical:NO];
|
||||
[self setDelegate:self];
|
||||
|
||||
fillerView = [[RBSplitSubview alloc] initWithFrame:NSMakeRect(0,0,0,0)];
|
||||
[fillerView setHidden:YES];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
ASLogDebug(@"");
|
||||
|
||||
[fillerView release]; fillerView = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (unsigned int)splitView:(RBSplitView*)sender dividerForPoint:(NSPoint)point
|
||||
inSubview:(RBSplitSubview*)subview
|
||||
{
|
||||
MMPlugInViewController *controller = [(MMPlugInView *)subview controller];
|
||||
MMPlugInViewHeader *header = [controller headerView];
|
||||
|
||||
if ([header mouse:[header convertPoint:point fromView:sender]
|
||||
inRect:[header dragRect]])
|
||||
return [subview position] - 1;
|
||||
|
||||
return NSNotFound;
|
||||
}
|
||||
|
||||
- (NSRect)splitView:(RBSplitView*)sender cursorRect:(NSRect)rect
|
||||
forDivider:(unsigned int)theDivider
|
||||
{
|
||||
|
||||
if (theDivider != 0) return NSZeroRect;
|
||||
|
||||
int i;
|
||||
for (i = 1;; i++) {
|
||||
MMPlugInView *view = (MMPlugInView *)[sender subviewAtPosition:i];
|
||||
if (!view) break;
|
||||
|
||||
MMPlugInViewHeader *header = [[view controller] headerView];
|
||||
NSRect rect = [header dragRect];
|
||||
rect = [sender convertRect:rect fromView:header];
|
||||
[sender addCursorRect:rect
|
||||
cursor:[RBSplitView cursor:RBSVHorizontalCursor]];
|
||||
|
||||
}
|
||||
|
||||
return NSZeroRect;
|
||||
}
|
||||
|
||||
- (void)clearDragInfo
|
||||
{
|
||||
if (dropView) {
|
||||
MMPlugInView *save = dropView;
|
||||
dropView = nil;
|
||||
[[save controller] dropViewChanged];
|
||||
}
|
||||
}
|
||||
|
||||
// point should be in the window's coordinate system
|
||||
- (void)updateDragInfo:(id<NSDraggingInfo>)info
|
||||
{
|
||||
|
||||
[self clearDragInfo];
|
||||
|
||||
if (!([info draggingSourceOperationMask] & NSDragOperationPrivate)) return;
|
||||
|
||||
if (![[info draggingSource] isKindOfClass:[MMPlugInViewController class]]) return;
|
||||
|
||||
// for now has to be THIS container. in the future, it will be ok for any
|
||||
// container associated with the same vim instance
|
||||
if ([[info draggingSource] container] != self) return;
|
||||
|
||||
// XXX for now we just use the view that the mouse is currently over, and
|
||||
// always insert "above" that view. In the future, we might want to try to
|
||||
// find the divider that the mouse is closest to and have the dropView be
|
||||
// the view below that divider.
|
||||
|
||||
NSPoint point = [info draggingLocation];
|
||||
|
||||
int i;
|
||||
for (i = 0;; i++) {
|
||||
MMPlugInView *subview = (MMPlugInView *)[self subviewAtPosition:i];
|
||||
if (!subview) break;
|
||||
|
||||
if ([subview mouse:[subview convertPoint:point fromView:nil]
|
||||
inRect:[subview bounds]]) {
|
||||
dropView = subview;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ([[info draggingSource] plugInSubview] == dropView)
|
||||
dropView = nil;
|
||||
|
||||
if (dropView) [[dropView controller] dropViewChanged];
|
||||
}
|
||||
|
||||
- (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender
|
||||
{
|
||||
[self updateDragInfo:sender];
|
||||
|
||||
if (dropView != nil)
|
||||
return NSDragOperationPrivate;
|
||||
else
|
||||
return NSDragOperationNone;
|
||||
}
|
||||
|
||||
- (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)sender
|
||||
{
|
||||
[self updateDragInfo:sender];
|
||||
|
||||
if (dropView != nil)
|
||||
return NSDragOperationPrivate;
|
||||
|
||||
return NSDragOperationNone;
|
||||
}
|
||||
|
||||
- (BOOL)prepareForDragOperation:(id<NSDraggingInfo>)sender
|
||||
{
|
||||
[self updateDragInfo:sender];
|
||||
return dropView != nil;
|
||||
}
|
||||
|
||||
- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender
|
||||
{
|
||||
MMPlugInViewController *source = [sender draggingSource];
|
||||
[source moveToContainer:self before:dropView];
|
||||
[self clearDragInfo];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)draggingExited:(id<NSDraggingInfo>)sender
|
||||
{
|
||||
[self clearDragInfo];
|
||||
}
|
||||
|
||||
|
||||
- (MMPlugInView *)dropView {
|
||||
return dropView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,37 +0,0 @@
|
||||
/* vi:set ts=8 sts=4 sw=4 ft=objc:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PlugInInterface.h"
|
||||
|
||||
@interface MMPlugInAppMediator : NSObject <PlugInAppMediator> {
|
||||
NSMenu *plugInMenu;
|
||||
}
|
||||
|
||||
+ (MMPlugInAppMediator *)sharedAppMediator;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@class MMVimController;
|
||||
|
||||
// One of these per vim controller object. It manages all of the plugin
|
||||
// instances for a given controller.
|
||||
@interface MMPlugInInstanceMediator : NSObject <PlugInInstanceMediator> {
|
||||
// NB: this is a weak reference to the vim controller
|
||||
MMVimController *vimController;
|
||||
NSMutableArray *instances;
|
||||
NSDrawer *drawer;
|
||||
NSMutableArray *plugInViews ;
|
||||
}
|
||||
|
||||
- (id)initWithVimController:(MMVimController *)controller;
|
||||
|
||||
@end
|
||||
@@ -1,237 +0,0 @@
|
||||
/* vi:set ts=8 sts=4 sw=4 ft=objc:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* MMPlugInInstanceMediator
|
||||
*
|
||||
* Implementation of the PlugInInstanceMediator protocol. One of these is
|
||||
* created per vim instance. It manages all of the plugin instances for that
|
||||
* vim instance.
|
||||
*
|
||||
* MMPlugInAppMediator
|
||||
*
|
||||
* Implementation of the PlugInAppMediator protocol. Singleton class.
|
||||
*
|
||||
* Author: Matt Tolton
|
||||
*/
|
||||
|
||||
#import "Miscellaneous.h"
|
||||
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
|
||||
static int MMPlugInArchMajorVersion = 1;
|
||||
static int MMPlugInArchMinorVersion = 0;
|
||||
|
||||
#import "PlugInImpl.h"
|
||||
#import "PlugInGUI.h"
|
||||
#import "MMPlugInManager.h"
|
||||
#import "RBSplitView.h"
|
||||
#import "MMAppController.h"
|
||||
#import "MMVimController.h"
|
||||
|
||||
|
||||
@implementation MMPlugInInstanceMediator
|
||||
|
||||
- (void)setupDrawer
|
||||
{
|
||||
// XXX The drawer does not work in full screen mode. Eventually, the
|
||||
// drawer will go away so I'm ignoring this issue for now.
|
||||
drawer = [[NSDrawer alloc] initWithContentSize:NSMakeSize(200,100)
|
||||
preferredEdge:NSMinXEdge];
|
||||
|
||||
|
||||
NSSize contentSize = [drawer contentSize];
|
||||
|
||||
// XXX memory management for this
|
||||
MMPlugInViewContainer *containerView = [[MMPlugInViewContainer alloc]
|
||||
initWithFrame:NSMakeRect(0, 0, contentSize.width, contentSize.height)];
|
||||
|
||||
[drawer setContentView:containerView];
|
||||
|
||||
[containerView release];
|
||||
|
||||
[drawer setParentWindow:[[vimController windowController] window]];
|
||||
}
|
||||
|
||||
- (void)toggleDrawer
|
||||
{
|
||||
[drawer toggle:nil];
|
||||
[[NSUserDefaults standardUserDefaults]
|
||||
setBool:[drawer state] == NSDrawerOpenState
|
||||
|| [drawer state] == NSDrawerOpeningState
|
||||
forKey:MMShowLeftPlugInContainerKey];
|
||||
}
|
||||
|
||||
- (void)initializeInstances
|
||||
{
|
||||
NSArray *plugInClasses = [[MMPlugInManager sharedManager] plugInClasses];
|
||||
int i, count = [plugInClasses count];
|
||||
for (i = 0; i < count; i++) {
|
||||
Class plugInClass = [plugInClasses objectAtIndex:i];
|
||||
if ([plugInClass instancesRespondToSelector:
|
||||
@selector(initWithMediator:)]) {
|
||||
id instance = [[[plugInClass alloc] initWithMediator:self] autorelease];
|
||||
[instances addObject:instance];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (id)initWithVimController:(MMVimController *)controller
|
||||
{
|
||||
if ((self = [super init]) == nil) return nil;
|
||||
vimController = controller;
|
||||
instances = [[NSMutableArray alloc] init];
|
||||
plugInViews = [[NSMutableArray alloc] init];
|
||||
|
||||
[self setupDrawer];
|
||||
[self initializeInstances];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
ASLogDebug(@"");
|
||||
|
||||
[plugInViews release]; plugInViews = nil;
|
||||
[instances release]; instances = nil;
|
||||
[drawer release]; drawer = nil;
|
||||
vimController = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id)evaluateVimExpression:(NSString *)vimExpression
|
||||
{
|
||||
NSString *errstr = nil;
|
||||
id res = [vimController evaluateVimExpressionCocoa:vimExpression
|
||||
errorString:&errstr];
|
||||
if (!res) {
|
||||
// Setting format to %@ instead of just passing errstr avoids warning.
|
||||
[NSException raise:@"VimEvaluationException" format:@"%@", errstr];
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
- (void)addVimInput:(NSString *)input
|
||||
{
|
||||
[vimController addVimInput:input];
|
||||
}
|
||||
|
||||
- (void)addPlugInView:(NSView *)view withTitle:(NSString *)title
|
||||
{
|
||||
// Do this here so that the drawer is never opened automatically when there
|
||||
// are no plugin views.
|
||||
if ([[NSUserDefaults standardUserDefaults]
|
||||
boolForKey:MMShowLeftPlugInContainerKey] && [plugInViews count] == 0)
|
||||
[drawer open];
|
||||
|
||||
MMPlugInViewController *newView =
|
||||
[[MMPlugInViewController alloc] initWithView:view title:title];
|
||||
|
||||
[plugInViews addObject:newView];
|
||||
|
||||
[newView moveToContainer:(MMPlugInViewContainer *)[drawer contentView]];
|
||||
|
||||
[newView release];
|
||||
}
|
||||
|
||||
- (void)openFiles:(NSArray *)filenames
|
||||
{
|
||||
[vimController dropFiles:filenames forceOpen:YES];
|
||||
}
|
||||
|
||||
- (id)instanceWithClass:(Class)class
|
||||
{
|
||||
int i, count = [instances count];
|
||||
for (i = 0; i < count; i++) {
|
||||
id instance = [instances objectAtIndex:i];
|
||||
if ([instance isKindOfClass:class])
|
||||
return instance;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation MMPlugInAppMediator
|
||||
|
||||
MMPlugInAppMediator *sharedAppMediator = nil;
|
||||
|
||||
+ (MMPlugInAppMediator *)sharedAppMediator
|
||||
{
|
||||
if (sharedAppMediator == nil)
|
||||
sharedAppMediator = [[MMPlugInAppMediator alloc] init];
|
||||
|
||||
return sharedAppMediator;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init]) == nil) return nil;
|
||||
|
||||
NSString *title = NSLocalizedString(@"Toggle Left Drawer",
|
||||
@"Toggle Left Drawer menu title");
|
||||
NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:title
|
||||
action:@selector(toggleLeftDrawer:)
|
||||
keyEquivalent:@""] autorelease];
|
||||
[item setTarget:self];
|
||||
[self addPlugInMenuItem:item];
|
||||
[self addPlugInMenuItem:[NSMenuItem separatorItem]];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)toggleLeftDrawer:(id)sender
|
||||
{
|
||||
MMVimController *c = [[MMAppController sharedInstance] keyVimController];
|
||||
|
||||
[[c instanceMediator] toggleDrawer];
|
||||
}
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)item
|
||||
{
|
||||
return [[MMAppController sharedInstance] keyVimController] != nil;
|
||||
}
|
||||
|
||||
- (void)addPlugInMenuItem:(NSMenuItem *)menuItem
|
||||
{
|
||||
NSAssert(menuItem, @"menuItem cannot be nil");
|
||||
[[MMAppController sharedInstance] addItemToPlugInMenu:menuItem];
|
||||
}
|
||||
|
||||
// It is a little bit ugly having to pass the class in here. An alternative
|
||||
// would be to have a 1:1 relationship between app mediators and plugins, so
|
||||
// that we'd know exactly which plugin class to look for.
|
||||
- (id)keyPlugInInstanceWithClass:(Class)class
|
||||
{
|
||||
MMVimController *keyVimController = [[NSApp delegate] keyVimController];
|
||||
|
||||
if (keyVimController)
|
||||
return [[keyVimController instanceMediator] instanceWithClass:class];
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (int)majorVersion
|
||||
{
|
||||
return MMPlugInArchMajorVersion;
|
||||
}
|
||||
|
||||
- (int)minorVersion
|
||||
{
|
||||
return MMPlugInArchMinorVersion;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -1,72 +0,0 @@
|
||||
/* vi:set ts=8 sts=4 sw=4 ft=objc:
|
||||
*
|
||||
* VIM - Vi IMproved by Bram Moolenaar
|
||||
* MacVim GUI port by Bjorn Winckler
|
||||
*
|
||||
* Do ":help uganda" in Vim to read copying and usage conditions.
|
||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||
* See README.txt for an overview of the Vim source code.
|
||||
*/
|
||||
|
||||
// This header file should include everything that a plug-in will need so that
|
||||
// it is all we need to distribute for plug-in developers.
|
||||
|
||||
/*
|
||||
* PlugInAppMediator
|
||||
*
|
||||
* The interface that the plugin may use to interact with the MacVim
|
||||
* application.
|
||||
*
|
||||
* PlugInInstanceMediator
|
||||
*
|
||||
* The interface that a plugin may use to interact with a specific vim instance
|
||||
* within MacVim.
|
||||
*
|
||||
* PlugInProtocol
|
||||
*
|
||||
* The protocol which the principal class of the plugin must conform to.
|
||||
*
|
||||
* Author: Matt Tolton
|
||||
*
|
||||
*/
|
||||
|
||||
@protocol PlugInAppMediator
|
||||
|
||||
- (void)addPlugInMenuItem:(NSMenuItem *)menuItem;
|
||||
|
||||
// Returns the plugin instance of the specified class associated with the key vim window.
|
||||
// If a vim window is not the key window, returns nil.
|
||||
// If there are no instances with the specified class, returns nil.
|
||||
- (id)keyPlugInInstanceWithClass:(Class)class;
|
||||
|
||||
// Plugin architecture version. Major versions indicate API incompatibilities.
|
||||
// Minor versions may include additions, but nothing that should break current
|
||||
// plugins.
|
||||
- (int)majorVersion;
|
||||
- (int)minorVersion;
|
||||
|
||||
@end
|
||||
|
||||
@protocol PlugInInstanceMediator
|
||||
|
||||
// vim values are converted into NSNumber, NSString, NSArray, and NSDictionary
|
||||
- (id)evaluateVimExpression:(NSString *)vimExpression;
|
||||
- (void)addVimInput:(NSString *)input;
|
||||
- (void)openFiles:(NSArray *)fileNames;
|
||||
- (void)addPlugInView:(NSView *)view withTitle:(NSString *)title;
|
||||
|
||||
@end
|
||||
|
||||
@protocol PlugInProtocol
|
||||
// The mediator should not be retained. It will exist until terminatePlugIn is
|
||||
// called.
|
||||
+ (BOOL)initializePlugIn:(id<PlugInAppMediator>)mediator;
|
||||
+ (void)terminatePlugIn;
|
||||
@end
|
||||
|
||||
@interface NSObject (PlugInProtocol)
|
||||
// The mediator should not be retained. It will exist until it releases this
|
||||
// plugin instance, and is not valid after that.
|
||||
- (id)initWithMediator:(id<PlugInInstanceMediator>)mediator;
|
||||
@end
|
||||
|
||||
Generated
-98
@@ -1,98 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBClasses</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>MMPlugInView</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>OUTLETS</key>
|
||||
<dict>
|
||||
<key>controller</key>
|
||||
<string>MMPlugInViewController</string>
|
||||
</dict>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>RBSplitSubview</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>MMPlugInViewController</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>OUTLETS</key>
|
||||
<dict>
|
||||
<key>contentView</key>
|
||||
<string>NSView</string>
|
||||
<key>headerView</key>
|
||||
<string>MMPlugInViewHeader</string>
|
||||
<key>plugInSubview</key>
|
||||
<string>RBSplitSubview</string>
|
||||
<key>titleField</key>
|
||||
<string>NSTextField</string>
|
||||
</dict>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>RBSplitView</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>OUTLETS</key>
|
||||
<dict>
|
||||
<key>delegate</key>
|
||||
<string>id</string>
|
||||
</dict>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>RBSplitSubview</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>RBSplitSubview</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSView</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>FirstResponder</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSObject</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>ACTIONS</key>
|
||||
<dict>
|
||||
<key>didAdjustSubviews</key>
|
||||
<string>RBSplitView</string>
|
||||
<key>willAdjustSubviews</key>
|
||||
<string>RBSplitView</string>
|
||||
</dict>
|
||||
<key>CLASS</key>
|
||||
<string>NSObject</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>MMPlugInViewHeader</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>OUTLETS</key>
|
||||
<dict>
|
||||
<key>controller</key>
|
||||
<string>MMPlugInViewController</string>
|
||||
</dict>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSView</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>IBVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Generated
-20
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>629</string>
|
||||
<key>IBLastKnownRelativeProjectPath</key>
|
||||
<string>../MacVim.xcodeproj</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>6</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9D34</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCocoaFramework</string>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
Binary file not shown.
@@ -1,146 +0,0 @@
|
||||
//
|
||||
// RBSplitSubview.h version 1.1.4
|
||||
// RBSplitView
|
||||
//
|
||||
// Created by Rainer Brockerhoff on 19/11/2004.
|
||||
// Copyright 2004-2006 Rainer Brockerhoff.
|
||||
// Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class RBSplitView;
|
||||
|
||||
// These values are used to inquire about the status of a subview.
|
||||
typedef enum {
|
||||
RBSSubviewExpanding=-2,
|
||||
RBSSubviewCollapsing=-1,
|
||||
RBSSubviewNormal=0,
|
||||
RBSSubviewCollapsed=1
|
||||
} RBSSubviewStatus;
|
||||
|
||||
@interface RBSplitSubview : NSView {
|
||||
// Subclasses normally should use setter methods instead of changing instance variables by assignment.
|
||||
// Most getter methods simply return the corresponding instance variable, so with some care, subclasses
|
||||
// could reference them directly.
|
||||
NSString* identifier; // An identifier string for the subview, default is @"".
|
||||
int tag; // A tag integer for the subview, default is 0.
|
||||
float minDimension; // The minimum dimension. Must be 1.0 or any larger integer.
|
||||
float maxDimension; // The maximum dimension. Must be at least equal to the minDimension.
|
||||
// Set to a large number if there's no maximum.
|
||||
double fraction; // A fractional part of the dimension, used for proportional resizing.
|
||||
// Normally varies between -0.999... and 0.999...
|
||||
// When collapsed, holds the proportion of the RBSplitView's dimension
|
||||
// the view was occupying before collapsing.
|
||||
NSRect previous; // Holds the frame rect for the last delegate notification.
|
||||
NSSize savedSize; // This holds the size the subview had before it was resized beyond
|
||||
// its minimum or maximum limits. Valid if notInLimits is YES.
|
||||
unsigned int actDivider; // This is set temporarily while an alternate drag view is being dragged.
|
||||
BOOL canDragWindow; // This is set temporarily during a mouseDown on a non-opaque subview.
|
||||
BOOL canCollapse; // YES if the subview can be collapsed.
|
||||
BOOL notInLimits; // YES if the subview's dimensions are outside the set limits.
|
||||
}
|
||||
|
||||
// This class method returns YES if some RBSplitSubview is being animated.
|
||||
+ (BOOL)animating;
|
||||
|
||||
// This is the designated initializer for creating extra subviews programmatically.
|
||||
- (id)initWithFrame:(NSRect)frame;
|
||||
|
||||
// Returns the immediately containing RBSplitView, or nil if there is none.
|
||||
// couplingSplitView returns nil if we're a non-coupled RBSplitView.
|
||||
// outermostSplitView returns the outermost RBSplitView.
|
||||
- (RBSplitView*)splitView;
|
||||
- (RBSplitView*)couplingSplitView;
|
||||
- (RBSplitView*)outermostSplitView;
|
||||
|
||||
// Returns self if we're a RBSplitView, nil otherwise. Convenient for testing or calling methods.
|
||||
// coupledSplitView returns nil if we're a non-coupled RBSplitView.
|
||||
- (RBSplitView*)asSplitView;
|
||||
- (RBSplitView*)coupledSplitView;
|
||||
|
||||
// Sets and gets the coupling between the view and its containing RBSplitView (if any). Coupled
|
||||
// RBSplitViews take some parameters, such as divider images, from the containing view. The default
|
||||
// for RBSplitView is YES. However, calling setCoupled: on a RBSplitSubview will have no effect,
|
||||
// and isCoupled will always return false.
|
||||
- (void)setCoupled:(BOOL)flag;
|
||||
- (BOOL)isCoupled;
|
||||
|
||||
// Returns YES if the containing RBSplitView is horizontal.
|
||||
- (BOOL)splitViewIsHorizontal;
|
||||
|
||||
// Returns the number of subviews. Just a convenience method.
|
||||
- (unsigned)numberOfSubviews;
|
||||
|
||||
// Sets and gets the tag.
|
||||
- (void)setTag:(int)theTag;
|
||||
- (int)tag;
|
||||
|
||||
// Sets and gets the identifier string. Will never be nil.
|
||||
- (void)setIdentifier:(NSString*)aString;
|
||||
- (NSString*)identifier;
|
||||
|
||||
// Position means the subview's position within the RBSplitView - counts from zero left to right
|
||||
// or top to bottom. Setting it will move the subview to another position without changing its size,
|
||||
// status or attributes. Set position to 0 to move it to the start, or to some large number to move it
|
||||
// to the end of the RBSplitView.
|
||||
- (unsigned)position;
|
||||
- (void)setPosition:(unsigned)newPosition;
|
||||
|
||||
// Returns YES if the subview is collapsed. Collapsed subviews are squashed down to zero but never
|
||||
// made smaller than the minimum dimension as far as their own subviews are concerned. If the
|
||||
// subview is being animated this will return NO.
|
||||
- (BOOL)isCollapsed;
|
||||
|
||||
// This will return the current status of the subview. Negative values mean the subview is
|
||||
// being animated.
|
||||
- (RBSSubviewStatus)status;
|
||||
|
||||
// Sets and gets the ability to collapse the subview. However, this can be overridden by the delegate.
|
||||
- (BOOL)canCollapse;
|
||||
- (void)setCanCollapse:(BOOL)flag;
|
||||
|
||||
// Tests whether the subview can shrink or expand further.
|
||||
- (BOOL)canShrink;
|
||||
- (BOOL)canExpand;
|
||||
|
||||
// Sets and gets the minimum and maximum dimensions. They're set at the same time to make sure values
|
||||
// are consistent. Despite being floats, they'll always have integer values. The minimum value for the
|
||||
// minimum is 1.0. Pass 0.0 for the maximum to set it to some huge number.
|
||||
- (float)minDimension;
|
||||
- (float)maxDimension;
|
||||
- (void)setMinDimension:(float)newMinDimension andMaxDimension:(float)newMaxDimension;
|
||||
|
||||
// Call this to expand a subview programmatically. It will return the subview's dimension after
|
||||
// expansion.
|
||||
- (float)expand;
|
||||
|
||||
// Call this to collapse a subview programmatically. It will return the negative
|
||||
// of the subview's dimension _before_ collapsing, or 0.0 if the subview can't be collapsed.
|
||||
- (float)collapse;
|
||||
|
||||
// These calls collapse and expand subviews with animation. They return YES if animation
|
||||
// startup was successful.
|
||||
- (BOOL)collapseWithAnimation;
|
||||
- (BOOL)expandWithAnimation;
|
||||
|
||||
// These methods collapse and expand subviews with animation, depending on the parameters.
|
||||
// They return YES if animation startup was successful. If resize is NO, the subview is
|
||||
// collapsed/expanded without resizing it during animation.
|
||||
- (BOOL)collapseWithAnimation:(BOOL)animate withResize:(BOOL)resize;
|
||||
- (BOOL)expandWithAnimation:(BOOL)animate withResize:(BOOL)resize;
|
||||
|
||||
// Returns the current dimension of the subview.
|
||||
- (float)dimension;
|
||||
|
||||
// Sets the current dimension of the subview, subject to the current maximum and minimum.
|
||||
// If the subview is collapsed, this has no immediate effect.
|
||||
- (void)setDimension:(float)value;
|
||||
|
||||
// This method is used internally when a divider is dragged. It tries to change the subview's dimension
|
||||
// and returns the actual change, collapsing or expanding whenever possible. You usually won't need
|
||||
// to call this directly.
|
||||
- (float)changeDimensionBy:(float)increment mayCollapse:(BOOL)mayCollapse move:(BOOL)move;
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,929 +0,0 @@
|
||||
//
|
||||
// RBSplitSubview.m version 1.1.4
|
||||
// RBSplitView
|
||||
//
|
||||
// Created by Rainer Brockerhoff on 19/11/2004.
|
||||
// Copyright 2004-2006 Rainer Brockerhoff.
|
||||
// Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License.
|
||||
//
|
||||
#ifdef MM_ENABLE_PLUGINS
|
||||
|
||||
#import "RBSplitView.h"
|
||||
#import "RBSplitViewPrivateDefines.h"
|
||||
|
||||
// This variable points to the animation data structure while an animation is in
|
||||
// progress; if there's none, it will be NULL. Animating may be very CPU-intensive so
|
||||
// we allow only one animation to take place at a time.
|
||||
static animationData* currentAnimation = NULL;
|
||||
|
||||
@implementation RBSplitSubview
|
||||
|
||||
// This class method returns YES if an animation is in progress.
|
||||
+ (BOOL)animating {
|
||||
return currentAnimation!=NULL;
|
||||
}
|
||||
|
||||
// This is the designated initializer for RBSplitSubview. It sets some reasonable defaults. However, you
|
||||
// can't rely on anything working until you insert it into a RBSplitView.
|
||||
- (id)initWithFrame:(NSRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
fraction = 0.0;
|
||||
canCollapse = NO;
|
||||
notInLimits = NO;
|
||||
minDimension = 1.0;
|
||||
maxDimension = WAYOUT;
|
||||
identifier = @"";
|
||||
previous = NSZeroRect;
|
||||
savedSize = frame.size;
|
||||
actDivider = NSNotFound;
|
||||
canDragWindow = NO;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
// Just releases our stuff when going away.
|
||||
- (void)dealloc {
|
||||
[identifier release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
// These return nil since we're not a RBSplitView (they're overridden there).
|
||||
- (RBSplitView*)asSplitView {
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (RBSplitView*)coupledSplitView {
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Sets and gets the coupling between a RBSplitView and its containing RBSplitView (if any).
|
||||
// For convenience, these methods are also implemented here.
|
||||
- (void)setCoupled:(BOOL)flag {
|
||||
}
|
||||
|
||||
- (BOOL)isCoupled {
|
||||
return NO;
|
||||
}
|
||||
|
||||
// RBSplitSubviews are never flipped, unless they're RBSplitViews.
|
||||
- (BOOL)isFlipped {
|
||||
return NO;
|
||||
}
|
||||
|
||||
// We copy the opacity of the owning split view.
|
||||
- (BOOL)isOpaque {
|
||||
return [[self couplingSplitView] isOpaque];
|
||||
}
|
||||
|
||||
// A hidden RBSplitSubview is not redrawn and is not considered for drawing dividers.
|
||||
// This won't work before 10.3, though.
|
||||
- (void)setHidden:(BOOL)flag {
|
||||
if ([self isHidden]!=flag) {
|
||||
RBSplitView* sv = [self splitView];
|
||||
[self RB___setHidden:flag];
|
||||
if (flag) {
|
||||
[sv adjustSubviews];
|
||||
} else {
|
||||
[sv adjustSubviewsExcepting:self];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// RBSplitSubviews can't be in the responder chain.
|
||||
- (BOOL)acceptsFirstResponder {
|
||||
return NO;
|
||||
}
|
||||
|
||||
// Mousing down should move the window only for a completely transparent background. This might have
|
||||
// unintended side effects in metal windows, so for those you might want to use a background color
|
||||
// with a very low alpha (0.01 for instance).
|
||||
// This is commented out as I'm still experimenting with it.
|
||||
/*- (BOOL)mouseDownCanMoveWindow {
|
||||
RBSplitView* sv = [self asSplitView];
|
||||
if (!sv) {
|
||||
sv = [self couplingSplitView];
|
||||
}
|
||||
return [sv background]==nil;
|
||||
return YES;
|
||||
}*/
|
||||
|
||||
// This returns the owning splitview. It's guaranteed to return a RBSplitView or nil.
|
||||
// You should avoid having "orphan" RBSplitSubviews, or at least manipulating
|
||||
// them while they're not inserted in a RBSplitView.
|
||||
- (RBSplitView*)splitView {
|
||||
id result = [self superview];
|
||||
if ([result isKindOfClass:[RBSplitView class]]) {
|
||||
return (RBSplitView*)result;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
// This also returns the owning splitview. It's overridden for nested RBSplitViews.
|
||||
- (RBSplitView*)couplingSplitView {
|
||||
id result = [self superview];
|
||||
if ([result isKindOfClass:[RBSplitView class]]) {
|
||||
return (RBSplitView*)result;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
// This returns the outermost directly containing RBSplitView, or nil.
|
||||
- (RBSplitView*)outermostSplitView {
|
||||
id result = nil;
|
||||
id sv = self;
|
||||
while ((sv = [sv superview])&&[sv isKindOfClass:[RBSplitView class]]) {
|
||||
result = sv;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// This convenience method returns YES if the containing RBSplitView is horizontal.
|
||||
- (BOOL)splitViewIsHorizontal {
|
||||
return [[self splitView] isHorizontal];
|
||||
}
|
||||
|
||||
// You can use either tags (ints) or identifiers (NSStrings) to identify individual subviews.
|
||||
// We take care not to have nil identifiers.
|
||||
- (void)setTag:(int)theTag {
|
||||
tag = theTag;
|
||||
}
|
||||
|
||||
- (int)tag {
|
||||
return tag;
|
||||
}
|
||||
|
||||
- (void)setIdentifier:(NSString*)aString {
|
||||
[identifier autorelease];
|
||||
identifier = aString?[aString retain]:@"";
|
||||
}
|
||||
|
||||
- (NSString*)identifier {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
// If we have an identifier, this will make debugging a little easier by appending it to the
|
||||
// default description.
|
||||
- (NSString*)description {
|
||||
return [identifier length]>0?[NSString stringWithFormat:@"%@(%@)",[super description],identifier]:[super description];
|
||||
}
|
||||
|
||||
// This pair of methods allows you to get and change the position of a subview (within the split view);
|
||||
// this counts from zero from the left or top of the split view.
|
||||
- (unsigned)position {
|
||||
RBSplitView* sv = [self splitView];
|
||||
return sv?[[sv subviews] indexOfObjectIdenticalTo:self]:0;
|
||||
}
|
||||
|
||||
- (void)setPosition:(unsigned)newPosition {
|
||||
RBSplitView* sv = [self splitView];
|
||||
if (sv) {
|
||||
[self retain];
|
||||
[self removeFromSuperviewWithoutNeedingDisplay];
|
||||
NSArray* subviews = [sv subviews];
|
||||
if (newPosition>=[subviews count]) {
|
||||
[sv addSubview:self positioned:NSWindowAbove relativeTo:nil];
|
||||
} else {
|
||||
[sv addSubview:self positioned:NSWindowBelow relativeTo:[subviews objectAtIndex:newPosition]];
|
||||
}
|
||||
[self release];
|
||||
}
|
||||
}
|
||||
|
||||
// Tests whether the subview is collapsed.
|
||||
- (BOOL)isCollapsed {
|
||||
return [self RB___visibleDimension]<=0.0;
|
||||
}
|
||||
|
||||
// Tests whether the subview can shrink further.
|
||||
- (BOOL)canShrink {
|
||||
return [self RB___visibleDimension]>([self canCollapse]?0.0:minDimension);
|
||||
}
|
||||
|
||||
// Tests whether the subview can expand further.
|
||||
- (BOOL)canExpand {
|
||||
return [self RB___visibleDimension]<maxDimension;
|
||||
}
|
||||
|
||||
// Returns the subview's status.
|
||||
- (RBSSubviewStatus)status {
|
||||
animationData* anim = [self RB___animationData:NO resize:NO];
|
||||
if (anim) {
|
||||
return anim->collapsing?RBSSubviewCollapsing:RBSSubviewExpanding;
|
||||
}
|
||||
return [self RB___visibleDimension]<=0.0?RBSSubviewCollapsed:RBSSubviewNormal;
|
||||
}
|
||||
|
||||
// Tests whether the subview can be collapsed. The local instance variable will be overridden by the
|
||||
// delegate method if it's implemented.
|
||||
- (BOOL)canCollapse {
|
||||
BOOL result = canCollapse;
|
||||
RBSplitView* sv = [self splitView];
|
||||
if ([sv RB___numberOfSubviews]<2) {
|
||||
return NO;
|
||||
}
|
||||
id delegate = [sv delegate];
|
||||
if ([delegate respondsToSelector:@selector(splitView:canCollapse:)]) {
|
||||
result = [delegate splitView:sv canCollapse:self];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// This sets the subview's "canCollapse" flag. Ignored if the delegate's splitView:canCollapse:
|
||||
// method is implemented.
|
||||
- (void)setCanCollapse:(BOOL)flag {
|
||||
canCollapse = flag;
|
||||
}
|
||||
|
||||
// This expands a collapsed subview and calls the delegate's splitView:didExpand: method, if it exists.
|
||||
// This is not called internally by other methods; call this to expand a subview programmatically.
|
||||
// As a convenience to other methods, it returns the subview's dimension after expanding (this may be
|
||||
// off by 1 pixel due to rounding) or 0.0 if it couldn't be expanded.
|
||||
// The delegate should not change the subview's frame.
|
||||
- (float)expand {
|
||||
return [self RB___expandAndSetToMinimum:NO];
|
||||
}
|
||||
|
||||
// This collapses an expanded subview and calls the delegate's splitView:didCollapse: method, if it exists.
|
||||
// This is not called internally by other methods; call this to expand a subview programmatically.
|
||||
// As a convenience to other methods, it returns the negative of the subview's dimension before
|
||||
// collapsing (or 0.0 if it couldn't be collapsed).
|
||||
// The delegate should not change the subview's frame.
|
||||
- (float)collapse {
|
||||
return [self RB___collapse];
|
||||
}
|
||||
|
||||
// This tries to collapse the subview with animation, and collapses it instantly if some other
|
||||
// subview is animating. Returns YES if animation was started successfully.
|
||||
- (BOOL)collapseWithAnimation {
|
||||
return [self collapseWithAnimation:YES withResize:YES];
|
||||
}
|
||||
|
||||
// This tries to expand the subview with animation, and expands it instantly if some other
|
||||
// subview is animating. Returns YES if animation was started successfully.
|
||||
- (BOOL)expandWithAnimation {
|
||||
return [self expandWithAnimation:YES withResize:YES];
|
||||
}
|
||||
|
||||
// These methods collapse and expand subviews with animation, depending on the parameters.
|
||||
// They return YES if animation startup was successful. If resize is NO, the subview is
|
||||
// collapsed/expanded without resizing it during animation.
|
||||
- (BOOL)collapseWithAnimation:(BOOL)animate withResize:(BOOL)resize {
|
||||
if ([self status]==RBSSubviewNormal) {
|
||||
if ([self canCollapse]) {
|
||||
if (animate&&[self RB___animationData:YES resize:resize]) {
|
||||
[self RB___clearResponder];
|
||||
[self RB___stepAnimation];
|
||||
return YES;
|
||||
} else {
|
||||
[self RB___collapse];
|
||||
}
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)expandWithAnimation:(BOOL)animate withResize:(BOOL)resize {
|
||||
if ([self status]==RBSSubviewCollapsed) {
|
||||
if (animate&&[self RB___animationData:YES resize:resize]) {
|
||||
[self RB___stepAnimation];
|
||||
return YES;
|
||||
} else {
|
||||
[self RB___expandAndSetToMinimum:NO];
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
// These 3 methods get and set the view's minimum and maximum dimensions.
|
||||
// The minimum dimension ought to be an integer at least equal to 1.0 but we make sure.
|
||||
// The maximum dimension ought to be an integer at least equal to the minimum. As a convenience,
|
||||
// pass in zero to set it to some huge number.
|
||||
- (float)minDimension {
|
||||
return minDimension;
|
||||
}
|
||||
|
||||
- (float)maxDimension {
|
||||
return maxDimension;
|
||||
}
|
||||
|
||||
- (void)setMinDimension:(float)newMinDimension andMaxDimension:(float)newMaxDimension {
|
||||
minDimension = MAX(1.0,floorf(newMinDimension));
|
||||
if (newMaxDimension<1.0) {
|
||||
newMaxDimension = WAYOUT;
|
||||
}
|
||||
maxDimension = MAX(minDimension,floorf(newMaxDimension));
|
||||
float dim = [self dimension];
|
||||
if ((dim<minDimension)||(dim>maxDimension)) {
|
||||
[[self splitView] setMustAdjust];
|
||||
}
|
||||
}
|
||||
|
||||
// This returns the subview's dimension. If it's collapsed, it returns the dimension it would have
|
||||
// after expanding.
|
||||
- (float)dimension {
|
||||
float dim = [self RB___visibleDimension];
|
||||
if (dim<=0.0) {
|
||||
dim = [[self splitView] RB___dimensionWithoutDividers]*fraction;
|
||||
if (dim<minDimension) {
|
||||
dim = minDimension;
|
||||
} else if (dim>maxDimension) {
|
||||
dim = maxDimension;
|
||||
}
|
||||
}
|
||||
return dim;
|
||||
}
|
||||
|
||||
// Sets the current dimension of the subview, subject to the current maximum and minimum.
|
||||
// If the subview is collapsed, this will have an effect only after reexpanding.
|
||||
- (void)setDimension:(float)value {
|
||||
RBSplitView* sv = [self splitView];
|
||||
NSSize size = [self frame].size;
|
||||
BOOL ishor = [sv isHorizontal];
|
||||
if (DIM(size)>0.0) {
|
||||
// We're not collapsed, set the size and adjust other subviews.
|
||||
DIM(size) = value;
|
||||
[self setFrameSize:size];
|
||||
[sv adjustSubviewsExcepting:self];
|
||||
} else {
|
||||
// We're collapsed, adjust the fraction so that we'll have the (approximately) correct
|
||||
// dimension after expanding.
|
||||
fraction = value/[sv RB___dimensionWithoutDividers];
|
||||
}
|
||||
}
|
||||
|
||||
// This just draws the background of a subview, then tells the delegate, if any.
|
||||
// The delegate would usually draw a frame inside the subview.
|
||||
- (void)drawRect:(NSRect)rect {
|
||||
RBSplitView* sv = [self splitView];
|
||||
NSColor* bg = [sv background];
|
||||
if (bg) {
|
||||
[bg set];
|
||||
NSRectFillUsingOperation(rect,NSCompositeSourceOver);
|
||||
}
|
||||
id del = [sv delegate];
|
||||
if ([del respondsToSelector:@selector(splitView:willDrawSubview:inRect:)]) {
|
||||
[del splitView:sv willDrawSubview:self inRect:rect];
|
||||
}
|
||||
}
|
||||
|
||||
// We check if the RBSplitView must be adjusted before redisplaying programmatically.
|
||||
// if so, we adjust and display the whole RBSplitView.
|
||||
- (void)display {
|
||||
RBSplitView* sv = [self splitView];
|
||||
if (sv) {
|
||||
if ([sv mustAdjust]) {
|
||||
[sv display];
|
||||
} else {
|
||||
[super display];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// RBSplitSubviews will always resize their own subviews.
|
||||
- (BOOL)autoresizesSubviews {
|
||||
return YES;
|
||||
}
|
||||
|
||||
// This is method is called automatically when the subview is resized; don't call it yourself.
|
||||
- (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize {
|
||||
RBSplitView* sv = [self splitView];
|
||||
if (sv) {
|
||||
BOOL ishor = [sv isHorizontal];
|
||||
NSRect frame = [self frame];
|
||||
float dim = DIM(frame.size);
|
||||
float other = OTHER(frame.size);
|
||||
// We resize subviews only when we're inside the subview's limits and the containing splitview's limits.
|
||||
animationData* anim = [self RB___animationData:NO resize:NO];
|
||||
if ((dim>=(anim&&!anim->resizing?anim->dimension:minDimension))&&(dim<=maxDimension)&&(other>=[sv minDimension])&&(other<=[sv maxDimension])) {
|
||||
if (notInLimits) {
|
||||
// The subviews can be resized, so we restore the saved size.
|
||||
oldBoundsSize = savedSize;
|
||||
}
|
||||
// We save the size every time the subview's subviews are resized within the limits.
|
||||
notInLimits = NO;
|
||||
savedSize = frame.size;
|
||||
[super resizeSubviewsWithOldSize:oldBoundsSize];
|
||||
} else {
|
||||
notInLimits = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This method is used internally when a divider is dragged. It tries to change the subview's dimension
|
||||
// and returns the actual change, collapsing or expanding whenever possible. You usually won't need
|
||||
// to call this directly.
|
||||
- (float)changeDimensionBy:(float)increment mayCollapse:(BOOL)mayCollapse move:(BOOL)move {
|
||||
RBSplitView* sv = [self splitView];
|
||||
if (!sv||(fabsf(increment)<1.0)) {
|
||||
return 0.0;
|
||||
}
|
||||
BOOL ishor = [sv isHorizontal];
|
||||
NSRect frame = [self frame];
|
||||
float olddim = DIM(frame.size);
|
||||
float newdim = MAX(0.0,olddim+increment);
|
||||
if (newdim<olddim) {
|
||||
if (newdim<minDimension) {
|
||||
// Collapse if needed
|
||||
if (mayCollapse&&[self canCollapse]&&(newdim<MAX(1.0,minDimension*(0.5-HYSTERESIS)))) {
|
||||
return [self RB___collapse];
|
||||
}
|
||||
newdim = minDimension;
|
||||
}
|
||||
} else if (newdim>olddim) {
|
||||
if (olddim<1.0) {
|
||||
// Expand if needed.
|
||||
if (newdim>(minDimension*(0.5+HYSTERESIS))) {
|
||||
newdim = MAX(newdim,[self RB___expandAndSetToMinimum:YES]);
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
if (newdim>maxDimension) {
|
||||
newdim = maxDimension;
|
||||
}
|
||||
}
|
||||
if ((int)newdim!=(int)olddim) {
|
||||
// The dimension has changed.
|
||||
increment = newdim-olddim;
|
||||
DIM(frame.size) = newdim;
|
||||
if (move) {
|
||||
DIM(frame.origin) -= increment;
|
||||
}
|
||||
// We call super instead of self here to postpone adjusting subviews for nested splitviews.
|
||||
// [super setFrameSize:frame.size];
|
||||
[super setFrame:frame];
|
||||
[sv RB___setMustClearFractions];
|
||||
[sv setMustAdjust];
|
||||
}
|
||||
return newdim-olddim;
|
||||
}
|
||||
|
||||
// This convenience method returns the number of subviews (surprise!)
|
||||
- (unsigned)numberOfSubviews {
|
||||
return [[self subviews] count];
|
||||
}
|
||||
|
||||
// We return the deepest subview that's hit by aPoint. We also check with the delegate if aPoint is
|
||||
// within an alternate drag view.
|
||||
- (NSView*)hitTest:(NSPoint)aPoint {
|
||||
RBSplitView* sv = [self splitView];
|
||||
if ([self mouse:aPoint inRect:[self frame]]) {
|
||||
id delegate = [sv delegate];
|
||||
if ([delegate respondsToSelector:@selector(splitView:dividerForPoint:inSubview:)]) {
|
||||
actDivider = [delegate splitView:sv dividerForPoint:aPoint inSubview:self];
|
||||
if ((int)actDivider<(int)([sv RB___numberOfSubviews]-1)) {
|
||||
return self;
|
||||
}
|
||||
}
|
||||
actDivider = NSNotFound;
|
||||
NSView* result = [super hitTest:aPoint];
|
||||
canDragWindow = ![result isOpaque];
|
||||
return result;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
// This method handles clicking and dragging in an empty portion of the subview, or in an alternate
|
||||
// drag view as designated by the delegate.
|
||||
- (void)mouseDown:(NSEvent*)theEvent {
|
||||
NSWindow* window = [self window];
|
||||
NSPoint where = [theEvent locationInWindow];
|
||||
if (actDivider<NSNotFound) {
|
||||
// The mouse down was inside an alternate drag view; actDivider was just set in hitTest.
|
||||
RBSplitView* sv = [self splitView];
|
||||
NSPoint point = [sv convertPoint:where fromView:nil];
|
||||
[[RBSplitView cursor:RBSVDragCursor] push];
|
||||
NSPoint base = NSZeroPoint;
|
||||
// Record the current divider coordinate.
|
||||
float divc = [sv RB___dividerOrigin:actDivider];
|
||||
BOOL ishor = [sv isHorizontal];
|
||||
[sv RB___setDragging:YES];
|
||||
// Loop while the button is down.
|
||||
while ((theEvent = [NSApp nextEventMatchingMask:NSLeftMouseDownMask|NSLeftMouseDraggedMask|NSLeftMouseUpMask untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:YES])&&([theEvent type]!=NSLeftMouseUp)) {
|
||||
// Set up a local autorelease pool for the loop to prevent buildup of temporary objects.
|
||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||
NSDisableScreenUpdates();
|
||||
// This does the actual movement.
|
||||
[sv RB___trackMouseEvent:theEvent from:point withBase:base inDivider:actDivider];
|
||||
if ([sv mustAdjust]) {
|
||||
// If something changed, we clear fractions and redisplay.
|
||||
[sv RB___setMustClearFractions];
|
||||
[sv display];
|
||||
}
|
||||
// Change the drag point by the actual amount moved.
|
||||
float newc = [sv RB___dividerOrigin:actDivider];
|
||||
DIM(point) += newc-divc;
|
||||
divc = newc;
|
||||
NSEnableScreenUpdates();
|
||||
[pool release];
|
||||
}
|
||||
[sv RB___setDragging:NO];
|
||||
[NSCursor pop];
|
||||
actDivider = NSNotFound;
|
||||
return;
|
||||
}
|
||||
if (canDragWindow&&[window isMovableByWindowBackground]&&![[self couplingSplitView] background]) {
|
||||
// If we get here, it's a textured (metal) window, the mouse has gone down on an non-opaque portion
|
||||
// of the subview, and our RBSplitView has a transparent background. RBSplitView returns NO to
|
||||
// mouseDownCanMoveWindow, but the window should move here - after all, the window background
|
||||
// is visible right here! So we fake it and move the window as intended. Mwahahaha!
|
||||
where = [window convertBaseToScreen:where];
|
||||
NSPoint origin = [window frame].origin;
|
||||
// Now we loop handling mouse events until we get a mouse up event.
|
||||
while ((theEvent = [NSApp nextEventMatchingMask:NSLeftMouseDownMask|NSLeftMouseDraggedMask|NSLeftMouseUpMask untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:YES])&&([theEvent type]!=NSLeftMouseUp)) {
|
||||
// Set up a local autorelease pool for the loop to prevent buildup of temporary objects.
|
||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||
NSPoint now = [window convertBaseToScreen:[theEvent locationInWindow]];
|
||||
origin.x += now.x-where.x;
|
||||
origin.y += now.y-where.y;
|
||||
// Move the window by the mouse displacement since the last event.
|
||||
[window setFrameOrigin:origin];
|
||||
where = now;
|
||||
[pool release];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// These two methods encode and decode subviews.
|
||||
- (void)encodeWithCoder:(NSCoder*)coder {
|
||||
NSRect frame;
|
||||
BOOL coll = [self isCollapsed];
|
||||
if (coll) {
|
||||
// We can't encode a collapsed subview as-is, so we correct the frame size first and add WAYOUT
|
||||
// to the origin to signal it was collapsed.
|
||||
NSRect newf = frame = [self frame];
|
||||
newf.origin.x += WAYOUT;
|
||||
[super setFrameOrigin:newf.origin];
|
||||
newf.size = savedSize;
|
||||
[super setFrameSize:newf.size];
|
||||
}
|
||||
[super encodeWithCoder:coder];
|
||||
if (coll) {
|
||||
[super setFrame:frame];
|
||||
}
|
||||
if ([coder allowsKeyedCoding]) {
|
||||
[coder encodeObject:identifier forKey:@"identifier"];
|
||||
[coder encodeInt:tag forKey:@"tag"];
|
||||
[coder encodeFloat:minDimension forKey:@"minDimension"];
|
||||
[coder encodeFloat:maxDimension forKey:@"maxDimension"];
|
||||
[coder encodeDouble:fraction forKey:@"fraction"];
|
||||
[coder encodeBool:canCollapse forKey:@"canCollapse"];
|
||||
} else {
|
||||
[coder encodeObject:identifier];
|
||||
[coder encodeValueOfObjCType:@encode(typeof(tag)) at:&tag];
|
||||
[coder encodeValueOfObjCType:@encode(typeof(minDimension)) at:&minDimension];
|
||||
[coder encodeValueOfObjCType:@encode(typeof(maxDimension)) at:&maxDimension];
|
||||
[coder encodeValueOfObjCType:@encode(typeof(fraction)) at:&fraction];
|
||||
[coder encodeValueOfObjCType:@encode(typeof(canCollapse)) at:&canCollapse];
|
||||
}
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(NSCoder*)coder {
|
||||
if ((self = [super initWithCoder:coder])) {
|
||||
fraction = 0.0;
|
||||
canCollapse = NO;
|
||||
notInLimits = NO;
|
||||
minDimension = 1.0;
|
||||
maxDimension = WAYOUT;
|
||||
identifier = @"";
|
||||
actDivider = NSNotFound;
|
||||
canDragWindow = NO;
|
||||
previous = [self frame];
|
||||
savedSize = previous.size;
|
||||
if (previous.origin.x>=WAYOUT) {
|
||||
// The subview was collapsed when encoded, so we correct the origin and collapse it.
|
||||
BOOL ishor = [self splitViewIsHorizontal];
|
||||
previous.origin.x -= WAYOUT;
|
||||
DIM(previous.size) = 0.0;
|
||||
[self setFrameOrigin:previous.origin];
|
||||
[self setFrameSize:previous.size];
|
||||
}
|
||||
previous = NSZeroRect;
|
||||
if ([coder allowsKeyedCoding]) {
|
||||
[self setIdentifier:[coder decodeObjectForKey:@"identifier"]];
|
||||
tag = [coder decodeIntForKey:@"tag"];
|
||||
minDimension = [coder decodeFloatForKey:@"minDimension"];
|
||||
maxDimension = [coder decodeFloatForKey:@"maxDimension"];
|
||||
fraction = [coder decodeDoubleForKey:@"fraction"];
|
||||
canCollapse = [coder decodeBoolForKey:@"canCollapse"];
|
||||
} else {
|
||||
[self setIdentifier:[coder decodeObject]];
|
||||
[coder decodeValueOfObjCType:@encode(typeof(tag)) at:&tag];
|
||||
[coder decodeValueOfObjCType:@encode(typeof(minDimension)) at:&minDimension];
|
||||
[coder decodeValueOfObjCType:@encode(typeof(maxDimension)) at:&maxDimension];
|
||||
[coder decodeValueOfObjCType:@encode(typeof(fraction)) at:&fraction];
|
||||
[coder decodeValueOfObjCType:@encode(typeof(canCollapse)) at:&canCollapse];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation RBSplitSubview (RB___SubviewAdditions)
|
||||
|
||||
// This hides/shows the subview without calling adjustSubview.
|
||||
- (void)RB___setHidden:(BOOL)flag {
|
||||
[super setHidden:flag];
|
||||
}
|
||||
|
||||
// This internal method returns the current animationData. It will always return nil if
|
||||
// the receiver isn't the current owner and some other subview is already being animated.
|
||||
// Otherwise, if the parameter is YES, a new animation will be started (or the current
|
||||
// one will be restarted).
|
||||
- (animationData*)RB___animationData:(BOOL)start resize:(BOOL)resize {
|
||||
if (currentAnimation&&(currentAnimation->owner!=self)) {
|
||||
// There already is an animation in progress on some other subview.
|
||||
return nil;
|
||||
}
|
||||
if (start) {
|
||||
// We want to start (or restart) an animation.
|
||||
RBSplitView* sv = [self splitView];
|
||||
if (sv) {
|
||||
float dim = [self dimension];
|
||||
// First assume the default time, then ask the delegate.
|
||||
NSTimeInterval total = dim*(0.2/150.0);
|
||||
id delegate = [sv delegate];
|
||||
if ([delegate respondsToSelector:@selector(splitView:willAnimateSubview:withDimension:)]) {
|
||||
total = [delegate splitView:sv willAnimateSubview:self withDimension:dim];
|
||||
}
|
||||
// No use animating anything shorter than the frametime.
|
||||
if (total>FRAMETIME) {
|
||||
if (!currentAnimation) {
|
||||
currentAnimation = (animationData*)malloc(sizeof(animationData));
|
||||
}
|
||||
if (currentAnimation) {
|
||||
currentAnimation->owner = self;
|
||||
currentAnimation->stepsDone = 0;
|
||||
currentAnimation->elapsedTime = 0.0;
|
||||
currentAnimation->dimension = dim;
|
||||
currentAnimation->collapsing = ![self isCollapsed];
|
||||
currentAnimation->totalTime = total;
|
||||
currentAnimation->finishTime = [NSDate timeIntervalSinceReferenceDate]+total;
|
||||
currentAnimation->resizing = resize;
|
||||
[sv RB___setDragging:YES];
|
||||
}
|
||||
} else if (currentAnimation) {
|
||||
free(currentAnimation);
|
||||
currentAnimation = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return currentAnimation;
|
||||
}
|
||||
|
||||
// This internal method steps the animation to the next frame.
|
||||
- (void)RB___stepAnimation {
|
||||
NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];
|
||||
animationData* anim = [self RB___animationData:NO resize:NO];
|
||||
if (anim) {
|
||||
RBSplitView* sv = [self splitView];
|
||||
NSTimeInterval remain = anim->finishTime-now;
|
||||
NSRect frame = [self frame];
|
||||
BOOL ishor = [sv isHorizontal];
|
||||
// Continuing animation only makes sense if we still have at least FRAMETIME available.
|
||||
if (remain>=FRAMETIME) {
|
||||
float dim = DIM(frame.size);
|
||||
float avg = anim->elapsedTime;
|
||||
// We try to keep a record of how long it takes, on the average, to resize and adjust
|
||||
// one animation frame.
|
||||
if (anim->stepsDone) {
|
||||
avg /= anim->stepsDone;
|
||||
}
|
||||
NSTimeInterval delay = MIN(0.0,FRAMETIME-avg);
|
||||
// We adjust the new dimension proportionally to how much of the designated time has passed.
|
||||
dim = floorf(anim->dimension*(remain-avg)/anim->totalTime);
|
||||
if (dim>4.0) {
|
||||
if (!anim->collapsing) {
|
||||
dim = anim->dimension-dim;
|
||||
}
|
||||
DIM(frame.size) = dim;
|
||||
[self RB___setFrame:frame withFraction:0.0 notify:NO];
|
||||
[sv adjustSubviews];
|
||||
[self display];
|
||||
anim->elapsedTime += [NSDate timeIntervalSinceReferenceDate]-now;
|
||||
++anim->stepsDone;
|
||||
// Schedule a timer to do the next animation step.
|
||||
[self performSelector:@selector(RB___stepAnimation) withObject:nil afterDelay:delay inModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode,NSModalPanelRunLoopMode,
|
||||
NSEventTrackingRunLoopMode,nil]];
|
||||
return;
|
||||
}
|
||||
}
|
||||
// We're finished, either collapse or expand entirely now.
|
||||
if (anim->collapsing) {
|
||||
DIM(frame.size) = 0.0;
|
||||
[self RB___finishCollapse:frame withFraction:anim->dimension/[sv RB___dimensionWithoutDividers]];
|
||||
} else {
|
||||
float savemin,savemax;
|
||||
float dim = [self RB___setMinAndMaxTo:anim->dimension savingMin:&savemin andMax:&savemax];
|
||||
DIM(frame.size) = dim;
|
||||
[self RB___finishExpand:frame withFraction:0.0];
|
||||
minDimension = savemin;
|
||||
maxDimension = savemax;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This internal method stops the animation, if the receiver is being animated. It will
|
||||
// return YES if the animation was stopped.
|
||||
- (BOOL)RB___stopAnimation {
|
||||
if (currentAnimation&&(currentAnimation->owner==self)) {
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(RB___stepAnimation) object:nil];
|
||||
free(currentAnimation);
|
||||
currentAnimation = NULL;
|
||||
[[self splitView] RB___setDragging:NO];
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
// This internal method returns the actual visible dimension of the subview. Differs from -dimension in
|
||||
// that it returns 0.0 if the subview is collapsed.
|
||||
- (float)RB___visibleDimension {
|
||||
BOOL ishor = [self splitViewIsHorizontal];
|
||||
NSRect frame = [self frame];
|
||||
return MAX(0.0,DIM(frame.size));
|
||||
}
|
||||
|
||||
// This pair of internal methods is used only inside -[RBSplitView adjustSubviews] to copy subview data
|
||||
// from and to that method's internal cache.
|
||||
- (void)RB___copyIntoCache:(subviewCache*)cache {
|
||||
cache->sub = self;
|
||||
cache->rect = [self frame];
|
||||
cache->size = [self RB___visibleDimension];
|
||||
cache->fraction = fraction;
|
||||
cache->constrain = NO;
|
||||
}
|
||||
|
||||
- (void)RB___updateFromCache:(subviewCache*)cache withTotalDimension:(float)value {
|
||||
float dim = [self RB___visibleDimension];
|
||||
if (cache->size>=1.0) {
|
||||
// New state is not collapsed.
|
||||
if (dim>=1.0) {
|
||||
// Old state was not collapsed, so we just change the frame.
|
||||
[self RB___setFrame:cache->rect withFraction:cache->fraction notify:YES];
|
||||
} else {
|
||||
// Old state was collapsed, so we expand it.
|
||||
[self RB___finishExpand:cache->rect withFraction:cache->fraction];
|
||||
}
|
||||
} else {
|
||||
// New state is collapsed.
|
||||
if (dim>=1.0) {
|
||||
// Old state was not collapsed, so we clear first responder and change the frame.
|
||||
[self RB___clearResponder];
|
||||
[self RB___finishCollapse:cache->rect withFraction:dim/value];
|
||||
} else {
|
||||
// It was collapsed already, but the frame may have changed, so we set it.
|
||||
[self RB___setFrame:cache->rect withFraction:cache->fraction notify:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This internal method sets minimum and maximum values to the same value, saves the old values,
|
||||
// and returns the new value (which will be limited to the old values).
|
||||
- (float)RB___setMinAndMaxTo:(float)value savingMin:(float*)oldmin andMax:(float*)oldmax {
|
||||
*oldmin = [self minDimension];
|
||||
*oldmax = [self maxDimension];
|
||||
if (value<*oldmin) {
|
||||
value = *oldmin;
|
||||
}
|
||||
if (value>*oldmax) {
|
||||
value = *oldmax;
|
||||
}
|
||||
minDimension = maxDimension = value;
|
||||
return value;
|
||||
}
|
||||
|
||||
// This internal method tries to clear the first responder, if the current responder is a descendant of
|
||||
// the receiving subview. If so, it will set first responder to nil, redisplay the former responder and
|
||||
// return YES. Returns NO otherwise.
|
||||
- (BOOL)RB___clearResponder {
|
||||
NSWindow* window = [self window];
|
||||
if (window) {
|
||||
NSView* responder = (NSView*)[window firstResponder];
|
||||
if (responder&&[responder respondsToSelector:@selector(isDescendantOf:)]) {
|
||||
if ([responder isDescendantOf:self]) {
|
||||
if ([window makeFirstResponder:nil]) {
|
||||
[responder display];
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
// This internal method collapses a subview.
|
||||
// It returns the negative of the size of the subview before collapsing, or 0.0 if it wasn't collapsed.
|
||||
- (float)RB___collapse {
|
||||
float result = 0.0;
|
||||
if (![self isCollapsed]) {
|
||||
RBSplitView* sv = [self splitView];
|
||||
if (sv&&[self canCollapse]) {
|
||||
[self RB___clearResponder];
|
||||
NSRect frame = [self frame];
|
||||
BOOL ishor = [sv isHorizontal];
|
||||
result = DIM(frame.size);
|
||||
// For collapsed views, fraction will contain the fraction of the dimension previously occupied
|
||||
DIM(frame.size) = 0.0;
|
||||
[self RB___finishCollapse:frame withFraction:result/[sv RB___dimensionWithoutDividers]];
|
||||
}
|
||||
}
|
||||
return -result;
|
||||
}
|
||||
|
||||
// This internal method finishes the collapse of a subview, stopping the animation if
|
||||
// there is one, and calling the delegate method if there is one.
|
||||
- (void)RB___finishCollapse:(NSRect)rect withFraction:(double)value {
|
||||
RBSplitView* sv = [self splitView];
|
||||
BOOL finish = [self RB___stopAnimation];
|
||||
[self RB___setFrame:rect withFraction:value notify:YES];
|
||||
[sv RB___setMustClearFractions];
|
||||
if (finish) {
|
||||
[self display];
|
||||
}
|
||||
id delegate = [sv delegate];
|
||||
if ([delegate respondsToSelector:@selector(splitView:didCollapse:)]) {
|
||||
[delegate splitView:sv didCollapse:self];
|
||||
}
|
||||
}
|
||||
|
||||
// This internal method expands a subview. setToMinimum will usually be YES during a divider drag.
|
||||
// It returns the size of the subview after expanding, or 0.0 if it wasn't expanded.
|
||||
- (float)RB___expandAndSetToMinimum:(BOOL)setToMinimum {
|
||||
float result = 0.0;
|
||||
RBSplitView* sv = [self splitView];
|
||||
if (sv&&[self isCollapsed]) {
|
||||
NSRect frame = [super frame];
|
||||
double frac = fraction;
|
||||
BOOL ishor = [sv isHorizontal];
|
||||
if (setToMinimum) {
|
||||
result = DIM(frame.size) = minDimension;
|
||||
} else {
|
||||
result = [sv RB___dimensionWithoutDividers]*frac;
|
||||
// We need to apply a compensation factor for proportional resizing in adjustSubviews.
|
||||
float newdim = floorf((frac>=1.0)?result:result/(1.0-frac));
|
||||
DIM(frame.size) = newdim;
|
||||
result = floorf(result);
|
||||
}
|
||||
[self RB___finishExpand:frame withFraction:0.0];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// This internal method finishes the the expansion of a subview, stopping the animation if
|
||||
// there is one, and calling the delegate method if there is one.
|
||||
- (void)RB___finishExpand:(NSRect)rect withFraction:(double)value {
|
||||
RBSplitView* sv = [self splitView];
|
||||
BOOL finish = [self RB___stopAnimation];
|
||||
[self RB___setFrame:rect withFraction:value notify:YES];
|
||||
[sv RB___setMustClearFractions];
|
||||
if (finish) {
|
||||
[self display];
|
||||
}
|
||||
id delegate = [sv delegate];
|
||||
if ([delegate respondsToSelector:@selector(splitView:didExpand:)]) {
|
||||
[delegate splitView:sv didExpand:self];
|
||||
}
|
||||
}
|
||||
|
||||
// These internal methods set the subview's frame or size, and also store a fraction value
|
||||
// which is used to ensure repeatability when the whole split view is resized.
|
||||
- (void)RB___setFrame:(NSRect)rect withFraction:(double)value notify:(BOOL)notify {
|
||||
RBSplitView* sv = [self splitView];
|
||||
id delegate = nil;
|
||||
if (notify) {
|
||||
delegate = [sv delegate];
|
||||
// If the delegate method isn't implemented, we ignore the delegate altogether.
|
||||
if ([delegate respondsToSelector:@selector(splitView:changedFrameOfSubview:from:to:)]) {
|
||||
// If the rects are equal, the delegate isn't called.
|
||||
if (NSEqualRects(previous,rect)) {
|
||||
delegate = nil;
|
||||
}
|
||||
} else {
|
||||
delegate = nil;
|
||||
}
|
||||
}
|
||||
[sv setMustAdjust];
|
||||
[self setFrame:rect];
|
||||
fraction = value;
|
||||
[delegate splitView:sv changedFrameOfSubview:self from:previous to:rect];
|
||||
previous = delegate?rect:NSZeroRect;
|
||||
}
|
||||
|
||||
- (void)RB___setFrameSize:(NSSize)size withFraction:(double)value {
|
||||
[[self splitView] setMustAdjust];
|
||||
[self setFrameSize:size];
|
||||
fraction = value;
|
||||
}
|
||||
|
||||
// This internal method gets the fraction value.
|
||||
- (double)RB___fraction {
|
||||
return fraction;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif // MM_ENABLE_PLUGINS
|
||||
@@ -1,225 +0,0 @@
|
||||
//
|
||||
// RBSplitView.h version 1.1.4
|
||||
// RBSplitView
|
||||
//
|
||||
// Created by Rainer Brockerhoff on 24/09/2004.
|
||||
// Copyright 2004-2006 Rainer Brockerhoff.
|
||||
// Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License.
|
||||
//
|
||||
|
||||
#import "RBSplitSubview.h"
|
||||
|
||||
// These values are used to handle the various cursor types.
|
||||
typedef enum {
|
||||
RBSVHorizontalCursor=0, // appears over horizontal dividers
|
||||
RBSVVerticalCursor, // appears over vertical dividers
|
||||
RBSV2WayCursor, // appears over two-way thumbs
|
||||
RBSVDragCursor, // appears while dragging
|
||||
RBSVCursorTypeCount
|
||||
} RBSVCursorType;
|
||||
|
||||
@interface RBSplitView : RBSplitSubview {
|
||||
// Subclasses normally should use setter methods instead of changing instance variables by assignment.
|
||||
// Most getter methods simply return the corresponding instance variable, so with some care, subclasses
|
||||
// could reference them directly.
|
||||
IBOutlet id delegate; // The delegate (may be nil).
|
||||
NSString* autosaveName; // This name is used for storing subview proportions in user defaults.
|
||||
NSColor* background; // The color used to paint the view's background (may be nil).
|
||||
NSImage* divider; // The image used for the divider "dimple".
|
||||
NSRect* dividers; // A C array of NSRects, one for each divider.
|
||||
float dividerThickness; // Actual divider width; should be an integer and at least 1.0.
|
||||
BOOL mustAdjust; // Set internally if the subviews need to be adjusted.
|
||||
BOOL mustClearFractions; // Set internally if fractions should be cleared before adjusting.
|
||||
BOOL isHorizontal; // The divider's orientation; default is vertical.
|
||||
BOOL canSaveState; // Set internally to allow saving subview state.
|
||||
BOOL isCoupled; // If YES, take some parameters from the containing RBSplitView, if any.
|
||||
BOOL isAdjusting; // Set internally while the subviews are being adjusted.
|
||||
BOOL isDragging; // Set internally while in a drag loop.
|
||||
BOOL isInScrollView; // Set internally if directly contained in an NSScrollView.
|
||||
}
|
||||
|
||||
// These class methods get and set the cursor used for each type.
|
||||
// Pass in nil to reset to the default cursor for that type.
|
||||
+ (NSCursor*)cursor:(RBSVCursorType)type;
|
||||
+ (void)setCursor:(RBSVCursorType)type toCursor:(NSCursor*)cursor;
|
||||
|
||||
// This class method clears the saved state for a given autosave name from the defaults.
|
||||
+ (void)removeStateUsingName:(NSString*)name;
|
||||
|
||||
// This class method returns the actual key used to store autosave data in the defaults.
|
||||
+ (NSString*)defaultsKeyForName:(NSString*)name isHorizontal:(BOOL)orientation;
|
||||
|
||||
// Sets and gets the autosaveName; this will be the key used to store the subviews' proportions
|
||||
// in the user defaults. Default is @"", which doesn't save anything. Set flag to YES to set
|
||||
// unique names for nested subviews. You are responsible for avoiding duplicates.
|
||||
- (void)setAutosaveName:(NSString*)aString recursively:(BOOL)flag;
|
||||
- (NSString*)autosaveName;
|
||||
|
||||
// Saves the current state of the subviews if there's a valid autosave name set. If the argument
|
||||
// is YES, it's then also called recursively for nested RBSplitViews. Returns YES if successful.
|
||||
- (BOOL)saveState:(BOOL)recurse;
|
||||
|
||||
// Restores the saved state of the subviews if there's a valid autosave name set. If the argument
|
||||
// is YES, it's first called recursively for nested RBSplitViews. Returns YES if successful.
|
||||
// You need to call adjustSubviews after calling this.
|
||||
- (BOOL)restoreState:(BOOL)recurse;
|
||||
|
||||
// Returns a string encoding the current state of all direct subviews. Does not check for nesting.
|
||||
- (NSString*)stringWithSavedState;
|
||||
|
||||
// Readjusts all direct subviews according to the encoded string parameter. The number of subviews
|
||||
// must match. Returns YES if successful. Does not check for nesting.
|
||||
- (BOOL)setStateFromString:(NSString*)aString;
|
||||
|
||||
// Returns an array with complete state information for the receiver and all subviews, taking
|
||||
// nesting into account. Don't store this array in a file, as its format might change in the
|
||||
// future; this is for taking a state snapshot and later restoring it with setStatesFromArray.
|
||||
- (NSArray*)arrayWithStates;
|
||||
|
||||
// Restores the state of the receiver and all subviews. The array must have been produced by a
|
||||
// previous call to arrayWithStates. Returns YES if successful. This will fail if you have
|
||||
// added or removed subviews in the meantime!
|
||||
// You need to call adjustSubviews after calling this.
|
||||
- (BOOL)setStatesFromArray:(NSArray*)array;
|
||||
|
||||
// This is the designated initializer for creating RBSplitViews programmatically.
|
||||
- (id)initWithFrame:(NSRect)frame;
|
||||
|
||||
// This convenience initializer adds any number of subviews and adjusts them proportionally.
|
||||
- (id)initWithFrame:(NSRect)frame andSubviews:(unsigned)count;
|
||||
|
||||
// Sets and gets the delegate. (Delegates aren't retained.) See further down for delegate methods.
|
||||
- (void)setDelegate:(id)anObject;
|
||||
- (id)delegate;
|
||||
|
||||
// Returns a subview which has a certain identifier string, or nil if there's none
|
||||
- (RBSplitSubview*)subviewWithIdentifier:(NSString*)anIdentifier;
|
||||
|
||||
// Returns the subview at a certain position. Returns nil if the position is invalid.
|
||||
- (RBSplitSubview*)subviewAtPosition:(unsigned)position;
|
||||
|
||||
// Adds a subview at a certain position.
|
||||
- (void)addSubview:(NSView*)aView atPosition:(unsigned)position;
|
||||
|
||||
// Sets and gets the divider thickness, which should be a positive integer or zero.
|
||||
// Setting the divider image also resets this automatically, so you would call this
|
||||
// only if you want the divider to be larger or smaller than the image. Zero means that
|
||||
// the image dimensions will be used.
|
||||
- (void)setDividerThickness:(float)thickness;
|
||||
- (float)dividerThickness;
|
||||
|
||||
// Sets and gets the divider image. The default image can also be set in Interface Builder, so usually
|
||||
// there's no need to call this. Passing in nil means that the default divider thickness will be zero,
|
||||
// and no mouse events will be processed, so that the dividers can be moved only programmatically.
|
||||
- (void)setDivider:(NSImage*)image;
|
||||
- (NSImage*)divider;
|
||||
|
||||
// Sets and gets the view background. The default is nil, meaning no background is
|
||||
// drawn and the view and its subviews are considered transparent.
|
||||
- (void)setBackground:(NSColor*)color;
|
||||
- (NSColor*)background;
|
||||
|
||||
// Sets and gets the orientation. This uses the same convention as NSSplitView: vertical means the
|
||||
// dividers are vertical, but the subviews are in a horizontal row. Sort of counter-intuitive, yes.
|
||||
- (void)setVertical:(BOOL)flag;
|
||||
- (BOOL)isVertical;
|
||||
- (BOOL)isHorizontal;
|
||||
|
||||
// Call this to force adjusting the subviews before display. Called automatically if anything
|
||||
// relevant is changed.
|
||||
- (void)setMustAdjust;
|
||||
|
||||
// Returns YES if there's a pending adjustment.
|
||||
- (BOOL)mustAdjust;
|
||||
|
||||
// Returns YES if we're in a dragging loop.
|
||||
- (BOOL)isDragging;
|
||||
|
||||
// Returns YES if the view is directly contained in an NSScrollView.
|
||||
- (BOOL)isInScrollView;
|
||||
|
||||
// Call this to recalculate all subview dimensions. Normally this is done automatically whenever
|
||||
// something relevant is changed, so you rarely will need to call this explicitly.
|
||||
- (void)adjustSubviews;
|
||||
|
||||
// This method should be called only from within the splitView:wasResizedFrom:to: delegate method
|
||||
// to keep some specific subview the same size.
|
||||
- (void)adjustSubviewsExcepting:(RBSplitSubview*)excepting;
|
||||
|
||||
// This method draws dividers. You should never call it directly but you can override it when
|
||||
// subclassing, if you need custom dividers.
|
||||
- (void)drawDivider:(NSImage*)anImage inRect:(NSRect)rect betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing;
|
||||
|
||||
@end
|
||||
|
||||
// The following methods are optionally implemented by the delegate.
|
||||
|
||||
@interface NSObject(RBSplitViewDelegate)
|
||||
|
||||
// The delegate can override a subview's ability to collapse by implementing this method.
|
||||
// Return YES to allow collapsing. If this is implemented, the subviews' built-in
|
||||
// 'collapsed' flags are ignored.
|
||||
- (BOOL)splitView:(RBSplitView*)sender canCollapse:(RBSplitSubview*)subview;
|
||||
|
||||
// The delegate can alter the divider's appearance by implementing this method.
|
||||
// Before calling this, the divider is filled with the background, and afterwards
|
||||
// the divider image is drawn into the returned rect. If imageRect is empty, no
|
||||
// divider image will be drawn, because there are nested RBSplitViews. Return
|
||||
// NSZeroRect to suppress the divider image. Return imageRect to use the default
|
||||
// location for the image, or change its origin to place the image elsewhere.
|
||||
// You could also draw the divider yourself at this point and return NSZeroRect.
|
||||
- (NSRect)splitView:(RBSplitView*)sender willDrawDividerInRect:(NSRect)dividerRect betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing withProposedRect:(NSRect)imageRect;
|
||||
|
||||
// These methods are called after a subview is completely collapsed or expanded. adjustSubviews may or may not
|
||||
// have been called, however.
|
||||
- (void)splitView:(RBSplitView*)sender didCollapse:(RBSplitSubview*)subview;
|
||||
- (void)splitView:(RBSplitView*)sender didExpand:(RBSplitSubview*)subview;
|
||||
|
||||
// These methods are called just before and after adjusting subviews.
|
||||
- (void)willAdjustSubviews:(RBSplitView*)sender;
|
||||
- (void)didAdjustSubviews:(RBSplitView*)sender;
|
||||
|
||||
// This method will be called after a RBSplitView is resized with setFrameSize: but before
|
||||
// adjustSubviews is called on it.
|
||||
- (void)splitView:(RBSplitView*)sender wasResizedFrom:(float)oldDimension to:(float)newDimension;
|
||||
|
||||
// This method will be called when a divider is double-clicked and both leading and trailing
|
||||
// subviews can be collapsed. Return either of the parameters to collapse that subview, or nil
|
||||
// to collapse neither. If not implemented, the smaller subview will be collapsed.
|
||||
- (RBSplitSubview*)splitView:(RBSplitView*)sender collapseLeading:(RBSplitSubview*)leading orTrailing:(RBSplitSubview*)trailing;
|
||||
|
||||
// This method will be called when a cursor rect is being set (inside resetCursorRects). The
|
||||
// proposed rect is passed in. Return the actual rect, or NSZeroRect to suppress cursor setting
|
||||
// for this divider. This won't be called for two-axis thumbs, however. The rects are in
|
||||
// sender's local coordinates.
|
||||
- (NSRect)splitView:(RBSplitView*)sender cursorRect:(NSRect)rect forDivider:(unsigned int)divider;
|
||||
|
||||
// This method will be called whenever a mouse-down event is received in a divider. Return YES to have
|
||||
// the event handled by the split view, NO if you wish to ignore it or handle it in the delegate.
|
||||
- (BOOL)splitView:(RBSplitView*)sender shouldHandleEvent:(NSEvent*)theEvent inDivider:(unsigned int)divider betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing;
|
||||
|
||||
// This method will be called just before a subview will be collapsed or expanded with animation.
|
||||
// Return the approximate time the animation should take, or 0.0 to disallow animation.
|
||||
// If not implemented, it will use the default of 0.2 seconds per 150 pixels.
|
||||
- (NSTimeInterval)splitView:(RBSplitView*)sender willAnimateSubview:(RBSplitSubview*)subview withDimension:(float)dimension;
|
||||
|
||||
// This method will be called whenever a subview's frame is changed, usually from inside adjustSubviews' final loop.
|
||||
// You'd normally use this to move some auxiliary view to keep it aligned with the subview.
|
||||
- (void)splitView:(RBSplitView*)sender changedFrameOfSubview:(RBSplitSubview*)subview from:(NSRect)fromRect to:(NSRect)toRect;
|
||||
|
||||
// This method is called whenever the event handlers want to check if some point within the RBSplitSubview
|
||||
// should act as an alternate drag view. Usually, the delegate will check the point (which is in sender's
|
||||
// local coordinates) against the frame of one or several auxiliary views, and return a valid divider number.
|
||||
// Returning NSNotFound means the point is not valid.
|
||||
- (unsigned int)splitView:(RBSplitView*)sender dividerForPoint:(NSPoint)point inSubview:(RBSplitSubview*)subview;
|
||||
|
||||
// This method is called continuously while a divider is dragged, just before the leading subview is resized.
|
||||
// Return NO to resize the trailing view by the same amount, YES to resize the containing window by the same amount.
|
||||
- (BOOL)splitView:(RBSplitView*)sender shouldResizeWindowForDivider:(unsigned int)divider betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing willGrow:(BOOL)grow;
|
||||
|
||||
// This method is called by each subview's drawRect: method, just after filling it with the background color but
|
||||
// before the contained subviews are drawn. Usually you would use this to draw a frame inside the subview.
|
||||
- (void)splitView:(RBSplitView*)sender willDrawSubview:(RBSplitSubview*)subview inRect:(NSRect)rect;
|
||||
|
||||
@end
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,98 +0,0 @@
|
||||
//
|
||||
// RBSplitViewPrivateDefines.h version 1.1.4
|
||||
// RBSplitView
|
||||
//
|
||||
// Created by Rainer Brockerhoff on 19/11/2004.
|
||||
// Copyright 2004-2006 Rainer Brockerhoff.
|
||||
// Some Rights Reserved under the Creative Commons Attribution License, version 2.5, and/or the MIT License.
|
||||
//
|
||||
|
||||
// These defines are used only locally; no sense exporting them in the main header file where they might
|
||||
// conflict with something...
|
||||
|
||||
// This is the hysteresis value for collapsing/expanding subviews with the mouse. 0.05 (5%) works well.
|
||||
#define HYSTERESIS (0.05)
|
||||
|
||||
// This selects the main horizontal or vertical coordinate according to the split view's orientation.
|
||||
// It can be used as an lvalue, too. You need to have BOOL ishor declared to use it.
|
||||
#define DIM(x) (((float*)&(x))[ishor])
|
||||
|
||||
// This selects the other coordinate.
|
||||
#define OTHER(x) (((float*)&(x))[!ishor])
|
||||
|
||||
// This value for the view offsets is guaranteed to be out of view for quite some time and is used
|
||||
// to mark the view as collapsed.
|
||||
#define WAYOUT (1000000.0)
|
||||
|
||||
// This is the default framerate for collapse/expand animation.
|
||||
#define FRAMETIME (1.0/60.0)
|
||||
|
||||
// This struct is used internally for speeding up adjustSubviews.
|
||||
typedef struct subviewCache {
|
||||
NSRect rect; // the subview's frame
|
||||
double fraction; // fractional extra
|
||||
RBSplitSubview* sub; // points at the subview
|
||||
float size; // current dimension (integer)
|
||||
BOOL constrain; // set if constrained
|
||||
} subviewCache;
|
||||
|
||||
// This struct is used internally for doing collapse/expand animation.
|
||||
typedef struct animationData {
|
||||
RBSplitSubview* owner; // the subview being animated
|
||||
float dimension; // the subview's starting or ending dimension
|
||||
int stepsDone; // counts already done animation steps
|
||||
NSTimeInterval elapsedTime; // time already spent in resizing and adjusting subviews
|
||||
NSTimeInterval finishTime; // the animation should be finished at this time
|
||||
NSTimeInterval totalTime; // total time the animation should take
|
||||
BOOL collapsing; // YES if we're collapsing, NO if we're expanding
|
||||
BOOL resizing; // YES if we're resizing, NO if we're frozen
|
||||
} animationData;
|
||||
|
||||
// The following methods are for internal use, and you should never call or override them.
|
||||
// They'll probably vary wildy from version to version, too.
|
||||
|
||||
@interface RBSplitSubview (RB___SubviewAdditions)
|
||||
|
||||
- (void)RB___setHidden:(BOOL)flag;
|
||||
- (animationData*)RB___animationData:(BOOL)start resize:(BOOL)resize;
|
||||
- (void)RB___stepAnimation;
|
||||
- (BOOL)RB___stopAnimation;
|
||||
- (float)RB___visibleDimension;
|
||||
- (float)RB___setMinAndMaxTo:(float)value savingMin:(float*)oldmin andMax:(float*)oldmax;
|
||||
- (float)RB___collapse;
|
||||
- (float)RB___expandAndSetToMinimum:(BOOL)setToMinimum;
|
||||
- (void)RB___finishCollapse:(NSRect)rect withFraction:(double)value;
|
||||
- (void)RB___finishExpand:(NSRect)rect withFraction:(double)value;
|
||||
- (void)RB___setFrameSize:(NSSize)size withFraction:(double)value;
|
||||
- (void)RB___setFrame:(NSRect)rect withFraction:(double)value notify:(BOOL)notify;
|
||||
- (double)RB___fraction;
|
||||
- (void)RB___copyIntoCache:(subviewCache*)cache;
|
||||
- (void)RB___updateFromCache:(subviewCache*)cache withTotalDimension:(float)value;
|
||||
- (BOOL)RB___clearResponder;
|
||||
|
||||
@end
|
||||
|
||||
@interface RBSplitView (RB___ViewAdditions)
|
||||
|
||||
- (void)RB___adjustOutermostIfNeeded;
|
||||
- (void)RB___setDragging:(BOOL)flag;
|
||||
- (float)RB___dividerOrigin:(int)indx;
|
||||
- (NSArray*)RB___subviews;
|
||||
- (unsigned int)RB___numberOfSubviews;
|
||||
- (void)RB___adjustSubviewsExcepting:(RBSplitSubview*)excepting;
|
||||
- (float)RB___dimensionWithoutDividers;
|
||||
- (float)RB___dividerThickness;
|
||||
- (NSRect)RB___dividerRect:(unsigned)indx relativeToView:(RBSplitView*)view;
|
||||
- (void)RB___setMustClearFractions;
|
||||
- (BOOL)RB___shouldResizeWindowForDivider:(unsigned int)indx betweenView:(RBSplitSubview*)leading andView:(RBSplitSubview*)trailing willGrow:(BOOL)grow;
|
||||
- (void)RB___tryToExpandLeading:(RBSplitSubview*)leading divider:(unsigned int)indx trailing:(RBSplitSubview*)trailing delta:(float)delta;
|
||||
- (void)RB___tryToShortenLeading:(RBSplitSubview*)leading divider:(unsigned int)indx trailing:(RBSplitSubview*)trailing delta:(float)delta always:(BOOL)always;
|
||||
- (void)RB___tryToExpandTrailing:(RBSplitSubview*)trailing leading:(RBSplitSubview*)leading delta:(float)delta;
|
||||
- (void)RB___tryToShortenTrailing:(RBSplitSubview*)trailing divider:(unsigned int)indx leading:(RBSplitSubview*)leading delta:(float)delta always:(BOOL)always;
|
||||
- (void)RB___trackMouseEvent:(NSEvent*)theEvent from:(NSPoint)where withBase:(NSPoint)base inDivider:(unsigned)indx;
|
||||
- (void)RB___addCursorRectsTo:(RBSplitView*)masterView forDividerRect:(NSRect)rect thickness:(float)delta;
|
||||
- (unsigned)RB___dividerHitBy:(NSPoint)point relativeToView:(RBSplitView*)view thickness:(float)delta;
|
||||
- (void)RB___drawDividersIn:(RBSplitView*)masterView forDividerRect:(NSRect)rect thickness:(float)delta;
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,288 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 42;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
17085DDA0939627C000D0081 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17085DD90939627C000D0081 /* Carbon.framework */; };
|
||||
174E80980A57DFA5003FB108 /* url map.plist in Resources */ = {isa = PBXBuildFile; fileRef = 174E80970A57DFA5003FB108 /* url map.plist */; };
|
||||
1796636A093A122C00138851 /* Edit in ODBEditor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 17966367093A122C00138851 /* Edit in ODBEditor.mm */; };
|
||||
1796636B093A122C00138851 /* NSTextView: Edit in ODBEditor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 17966368093A122C00138851 /* NSTextView: Edit in ODBEditor.mm */; };
|
||||
1796636C093A122C00138851 /* WebView: Edit in ODBEditor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 17966369093A122C00138851 /* WebView: Edit in ODBEditor.mm */; };
|
||||
8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; };
|
||||
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
|
||||
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
17085DD90939627C000D0081 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
|
||||
174E80970A57DFA5003FB108 /* url map.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = "url map.plist"; sourceTree = "<group>"; };
|
||||
17966367093A122C00138851 /* Edit in ODBEditor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "Edit in ODBEditor.mm"; path = "src/Edit in ODBEditor.mm"; sourceTree = "<group>"; };
|
||||
17966368093A122C00138851 /* NSTextView: Edit in ODBEditor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "NSTextView: Edit in ODBEditor.mm"; path = "src/NSTextView: Edit in ODBEditor.mm"; sourceTree = "<group>"; };
|
||||
17966369093A122C00138851 /* WebView: Edit in ODBEditor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "WebView: Edit in ODBEditor.mm"; path = "src/WebView: Edit in ODBEditor.mm"; sourceTree = "<group>"; };
|
||||
32DBCF630370AF2F00C91783 /* Edit in ODBEditor_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Edit in ODBEditor_Prefix.pch"; sourceTree = "<group>"; };
|
||||
8D5B49B6048680CD000E48DA /* Edit in ODBEditor.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Edit in ODBEditor.bundle"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
D2F7E65807B2D6F200F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8D5B49B3048680CD000E48DA /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */,
|
||||
17085DDA0939627C000D0081 /* Carbon.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
089C166AFE841209C02AAC07 /* Edit in TextMate */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
08FB77AFFE84173DC02AAC07 /* Classes */,
|
||||
32C88E010371C26100C91783 /* Other Sources */,
|
||||
089C167CFE841241C02AAC07 /* Resources */,
|
||||
089C1671FE841209C02AAC07 /* Frameworks and Libraries */,
|
||||
19C28FB8FE9D52D311CA2CBB /* Products */,
|
||||
);
|
||||
name = "Edit in TextMate";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
17085DD90939627C000D0081 /* Carbon.framework */,
|
||||
1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */,
|
||||
1058C7AEFEA557BF11CA2CBB /* Other Frameworks */,
|
||||
);
|
||||
name = "Frameworks and Libraries";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
089C167CFE841241C02AAC07 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
174E80970A57DFA5003FB108 /* url map.plist */,
|
||||
8D5B49B7048680CD000E48DA /* Info.plist */,
|
||||
089C167DFE841241C02AAC07 /* InfoPlist.strings */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
08FB77AFFE84173DC02AAC07 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
17966367093A122C00138851 /* Edit in ODBEditor.mm */,
|
||||
17966368093A122C00138851 /* NSTextView: Edit in ODBEditor.mm */,
|
||||
17966369093A122C00138851 /* WebView: Edit in ODBEditor.mm */,
|
||||
);
|
||||
name = Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */,
|
||||
);
|
||||
name = "Linked Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7AEFEA557BF11CA2CBB /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
089C167FFE841241C02AAC07 /* AppKit.framework */,
|
||||
D2F7E65807B2D6F200F64583 /* CoreData.framework */,
|
||||
089C1672FE841209C02AAC07 /* Foundation.framework */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
19C28FB8FE9D52D311CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8D5B49B6048680CD000E48DA /* Edit in ODBEditor.bundle */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
32C88E010371C26100C91783 /* Other Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
32DBCF630370AF2F00C91783 /* Edit in ODBEditor_Prefix.pch */,
|
||||
);
|
||||
name = "Other Sources";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8D5B49AC048680CD000E48DA /* Edit in ODBEditor */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1DEB913A08733D840010E9CD /* Build configuration list for PBXNativeTarget "Edit in ODBEditor" */;
|
||||
buildPhases = (
|
||||
8D5B49AF048680CD000E48DA /* Resources */,
|
||||
8D5B49B1048680CD000E48DA /* Sources */,
|
||||
8D5B49B3048680CD000E48DA /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "Edit in ODBEditor";
|
||||
productInstallPath = "$(HOME)/Library/Bundles";
|
||||
productName = "Edit in TextMate";
|
||||
productReference = 8D5B49B6048680CD000E48DA /* Edit in ODBEditor.bundle */;
|
||||
productType = "com.apple.product-type.bundle";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
089C1669FE841209C02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "Edit in ODBEditor" */;
|
||||
compatibilityVersion = "Xcode 2.4";
|
||||
hasScannedForEncodings = 1;
|
||||
mainGroup = 089C166AFE841209C02AAC07 /* Edit in TextMate */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
8D5B49AC048680CD000E48DA /* Edit in ODBEditor */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8D5B49AF048680CD000E48DA /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */,
|
||||
174E80980A57DFA5003FB108 /* url map.plist in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8D5B49B1048680CD000E48DA /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1796636A093A122C00138851 /* Edit in ODBEditor.mm in Sources */,
|
||||
1796636B093A122C00138851 /* NSTextView: Edit in ODBEditor.mm in Sources */,
|
||||
1796636C093A122C00138851 /* WebView: Edit in ODBEditor.mm in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
089C167DFE841241C02AAC07 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
089C167EFE841241C02AAC07 /* English */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1DEB913B08733D840010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "Edit in ODBEditor_Prefix.pch";
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "";
|
||||
OTHER_LDFLAGS = (
|
||||
"-undefined",
|
||||
dynamic_lookup,
|
||||
);
|
||||
PRODUCT_NAME = "Edit in ODBEditor";
|
||||
SYMROOT = ../build;
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
ZERO_LINK = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB913C08733D840010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "Edit in ODBEditor_Prefix.pch";
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "";
|
||||
OTHER_LDFLAGS = (
|
||||
"-undefined",
|
||||
dynamic_lookup,
|
||||
);
|
||||
PRODUCT_NAME = "Edit in ODBEditor";
|
||||
SYMROOT = ../build;
|
||||
WRAPPER_EXTENSION = bundle;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
1DEB913F08733D840010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = NO;
|
||||
GCC_ENABLE_CPP_RTTI = NO;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB914008733D840010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = NO;
|
||||
GCC_ENABLE_CPP_RTTI = NO;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1DEB913A08733D840010E9CD /* Build configuration list for PBXNativeTarget "Edit in ODBEditor" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB913B08733D840010E9CD /* Debug */,
|
||||
1DEB913C08733D840010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "Edit in ODBEditor" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB913F08733D840010E9CD /* Debug */,
|
||||
1DEB914008733D840010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 089C1669FE841209C02AAC07 /* Project object */;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'Edit in ODBEditor' target in the 'Edit in ODBEditor' project.
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
Binary file not shown.
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BundleName</key>
|
||||
<string>Edit in ODBEditor.bundle</string>
|
||||
<key>LoadBundleOnLaunch</key>
|
||||
<string>YES</string>
|
||||
<key>LocalizedNames</key>
|
||||
<dict>
|
||||
<key>English</key>
|
||||
<string>Edit in ODBEditor</string>
|
||||
</dict>
|
||||
<key>NoMenuEntry</key>
|
||||
<string>YES</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.slashpunt.edit_in_odbeditor</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.2</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>EditInODBEditor</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,2 +0,0 @@
|
||||
all:
|
||||
xcodebuild
|
||||
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// Edit in ODBEditor.h
|
||||
//
|
||||
// Created by Allan Odgaard on 2005-11-26.
|
||||
// See LICENSE for license details
|
||||
//
|
||||
// Generalized by Chris Eidhof and Eelco Lempsink from 'Edit in TextMate.h'
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface EditInODBEditor : NSObject
|
||||
{
|
||||
}
|
||||
+ (void)externalEditString:(NSString*)aString startingAtLine:(int)aLine forView:(NSView*)aView;
|
||||
+ (void)externalEditString:(NSString*)aString startingAtLine:(int)aLine forView:(NSView*)aView withObject:(NSObject*)anObject;
|
||||
@end
|
||||
@@ -1,291 +0,0 @@
|
||||
//
|
||||
// Edit in ODBEditor.mm
|
||||
//
|
||||
// Created by Allan Odgaard on 2005-11-26.
|
||||
// See LICENSE for license details
|
||||
//
|
||||
// Generalized by Chris Eidhof and Eelco Lempsink from 'Edit in TextMate.mm'
|
||||
|
||||
#import <WebKit/WebKit.h>
|
||||
#import <Carbon/Carbon.h>
|
||||
#import <map>
|
||||
#import "Edit in ODBEditor.h"
|
||||
|
||||
// from ODBEditorSuite.h
|
||||
#define keyFileSender 'FSnd'
|
||||
#define kODBEditorSuite 'R*ch'
|
||||
#define kAEModifiedFile 'FMod'
|
||||
#define kAEClosedFile 'FCls'
|
||||
|
||||
static NSMutableDictionary* OpenFiles;
|
||||
static NSMutableSet* FailedFiles;
|
||||
static NSString* ODBEditorBundleIdentifier;
|
||||
static NSString* ODBEditorName;
|
||||
|
||||
#pragma options align=mac68k
|
||||
struct PBX_SelectionRange
|
||||
{
|
||||
short unused1; // 0 (not used)
|
||||
short lineNum; // line to select (<0 to specify range)
|
||||
long startRange; // start of selection range (if line < 0)
|
||||
long endRange; // end of selection range (if line < 0)
|
||||
long unused2; // 0 (not used)
|
||||
long theDate; // modification date/time
|
||||
};
|
||||
#pragma options align=reset
|
||||
|
||||
@implementation EditInODBEditor
|
||||
+ (void)setODBEventHandlers
|
||||
{
|
||||
NSAppleEventManager* eventManager = [NSAppleEventManager sharedAppleEventManager];
|
||||
[eventManager setEventHandler:self andSelector:@selector(handleModifiedFileEvent:withReplyEvent:) forEventClass:kODBEditorSuite andEventID:kAEModifiedFile];
|
||||
[eventManager setEventHandler:self andSelector:@selector(handleClosedFileEvent:withReplyEvent:) forEventClass:kODBEditorSuite andEventID:kAEClosedFile];
|
||||
}
|
||||
|
||||
+ (void)removeODBEventHandlers
|
||||
{
|
||||
NSAppleEventManager* eventManager = [NSAppleEventManager sharedAppleEventManager];
|
||||
[eventManager removeEventHandlerForEventClass:kODBEditorSuite andEventID:kAEModifiedFile];
|
||||
[eventManager removeEventHandlerForEventClass:kODBEditorSuite andEventID:kAEClosedFile];
|
||||
}
|
||||
|
||||
+ (BOOL)launchODBEditor
|
||||
{
|
||||
NSArray* array = [[NSWorkspace sharedWorkspace] launchedApplications];
|
||||
for(unsigned i = [array count]; --i; )
|
||||
{
|
||||
if([[[array objectAtIndex:i] objectForKey:@"NSApplicationBundleIdentifier"] isEqualToString:ODBEditorBundleIdentifier])
|
||||
return YES;
|
||||
}
|
||||
return [[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:ODBEditorBundleIdentifier options:0L additionalEventParamDescriptor:nil launchIdentifier:nil];
|
||||
}
|
||||
|
||||
+ (void)asyncEditStringWithOptions:(NSDictionary*)someOptions
|
||||
{
|
||||
NSAutoreleasePool* pool = [NSAutoreleasePool new];
|
||||
|
||||
if(![self launchODBEditor])
|
||||
return;
|
||||
|
||||
/* =========== */
|
||||
|
||||
NSData* targetBundleID = [ODBEditorBundleIdentifier dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSAppleEventDescriptor* targetDescriptor = [NSAppleEventDescriptor descriptorWithDescriptorType:typeApplicationBundleID data:targetBundleID];
|
||||
NSAppleEventDescriptor* appleEvent = [NSAppleEventDescriptor appleEventWithEventClass:kCoreEventClass eventID:kAEOpenDocuments targetDescriptor:targetDescriptor returnID:kAutoGenerateReturnID transactionID:kAnyTransactionID];
|
||||
NSAppleEventDescriptor* replyDescriptor = nil;
|
||||
NSAppleEventDescriptor* errorDescriptor = nil;
|
||||
AEDesc reply = { typeNull, NULL };
|
||||
|
||||
NSString* fileName = [someOptions objectForKey:@"fileName"];
|
||||
[appleEvent setParamDescriptor:[NSAppleEventDescriptor descriptorWithDescriptorType:typeFileURL data:[[[NSURL fileURLWithPath:fileName] absoluteString] dataUsingEncoding:NSUTF8StringEncoding]] forKeyword:keyDirectObject];
|
||||
|
||||
UInt32 packageType = 0, packageCreator = 0;
|
||||
CFBundleGetPackageInfo(CFBundleGetMainBundle(), &packageType, &packageCreator);
|
||||
[appleEvent setParamDescriptor:[NSAppleEventDescriptor descriptorWithTypeCode:packageCreator] forKeyword:keyFileSender];
|
||||
|
||||
if(int line = [[someOptions objectForKey:@"line"] intValue])
|
||||
{
|
||||
PBX_SelectionRange pos = { };
|
||||
pos.lineNum = line;
|
||||
[appleEvent setParamDescriptor:[NSAppleEventDescriptor descriptorWithDescriptorType:typeChar bytes:&pos length:sizeof(pos)] forKeyword:keyAEPosition];
|
||||
}
|
||||
|
||||
OSStatus status = AESend([appleEvent aeDesc], &reply, kAEWaitReply, kAENormalPriority, kAEDefaultTimeout, NULL, NULL);
|
||||
if(status == noErr)
|
||||
{
|
||||
replyDescriptor = [[[NSAppleEventDescriptor alloc] initWithAEDescNoCopy:&reply] autorelease];
|
||||
errorDescriptor = [replyDescriptor paramDescriptorForKeyword:keyErrorNumber];
|
||||
if(errorDescriptor != nil)
|
||||
status = [errorDescriptor int32Value];
|
||||
|
||||
if(status != noErr)
|
||||
NSLog(@"%s error %d", _cmd, status), NSBeep();
|
||||
}
|
||||
|
||||
[pool release];
|
||||
}
|
||||
|
||||
+ (NSString*)extensionForURL:(NSURL*)anURL
|
||||
{
|
||||
NSString* res = nil;
|
||||
if(NSString* urlString = [anURL absoluteString])
|
||||
{
|
||||
NSString* path = [[NSBundle bundleForClass:[self class]] pathForResource:@"url map" ofType:@"plist"];
|
||||
NSMutableDictionary* map = [NSMutableDictionary dictionaryWithContentsOfFile:path];
|
||||
|
||||
NSString* customBindingsPath = [[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"Preferences/org.slashpunt.edit_in_odbeditor.plist"];
|
||||
if(NSDictionary* associations = [[NSDictionary dictionaryWithContentsOfFile:customBindingsPath] objectForKey:@"URLAssociations"])
|
||||
[map addEntriesFromDictionary:associations];
|
||||
|
||||
unsigned longestMatch = 0;
|
||||
NSEnumerator* enumerator = [map keyEnumerator];
|
||||
while(NSString* key = [enumerator nextObject])
|
||||
{
|
||||
if([urlString rangeOfString:key].location != NSNotFound && [key length] > longestMatch)
|
||||
{
|
||||
res = [map objectForKey:key];
|
||||
longestMatch = [key length];
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
+ (void)externalEditString:(NSString*)aString startingAtLine:(int)aLine forView:(NSView*)aView
|
||||
{
|
||||
[self externalEditString:aString startingAtLine:aLine forView:aView withObject:nil];
|
||||
}
|
||||
|
||||
+ (void)externalEditString:(NSString*)aString startingAtLine:(int)aLine forView:(NSView*)aView withObject:(NSObject*)anObject
|
||||
{
|
||||
Class cl = NSClassFromString(@"WebFrameView");
|
||||
|
||||
NSURL* url = nil;
|
||||
for(NSView* view = aView; view && !url && cl; view = [view superview])
|
||||
{
|
||||
if([view isKindOfClass:cl])
|
||||
url = [[[[(WebFrameView*)view webFrame] dataSource] mainResource] URL];
|
||||
}
|
||||
|
||||
NSString* basename = [[[[aView window] title] componentsSeparatedByString:@"/"] componentsJoinedByString:@"-"] ?: @"untitled";
|
||||
NSString* extension = [self extensionForURL:url] ?: [[[[NSWorkspace sharedWorkspace] activeApplication] objectForKey:@"NSApplicationName"] lowercaseString];
|
||||
NSString* fileName = [NSString stringWithFormat:@"%@/%@.%@", NSTemporaryDirectory(), basename, extension];
|
||||
for(unsigned i = 2; [[NSFileManager defaultManager] fileExistsAtPath:fileName]; i++)
|
||||
fileName = [NSString stringWithFormat:@"%@/%@ %u.%@", NSTemporaryDirectory(), basename, i, extension];
|
||||
|
||||
[[aString dataUsingEncoding:NSUTF8StringEncoding] writeToFile:fileName atomically:NO];
|
||||
fileName = [fileName stringByStandardizingPath];
|
||||
|
||||
NSDictionary* options = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
aString, @"string",
|
||||
aView, @"view",
|
||||
fileName, @"fileName",
|
||||
[NSNumber numberWithInt:aLine], @"line",
|
||||
anObject, @"object", /* last since anObject might be nil */
|
||||
nil];
|
||||
|
||||
[OpenFiles setObject:options forKey:[fileName precomposedStringWithCanonicalMapping]];
|
||||
if([OpenFiles count] == 1)
|
||||
[self setODBEventHandlers];
|
||||
[NSThread detachNewThreadSelector:@selector(asyncEditStringWithOptions:) toTarget:self withObject:options];
|
||||
}
|
||||
|
||||
+ (void)handleModifiedFileEvent:(NSAppleEventDescriptor*)event withReplyEvent:(NSAppleEventDescriptor*)replyEvent
|
||||
{
|
||||
NSAppleEventDescriptor* fileURL = [[event paramDescriptorForKeyword:keyDirectObject] coerceToDescriptorType:typeFileURL];
|
||||
NSString* urlString = [[[NSString alloc] initWithData:[fileURL data] encoding:NSUTF8StringEncoding] autorelease];
|
||||
NSString* fileName = [[[NSURL URLWithString:urlString] path] stringByStandardizingPath];
|
||||
NSDictionary* options = [OpenFiles objectForKey:[fileName precomposedStringWithCanonicalMapping]];
|
||||
NSView* view = [options objectForKey:@"view"];
|
||||
|
||||
if([view window])
|
||||
{
|
||||
if ([view respondsToSelector:@selector(odbEditorDidModifyString:withObject:)])
|
||||
{
|
||||
NSString* newString = [[[NSString alloc] initWithData:[NSData dataWithContentsOfFile:fileName] encoding:NSUTF8StringEncoding] autorelease];
|
||||
NSObject* anObject = [options objectForKey:@"object"];
|
||||
[view performSelector:@selector(odbEditorDidModifyString:withObject:) withObject:newString withObject:anObject];
|
||||
[FailedFiles removeObject:fileName];
|
||||
fileName = nil;
|
||||
}
|
||||
else if([view respondsToSelector:@selector(odbEditorDidModifyString:)])
|
||||
{
|
||||
NSString* newString = [[[NSString alloc] initWithData:[NSData dataWithContentsOfFile:fileName] encoding:NSUTF8StringEncoding] autorelease];
|
||||
[view performSelector:@selector(odbEditorDidModifyString:) withObject:newString];
|
||||
[FailedFiles removeObject:fileName];
|
||||
fileName = nil;
|
||||
}
|
||||
}
|
||||
if (fileName)
|
||||
{
|
||||
[FailedFiles addObject:fileName];
|
||||
NSLog(@"%s view %p, %@, window %@", _cmd, view, view, [view window]);
|
||||
NSLog(@"%s file name %@, options %@", _cmd, fileName, [options description]);
|
||||
NSLog(@"%s all %@", _cmd, [OpenFiles description]);
|
||||
NSBeep();
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)handleClosedFileEvent:(NSAppleEventDescriptor*)event withReplyEvent:(NSAppleEventDescriptor*)replyEvent
|
||||
{
|
||||
NSAppleEventDescriptor* fileURL = [[event paramDescriptorForKeyword:keyDirectObject] coerceToDescriptorType:typeFileURL];
|
||||
NSString* urlString = [[[NSString alloc] initWithData:[fileURL data] encoding:NSUTF8StringEncoding] autorelease];
|
||||
NSString* fileName = [[[NSURL URLWithString:urlString] path] stringByStandardizingPath];
|
||||
|
||||
if([FailedFiles containsObject:fileName])
|
||||
{
|
||||
if([[NSFileManager defaultManager] fileExistsAtPath:fileName])
|
||||
[[NSWorkspace sharedWorkspace] selectFile:fileName inFileViewerRootedAtPath:[fileName stringByDeletingLastPathComponent]];
|
||||
[FailedFiles removeObject:fileName];
|
||||
}
|
||||
else
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
[[NSFileManager defaultManager] removeItemAtPath:fileName error:NULL];
|
||||
#else
|
||||
[[NSFileManager defaultManager] removeFileAtPath:fileName handler:nil];
|
||||
#endif
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
}
|
||||
|
||||
[OpenFiles removeObjectForKey:[fileName precomposedStringWithCanonicalMapping]];
|
||||
if([OpenFiles count] == 0)
|
||||
[self removeODBEventHandlers];
|
||||
}
|
||||
|
||||
+ (NSMenu*)findEditMenu
|
||||
{
|
||||
NSMenu* mainMenu = [NSApp mainMenu];
|
||||
std::map<size_t, NSMenu*> ranked;
|
||||
for(int i = 0; i != [mainMenu numberOfItems]; i++)
|
||||
{
|
||||
NSMenu* candidate = [[mainMenu itemAtIndex:i] submenu];
|
||||
static SEL const actions[] = { @selector(undo:), @selector(redo:), @selector(cut:), @selector(copy:), @selector(paste:), @selector(delete:), @selector(selectAll:) };
|
||||
size_t score = 0;
|
||||
for(int j = 0; j != sizeof(actions)/sizeof(actions[0]); j++)
|
||||
{
|
||||
if(-1 != [candidate indexOfItemWithTarget:nil andAction:actions[j]])
|
||||
score++;
|
||||
}
|
||||
|
||||
if(score > 0 && ranked.find(score) == ranked.end())
|
||||
ranked[score] = candidate;
|
||||
}
|
||||
return ranked.empty() ? nil : (--ranked.end())->second;
|
||||
}
|
||||
|
||||
+ (void)installMenuItem:(id)sender
|
||||
{
|
||||
if(NSMenu* editMenu = [self findEditMenu])
|
||||
{
|
||||
[editMenu addItem:[NSMenuItem separatorItem]];
|
||||
NSString* ellips = [NSString stringWithUTF8String:"\xe2\x80\xa6"]; // utf-8 for the '...' character (literal utf8 is not allowed in source code)
|
||||
NSMenuItem *menuItem = [editMenu addItemWithTitle:[NSString stringWithFormat:@"Edit in %@%@", ODBEditorName, ellips] action:@selector(editInODBEditor:) keyEquivalent:@"E"];
|
||||
[menuItem setKeyEquivalentModifierMask:NSControlKeyMask | NSCommandKeyMask];
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)load
|
||||
{
|
||||
OpenFiles = [NSMutableDictionary new];
|
||||
FailedFiles = [NSMutableSet new];
|
||||
NSString* mainBundleIdentifier = [[NSBundle mainBundle] bundleIdentifier]; // reads app we're used inside off
|
||||
NSString* bundleIdentifier = @"org.slashpunt.edit_in_odbeditor"; // XXX Should this be hardcoded?
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults addSuiteNamed:bundleIdentifier];
|
||||
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"NO", @"DisableEditInODBEditorMenuItem",
|
||||
@"", @"ODBEditorBundleIdentifier",
|
||||
@"<Unknown>", @"ODBEditorName",
|
||||
nil];
|
||||
|
||||
[defaults registerDefaults:appDefaults];
|
||||
|
||||
ODBEditorBundleIdentifier = [[defaults stringForKey:@"ODBEditorBundleIdentifier"] retain] ?: @"";
|
||||
ODBEditorName = [[defaults stringForKey:@"ODBEditorName"] retain] ?: @"<Unknown>";
|
||||
if([defaults boolForKey:@"DisableEditInODBEditorMenuItem"] == NO
|
||||
&& ![ODBEditorBundleIdentifier isEqualToString:@""]
|
||||
&& ![ODBEditorBundleIdentifier isEqualToString:mainBundleIdentifier])
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(installMenuItem:) name:NSApplicationDidFinishLaunchingNotification object:[NSApplication sharedApplication]];
|
||||
}
|
||||
@end
|
||||
@@ -1,60 +0,0 @@
|
||||
//
|
||||
// NSTextView: Edit in ODBEditor.mm
|
||||
//
|
||||
// Created by Allan Odgaard on 2005-11-27.
|
||||
// See LICENSE for license details
|
||||
//
|
||||
// Generalized by Chris Eidhof and Eelco Lempsink from 'NSTextView: Edit in TextMate.mm'
|
||||
|
||||
#import "Edit in ODBEditor.h"
|
||||
|
||||
@interface NSTextView (EditInODBEditor)
|
||||
- (void)editInODBEditor:(id)sender;
|
||||
@end
|
||||
|
||||
@implementation NSTextView (EditInODBEditor)
|
||||
- (void)editInODBEditor:(id)sender
|
||||
{
|
||||
if(![self isEditable])
|
||||
return (void)NSBeep();
|
||||
|
||||
NSString* str = [[self textStorage] string];
|
||||
NSRange selectedRange = [self selectedRange];
|
||||
int lineNumber = 0;
|
||||
if(selectedRange.length == 0)
|
||||
{
|
||||
NSRange range = NSMakeRange(0, 0);
|
||||
do {
|
||||
NSRange oldRange = range;
|
||||
range = [str lineRangeForRange:NSMakeRange(NSMaxRange(range), 0)];
|
||||
if(NSMaxRange(oldRange) == NSMaxRange(range) || selectedRange.location < NSMaxRange(range))
|
||||
break;
|
||||
lineNumber++;
|
||||
} while(true);
|
||||
selectedRange = NSMakeRange(0, [str length]);
|
||||
}
|
||||
|
||||
[EditInODBEditor externalEditString:[str substringWithRange:selectedRange] startingAtLine:lineNumber forView:self];
|
||||
}
|
||||
|
||||
- (void)odbEditorDidModifyString:(NSString*)newString
|
||||
{
|
||||
NSRange selectedRange = [self selectedRange];
|
||||
BOOL hadSelection = selectedRange.length != 0;
|
||||
selectedRange = hadSelection ? selectedRange : NSMakeRange(0, [[self textStorage] length]);
|
||||
if([self shouldChangeTextInRange:selectedRange replacementString:newString])
|
||||
{
|
||||
if(!hadSelection)
|
||||
[self setSelectedRange:NSMakeRange(0, [[self textStorage] length])];
|
||||
[self insertText:newString];
|
||||
if(hadSelection)
|
||||
[self setSelectedRange:NSMakeRange(selectedRange.location, [newString length])];
|
||||
[self didChangeText];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSBeep();
|
||||
NSLog(@"%s couldn't edit text", _cmd);
|
||||
}
|
||||
}
|
||||
@end
|
||||
@@ -1,414 +0,0 @@
|
||||
//
|
||||
// WebView: Edit in ODBEditor.mm
|
||||
//
|
||||
// Created by Allan Odgaard on 2005-11-27.
|
||||
// See LICENSE for license details
|
||||
//
|
||||
// Generalized by Chris Eidhof and Eelco Lempsink from 'WebView: Edit in TextMate.mm'
|
||||
|
||||
|
||||
#import <WebKit/WebKit.h>
|
||||
#import <vector>
|
||||
#import "Edit in ODBEditor.h"
|
||||
|
||||
#ifndef sizeofA
|
||||
#define sizeofA(x) (sizeof(x)/sizeof(x[0]))
|
||||
#endif
|
||||
|
||||
// only latest WebKit has this stuff, and it is private
|
||||
@interface DOMHTMLTextAreaElement (DOMHTMLTextAreaElementPrivate)
|
||||
- (int)selectionStart;
|
||||
- (void)setSelectionStart:(int)newSelectionStart;
|
||||
- (int)selectionEnd;
|
||||
- (void)setSelectionEnd:(int)newSelectionEnd;
|
||||
- (void)setSelectionRange:(int)start end:(int)end;
|
||||
@end
|
||||
|
||||
@interface WebView (EditInODBEditor)
|
||||
- (void)editInODBEditor:(id)sender;
|
||||
@end
|
||||
|
||||
@interface NSString (EditInODBEditor)
|
||||
- (NSString*)ODB_stringByTrimmingWhitespace;
|
||||
- (NSString*)ODB_stringByReplacingString:(NSString*)aSearchString withString:(NSString*)aReplaceString;
|
||||
- (NSString*)ODB_stringByNbspEscapingSpaces;
|
||||
@end
|
||||
|
||||
@implementation NSString (EditInODBEditor)
|
||||
- (NSString*)ODB_stringByTrimmingWhitespace
|
||||
{
|
||||
NSString* str = self;
|
||||
while([str hasPrefix:@" "])
|
||||
str = [str substringFromIndex:1];
|
||||
|
||||
while([str hasSuffix:@" "])
|
||||
str = [str substringToIndex:[str length]-1];
|
||||
return str;
|
||||
}
|
||||
|
||||
- (NSString*)ODB_stringByReplacingString:(NSString*)aSearchString withString:(NSString*)aReplaceString
|
||||
{
|
||||
return [[self componentsSeparatedByString:aSearchString] componentsJoinedByString:aReplaceString];
|
||||
}
|
||||
|
||||
- (NSString*)ODB_stringByNbspEscapingSpaces
|
||||
{
|
||||
unsigned len = [self length];
|
||||
unichar* buf = new unichar[len];
|
||||
[self getCharacters:buf];
|
||||
for(unsigned i = 0; i != len; i++)
|
||||
{
|
||||
if(buf[i] == ' ' && (i+1 == len || buf[i+1] == ' '))
|
||||
buf[i] = 0xA0;
|
||||
}
|
||||
return [NSString stringWithCharacters:buf length:len];
|
||||
}
|
||||
@end
|
||||
|
||||
struct convert_dom_to_text
|
||||
{
|
||||
convert_dom_to_text (DOMTreeWalker* treeWalker) : string([NSMutableString new]), quoteLevel(0), pendingFlush(NO), pendingWhitespace(NO), didOutputText(NO), atBeginOfLine(YES) { visit_nodes(treeWalker); }
|
||||
~convert_dom_to_text () { [string autorelease]; }
|
||||
operator NSString* () const { return string; }
|
||||
|
||||
private:
|
||||
void enter_block_tag ()
|
||||
{
|
||||
pendingFlush |= didOutputText;
|
||||
didOutputText = NO;
|
||||
pendingWhitespace = NO;
|
||||
}
|
||||
|
||||
void leave_block_tag ()
|
||||
{
|
||||
pendingFlush |= didOutputText;
|
||||
didOutputText = NO;
|
||||
pendingWhitespace = NO;
|
||||
}
|
||||
|
||||
void output_text (NSString* str)
|
||||
{
|
||||
if([str isEqualToString:@""])
|
||||
return;
|
||||
|
||||
str = [str ODB_stringByTrimmingWhitespace];
|
||||
if([str isEqualToString:@""])
|
||||
{
|
||||
pendingWhitespace = YES;
|
||||
return;
|
||||
}
|
||||
|
||||
str = [str ODB_stringByReplacingString:[NSString stringWithUTF8String:" "] withString:@" "];
|
||||
|
||||
if(pendingFlush)
|
||||
{
|
||||
[string appendString:@"\n"];
|
||||
pendingFlush = NO;
|
||||
atBeginOfLine = YES;
|
||||
}
|
||||
|
||||
if(atBeginOfLine && quoteLevel)
|
||||
{
|
||||
for(unsigned i = 0; i < quoteLevel; i++)
|
||||
[string appendString:@"> "];
|
||||
}
|
||||
else if(!atBeginOfLine && pendingWhitespace)
|
||||
{
|
||||
[string appendString:@" "];
|
||||
}
|
||||
|
||||
[string appendString:str];
|
||||
atBeginOfLine = NO;
|
||||
didOutputText = YES;
|
||||
pendingWhitespace = NO;
|
||||
}
|
||||
|
||||
void visit_nodes (DOMTreeWalker* treeWalker);
|
||||
|
||||
NSMutableString* string;
|
||||
unsigned quoteLevel;
|
||||
BOOL pendingFlush;
|
||||
BOOL pendingWhitespace;
|
||||
BOOL didOutputText;
|
||||
BOOL atBeginOfLine;
|
||||
};
|
||||
|
||||
struct helper
|
||||
{
|
||||
helper (DOMHTMLTextAreaElement* textArea) : textArea(textArea)
|
||||
{
|
||||
value = [textArea value];
|
||||
selectionStart = [textArea selectionStart];
|
||||
selectionEnd = [textArea selectionEnd];
|
||||
}
|
||||
|
||||
helper () : textArea(nil), value(nil) { }
|
||||
bool should_change () const { return selectionStart != 0 || selectionEnd != [value length]; }
|
||||
bool did_change () const { return selectionStart != [textArea selectionStart] || selectionEnd != [textArea selectionEnd]; }
|
||||
void reset () const
|
||||
{
|
||||
if([textArea value] != value) [textArea setValue:value];
|
||||
if(did_change()) [textArea setSelectionRange:selectionStart end:selectionEnd];
|
||||
}
|
||||
|
||||
static bool usable (DOMNode* node)
|
||||
{
|
||||
static SEL const selectors[] = { @selector(selectionStart), @selector(selectionEnd), @selector(setSelectionStart:), @selector(setSelectionEnd:), @selector(value), @selector(setValue:), @selector(setSelectionRange:end:) };
|
||||
BOOL res = [node isKindOfClass:[DOMHTMLTextAreaElement class]] && ![(DOMHTMLTextAreaElement*)node disabled] && ![(DOMHTMLTextAreaElement*)node readOnly];
|
||||
for(size_t i = 0; i < sizeofA(selectors); ++i)
|
||||
res = res && [node respondsToSelector:selectors[i]];
|
||||
return res;
|
||||
}
|
||||
|
||||
DOMHTMLTextAreaElement* textArea;
|
||||
NSString* value;
|
||||
unsigned long selectionStart;
|
||||
unsigned long selectionEnd;
|
||||
};
|
||||
|
||||
void convert_dom_to_text::visit_nodes (DOMTreeWalker* treeWalker)
|
||||
{
|
||||
for(DOMNode* node = [treeWalker currentNode]; node; node = [treeWalker nextSibling])
|
||||
{
|
||||
if([node nodeType] == DOM_TEXT_NODE)
|
||||
output_text([node nodeValue]);
|
||||
else if([[[node nodeName] uppercaseString] isEqualToString:@"BR"])
|
||||
output_text(@"\n"), (atBeginOfLine = YES), (didOutputText = NO);
|
||||
else if([[[node nodeName] uppercaseString] isEqualToString:@"DIV"])
|
||||
enter_block_tag();
|
||||
else if([[[node nodeName] uppercaseString] isEqualToString:@"BLOCKQUOTE"])
|
||||
enter_block_tag(), ++quoteLevel;
|
||||
else if([[[node nodeName] uppercaseString] isEqualToString:@"P"])
|
||||
enter_block_tag();
|
||||
|
||||
if([treeWalker firstChild])
|
||||
{
|
||||
visit_nodes(treeWalker);
|
||||
[treeWalker parentNode];
|
||||
}
|
||||
|
||||
if([[[node nodeName] uppercaseString] isEqualToString:@"DIV"])
|
||||
leave_block_tag();
|
||||
else if([[[node nodeName] uppercaseString] isEqualToString:@"BLOCKQUOTE"])
|
||||
leave_block_tag(), --quoteLevel;
|
||||
else if([[[node nodeName] uppercaseString] isEqualToString:@"P"])
|
||||
leave_block_tag();
|
||||
}
|
||||
}
|
||||
|
||||
static DOMHTMLTextAreaElement* find_active_text_area_for_frame (WebFrame* frame)
|
||||
{
|
||||
DOMHTMLTextAreaElement* res = nil;
|
||||
DOMDocument* doc = [frame DOMDocument];
|
||||
if([doc respondsToSelector:@selector(focusNode)])
|
||||
{
|
||||
// OmniWeb 5.6 has a method to get the focused node
|
||||
res = [doc performSelector:@selector(focusNode)];
|
||||
if(!helper::usable(res))
|
||||
res = nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
// The following is a heuristic for finding the active text area:
|
||||
//
|
||||
// 1. If there is just one text area, we use that.
|
||||
//
|
||||
// 2. If there are multiple, we ask the web view to “select all”
|
||||
// which goes to the active text area (hopefully) and then we
|
||||
// check which of the text areas in the DOM actually changed.
|
||||
//
|
||||
// There is a problem if either a text area has no content (in
|
||||
// which case select all makes no changes) or if everything is
|
||||
// already selected. If only one text area is in the state of
|
||||
// “select all would not affect it” and no text areas were
|
||||
// changed, we assume the one with that state is the active.
|
||||
|
||||
std::vector<helper> v;
|
||||
DOMNodeList* textAreas = [doc getElementsByTagName:@"TEXTAREA"];
|
||||
for(unsigned long i = 0; i < [textAreas length]; ++i)
|
||||
{
|
||||
if(helper::usable([textAreas item:i]))
|
||||
v.push_back((DOMHTMLTextAreaElement*)[textAreas item:i]);
|
||||
}
|
||||
|
||||
if(v.size() == 1)
|
||||
{
|
||||
res = v[0].textArea;
|
||||
}
|
||||
else if(v.size() > 1)
|
||||
{
|
||||
for(std::vector<helper>::iterator it = v.begin(); it != v.end(); ++it)
|
||||
if (!it->should_change())
|
||||
[it->textArea setValue:@" "];
|
||||
[[frame webView] selectLine:nil];
|
||||
|
||||
size_t should_change = 0, did_change = 0;
|
||||
for(std::vector<helper>::iterator it = v.begin(); it != v.end(); ++it)
|
||||
{
|
||||
did_change += it->did_change() ? 1 : 0;
|
||||
should_change += it->should_change() ? 1 : 0;
|
||||
}
|
||||
|
||||
if(did_change == 1)
|
||||
{
|
||||
for(std::vector<helper>::iterator it = v.begin(); it != v.end(); ++it)
|
||||
res = it->did_change() ? it->textArea : res;
|
||||
}
|
||||
else if(did_change == 0 && should_change == v.size()-1)
|
||||
{
|
||||
for(std::vector<helper>::iterator it = v.begin(); it != v.end(); ++it)
|
||||
res = !it->should_change() ? it->textArea : res;
|
||||
}
|
||||
|
||||
for(std::vector<helper>::iterator it = v.begin(); it != v.end(); ++it)
|
||||
it->reset();
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static DOMHTMLTextAreaElement* find_active_text_area (WebView* view)
|
||||
{
|
||||
DOMHTMLTextAreaElement* res = nil;
|
||||
if([view respondsToSelector:@selector(selectedFrame)])
|
||||
res = find_active_text_area_for_frame([view performSelector:@selector(selectedFrame)]);
|
||||
else
|
||||
{
|
||||
WebFrame* frame = [view mainFrame];
|
||||
NSArray* frames = [[NSArray arrayWithObject: frame] arrayByAddingObjectsFromArray: [frame childFrames]];
|
||||
for(unsigned i = 0; i != [frames count] && !res; i++)
|
||||
res = find_active_text_area_for_frame([frames objectAtIndex:i]);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@implementation WebView (EditInODBEditor)
|
||||
- (void)editInODBEditor:(id)sender
|
||||
{
|
||||
if([self isEditable])
|
||||
{
|
||||
// Mail uses an editable WebView, in which case we want to send the entire page to the ODB Editor
|
||||
|
||||
NSString* const CARET = [NSString stringWithFormat:@"%C", 0xFFFD];
|
||||
NSString* str = @"";
|
||||
int lineNumber = 0;
|
||||
|
||||
DOMDocumentFragment* selection = [[self selectedDOMRange] cloneContents];
|
||||
if(!selection)
|
||||
{
|
||||
[self insertText:CARET]; // ugly hack, but we want to preserve the position of the caret
|
||||
[self selectAll:nil];
|
||||
selection = [[self selectedDOMRange] cloneContents];
|
||||
|
||||
// remove the caret marker. TODO we should start an undo group, so the (chunked) undo doesn’t remove more than just the caret
|
||||
if(NSUndoManager* undoManager = [self undoManager])
|
||||
{
|
||||
if([undoManager canUndo])
|
||||
{
|
||||
[undoManager undo];
|
||||
[self selectAll:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(selection)
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4)
|
||||
str = convert_dom_to_text([[[self mainFrame] DOMDocument] createTreeWalker:selection whatToShow:DOM_SHOW_ALL filter:nil expandEntityReferences:YES]);
|
||||
#else
|
||||
str = convert_dom_to_text([[[self mainFrame] DOMDocument] createTreeWalker:selection :DOM_SHOW_ALL :nil :YES]);
|
||||
#endif
|
||||
while([str hasSuffix:@"\n\n"])
|
||||
str = [str substringToIndex:[str length]-1];
|
||||
|
||||
NSArray* split = [str componentsSeparatedByString:CARET];
|
||||
if([split count] == 2)
|
||||
{
|
||||
lineNumber = [[[split objectAtIndex:0] componentsSeparatedByString:@"\n"] count] - 1;
|
||||
str = [split componentsJoinedByString:@""];
|
||||
}
|
||||
}
|
||||
[EditInODBEditor externalEditString:str startingAtLine:lineNumber forView:self];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Likely the user wants to edit just a text area, so let’s try to find which
|
||||
if(DOMHTMLTextAreaElement* textArea = find_active_text_area(self))
|
||||
{
|
||||
NSString* str = [textArea value];
|
||||
unsigned long selectionStart = [textArea selectionStart];
|
||||
int lineNumber = 0;
|
||||
NSRange range = NSMakeRange(0, 0);
|
||||
do {
|
||||
NSRange oldRange = range;
|
||||
range = [str lineRangeForRange:NSMakeRange(NSMaxRange(range), 0)];
|
||||
if(NSMaxRange(oldRange) == NSMaxRange(range) || selectionStart < NSMaxRange(range))
|
||||
break;
|
||||
lineNumber++;
|
||||
} while(true);
|
||||
[EditInODBEditor externalEditString:str startingAtLine:lineNumber forView:self withObject:textArea];
|
||||
}
|
||||
else NSBeep();
|
||||
}
|
||||
}
|
||||
|
||||
- (void)odbEditorDidModifyString:(NSString*)newString withObject:(NSObject*)textArea
|
||||
{
|
||||
if([self isEditable])
|
||||
{
|
||||
NSArray* lines = [newString componentsSeparatedByString:@"\n"];
|
||||
NSMutableString* res = [NSMutableString string];
|
||||
unsigned quoteLevel = 0;
|
||||
for(unsigned i = 0; i != [lines count]; i++)
|
||||
{
|
||||
NSString* line = [lines objectAtIndex:i];
|
||||
|
||||
unsigned newQuoteLevel = 0;
|
||||
while([line hasPrefix:@"> "])
|
||||
{
|
||||
line = [line substringFromIndex:2];
|
||||
newQuoteLevel++;
|
||||
}
|
||||
|
||||
if([line isEqualToString:@">"])
|
||||
{
|
||||
line = @"";
|
||||
newQuoteLevel++;
|
||||
}
|
||||
|
||||
if(newQuoteLevel > quoteLevel)
|
||||
{
|
||||
for(unsigned j = 0; j != newQuoteLevel - quoteLevel; j++)
|
||||
[res appendString:@"<BLOCKQUOTE type=\"cite\">"];
|
||||
}
|
||||
else if(newQuoteLevel < quoteLevel)
|
||||
{
|
||||
for(unsigned j = 0; j != quoteLevel - newQuoteLevel; j++)
|
||||
[res appendString:@"</BLOCKQUOTE>"];
|
||||
}
|
||||
quoteLevel = newQuoteLevel;
|
||||
|
||||
if([line isEqualToString:@""])
|
||||
{
|
||||
[res appendString:@"<DIV><BR></DIV>"];
|
||||
}
|
||||
else
|
||||
{
|
||||
line = [line ODB_stringByNbspEscapingSpaces];
|
||||
line = [line ODB_stringByReplacingString:@"&" withString:@"&"];
|
||||
line = [line ODB_stringByReplacingString:@"<" withString:@"<"];
|
||||
line = [line ODB_stringByReplacingString:@">" withString:@">"];
|
||||
[res appendFormat:@"<DIV>%@</DIV>", line];
|
||||
}
|
||||
}
|
||||
|
||||
[self replaceSelectionWithMarkupString:res];
|
||||
if(![[self selectedDOMRange] cloneContents])
|
||||
[self selectAll:nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
[(DOMHTMLTextAreaElement*)textArea setValue:newString];
|
||||
}
|
||||
}
|
||||
@end
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
'macromates.com/blog/' = 'markdown';
|
||||
'blacktree.cocoaforge.com/forums/' = 'bbcode';
|
||||
'mail.google.com/' = 'mail';
|
||||
}
|
||||
@@ -2205,3 +2205,64 @@ netbeans_draw_multisign_indicator(int row)
|
||||
# endif // FEAT_NETBEANS_INTG
|
||||
|
||||
#endif // FEAT_SIGN_ICONS
|
||||
|
||||
|
||||
|
||||
// -- Balloon Eval Support ---------------------------------------------------
|
||||
|
||||
#ifdef FEAT_BEVAL
|
||||
|
||||
BalloonEval *
|
||||
gui_mch_create_beval_area(target, mesg, mesgCB, clientData)
|
||||
void *target;
|
||||
char_u *mesg;
|
||||
void (*mesgCB)__ARGS((BalloonEval *, int));
|
||||
void *clientData;
|
||||
{
|
||||
BalloonEval *beval;
|
||||
|
||||
beval = (BalloonEval *)calloc(1, sizeof(BalloonEval));
|
||||
if (NULL == beval)
|
||||
return NULL;
|
||||
|
||||
beval->msg = mesg;
|
||||
beval->msgCB = mesgCB;
|
||||
beval->clientData = clientData;
|
||||
|
||||
return beval;
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_enable_beval_area(beval)
|
||||
BalloonEval *beval;
|
||||
{
|
||||
// Set the balloon delay when enabling balloon eval.
|
||||
float delay = p_bdlay/1000.0f - MMBalloonEvalInternalDelay;
|
||||
if (delay < 0) delay = 0;
|
||||
[[MMBackend sharedInstance] queueMessage:SetTooltipDelayMsgID properties:
|
||||
[NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:delay]
|
||||
forKey:@"delay"]];
|
||||
}
|
||||
|
||||
void
|
||||
gui_mch_disable_beval_area(beval)
|
||||
BalloonEval *beval;
|
||||
{
|
||||
// NOTE: An empty tool tip indicates that the tool tip window should hide.
|
||||
[[MMBackend sharedInstance] queueMessage:SetTooltipMsgID properties:
|
||||
[NSDictionary dictionaryWithObject:@"" forKey:@"toolTip"]];
|
||||
}
|
||||
|
||||
/*
|
||||
* Show a balloon with "mesg".
|
||||
*/
|
||||
void
|
||||
gui_mch_post_balloon(beval, mesg)
|
||||
BalloonEval *beval;
|
||||
char_u *mesg;
|
||||
{
|
||||
NSString *toolTip = [NSString stringWithVimString:mesg];
|
||||
[[MMBackend sharedInstance] setLastToolTip:toolTip];
|
||||
}
|
||||
|
||||
#endif // FEAT_BEVAL
|
||||
|
||||
+3
-3
@@ -1270,10 +1270,10 @@ APPDIR = $(VIMNAME).app
|
||||
CARBONGUI_TESTARG = VIMPROG=../$(APPDIR)/Contents/MacOS/$(VIMTARGET)
|
||||
|
||||
# MACVIM GUI
|
||||
MACVIMGUI_SRC = gui.c MacVim/gui_macvim.m MacVim/MMBackend.m \
|
||||
MACVIMGUI_SRC = gui.c gui_beval.c MacVim/gui_macvim.m MacVim/MMBackend.m \
|
||||
MacVim/MacVim.m
|
||||
MACVIMGUI_OBJ = objects/gui.o objects/pty.o objects/gui_macvim.o \
|
||||
objects/MMBackend.o objects/MacVim.o
|
||||
MACVIMGUI_OBJ = objects/gui.o objects/gui_beval.o objects/pty.o \
|
||||
objects/gui_macvim.o objects/MMBackend.o objects/MacVim.o
|
||||
MACVIMGUI_DEFS = -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe
|
||||
MACVIMGUI_IPATH =
|
||||
MACVIMGUI_LIBS_DIR =
|
||||
|
||||
+3
-2
@@ -1264,14 +1264,15 @@
|
||||
* Only for GUIs where it was implemented.
|
||||
*/
|
||||
#if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \
|
||||
|| defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32)) \
|
||||
|| defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32) \
|
||||
|| defined(FEAT_GUI_MACVIM)) \
|
||||
&& ( ((defined(FEAT_TOOLBAR) || defined(FEAT_GUI_TABLINE)) \
|
||||
&& !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)) \
|
||||
|| defined(FEAT_SUN_WORKSHOP) \
|
||||
|| defined(FEAT_NETBEANS_INTG) || defined(FEAT_EVAL))
|
||||
# define FEAT_BEVAL
|
||||
# if !defined(FEAT_XFONTSET) && !defined(FEAT_GUI_GTK) \
|
||||
&& !defined(FEAT_GUI_W32)
|
||||
&& !defined(FEAT_GUI_W32) && !defined(FEAT_GUI_MACVIM)
|
||||
# define FEAT_XFONTSET
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -580,6 +580,9 @@ gui_init()
|
||||
# ifdef FEAT_GUI_GTK
|
||||
balloonEval = gui_mch_create_beval_area(gui.drawarea, NULL,
|
||||
&general_beval_cb, NULL);
|
||||
# elif defined(FEAT_GUI_MACVIM)
|
||||
balloonEval = gui_mch_create_beval_area(NULL, NULL,
|
||||
&general_beval_cb, NULL);
|
||||
# else
|
||||
# if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)
|
||||
{
|
||||
|
||||
+7
-7
@@ -109,8 +109,8 @@ general_beval_cb(beval, state)
|
||||
recursive = FALSE;
|
||||
}
|
||||
|
||||
/* on Win32 only get_beval_info() is required */
|
||||
#if !defined(FEAT_GUI_W32) || defined(PROTO)
|
||||
/* on Win32 and MacVim only get_beval_info() is required */
|
||||
#if !(defined(FEAT_GUI_W32) || defined(FEAT_GUI_MACVIM)) || defined(PROTO)
|
||||
|
||||
#ifdef FEAT_GUI_GTK
|
||||
# include <gdk/gdkkeysyms.h>
|
||||
@@ -295,7 +295,7 @@ gui_mch_currently_showing_beval()
|
||||
return current_beval;
|
||||
}
|
||||
#endif
|
||||
#endif /* !FEAT_GUI_W32 */
|
||||
#endif /* !(FEAT_GUI_W32 || FEAT_GUI_MACVIM) */
|
||||
|
||||
#if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG) \
|
||||
|| defined(FEAT_EVAL) || defined(PROTO)
|
||||
@@ -408,7 +408,7 @@ get_beval_info(beval, getword, winp, lnump, textp, colp)
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
# if !defined(FEAT_GUI_W32) || defined(PROTO)
|
||||
# if !(defined(FEAT_GUI_W32) || defined(FEAT_GUI_MACVIM)) || defined(PROTO)
|
||||
|
||||
/*
|
||||
* Show a balloon with "mesg".
|
||||
@@ -424,10 +424,10 @@ gui_mch_post_balloon(beval, mesg)
|
||||
else
|
||||
undrawBalloon(beval);
|
||||
}
|
||||
# endif /* FEAT_GUI_W32 */
|
||||
# endif /* FEAT_GUI_W32 || FEAT_GUI_MACVIM */
|
||||
#endif /* FEAT_SUN_WORKSHOP || FEAT_NETBEANS_INTG || PROTO */
|
||||
|
||||
#if !defined(FEAT_GUI_W32) || defined(PROTO)
|
||||
#if !(defined(FEAT_GUI_W32) || defined(FEAT_GUI_MACVIM)) || defined(PROTO)
|
||||
#if defined(FEAT_BEVAL_TIP) || defined(PROTO)
|
||||
/*
|
||||
* Hide the given balloon.
|
||||
@@ -1336,6 +1336,6 @@ createBalloonEvalWindow(beval)
|
||||
}
|
||||
|
||||
#endif /* !FEAT_GUI_GTK */
|
||||
#endif /* !FEAT_GUI_W32 */
|
||||
#endif /* !(FEAT_GUI_W32 || FEAT_GUI_MACVIM) */
|
||||
|
||||
#endif /* FEAT_BEVAL */
|
||||
|
||||
+5
-1
@@ -37,6 +37,9 @@ typedef struct BalloonEvalStruct
|
||||
int x;
|
||||
int y;
|
||||
unsigned int state; /* Button/Modifier key state */
|
||||
#elif defined(FEAT_GUI_MACVIM)
|
||||
int x;
|
||||
int y;
|
||||
#else
|
||||
# if !defined(FEAT_GUI_W32)
|
||||
Widget target; /* widget we are monitoring */
|
||||
@@ -62,7 +65,8 @@ typedef struct BalloonEvalStruct
|
||||
char_u *msg;
|
||||
void (*msgCB)__ARGS((struct BalloonEvalStruct *, int));
|
||||
void *clientData; /* For callback */
|
||||
#if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)
|
||||
#if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32) \
|
||||
&& !defined(FEAT_GUI_MACVIM)
|
||||
Dimension screen_width; /* screen width in pixels */
|
||||
Dimension screen_height; /* screen height in pixels */
|
||||
#endif
|
||||
|
||||
@@ -773,6 +773,7 @@ add_menu_path(menu_path, menuarg, pri_tab, call_data
|
||||
}
|
||||
}
|
||||
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) \
|
||||
&& !defined(FEAT_GUI_MACVIM) \
|
||||
&& (defined(FEAT_BEVAL) || defined(FEAT_GUI_GTK))
|
||||
/* Need to update the menu tip. */
|
||||
if (modes & MENU_TIP_MODE)
|
||||
@@ -968,6 +969,7 @@ remove_menu(menup, name, modes, silent)
|
||||
{
|
||||
free_menu_string(menu, MENU_INDEX_TIP);
|
||||
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) \
|
||||
&& !defined(FEAT_GUI_MACVIM) \
|
||||
&& (defined(FEAT_BEVAL) || defined(FEAT_GUI_GTK))
|
||||
/* Need to update the menu tip. */
|
||||
if (gui.in_use)
|
||||
|
||||
Reference in New Issue
Block a user