rough in more spelling

This commit is contained in:
Christopher Lloyd 2011-08-31 00:19:36 -04:00
parent 264eef6426
commit 84644531c5
8 changed files with 1486 additions and 5 deletions

File diff suppressed because it is too large Load Diff

View File

@ -213,6 +213,9 @@ static NSSpellChecker *shared=nil;
NSView *view=[_spellingViewController view];
_spellingPanel=[[NSPanel alloc] initWithContentRect:[view frame] styleMask:NSUtilityWindowMask backing:NSBackingStoreBuffered defer:YES];
[_spellingPanel setContentView:view];
[_spellingPanel center];
}

View File

@ -132,6 +132,9 @@ APPKIT_EXPORT NSString * const NSTextDidChangeNotification;
-(void)copyRuler:sender;
-(void)pasteRuler:sender;
-(void)showGuessPanel:sender;
-(void)checkSpelling:sender;
@end
@interface NSObject(NSText_delegate)

View File

@ -272,5 +272,13 @@ NSString * const NSTextDidChangeNotification=@"NSTextDidChangeNotification";
NSInvalidAbstractInvocation();
}
-(void)showGuessPanel:sender {
NSInvalidAbstractInvocation();
}
-(void)checkSpelling:sender {
NSInvalidAbstractInvocation();
}
@end

View File

@ -2601,6 +2601,15 @@ NSString * const NSOldSelectedCharacterRange=@"NSOldSelectedCharacterRange";
[[NSSpellChecker sharedSpellChecker] ignoreWord:[[sender selectedCell] stringValue] inSpellDocumentWithTag: [self spellCheckerDocumentTag]];
}
-(void)showGuessPanel:sender {
[[[NSSpellChecker sharedSpellChecker] spellingPanel] makeKeyAndOrderFront: self];
}
-(void)checkSpelling:sender {
[NSSpellChecker sharedSpellChecker];
NSUnimplementedMethod();
}
-(NSInteger)spellCheckerDocumentTag {
/* There is no explicity invalid document tag, this is indirectly documented as zero in the full checkSpellingOfString: method.
and supported by behavior. */

View File

@ -14,4 +14,6 @@
}
+(void)registerEngine;
@end

View File

@ -8,9 +8,32 @@
#import <Foundation/NSSpellEngine.h>
#import <Foundation/NSRaise.h>
#import <Foundation/NSBundle.h>
#import <Foundation/NSArray.h>
@implementation NSSpellEngine
+(void)initialize {
if(self==[NSSpellEngine class]){
NSArray *allPaths=[[NSBundle bundleForClass:self] pathsForResourcesOfType:@"spellEngine" inDirectory:nil];
int i,count=[allPaths count];
for(i=0;i<count;i++){
NSString *path=[allPaths objectAtIndex:i];
NSBundle *check=[NSBundle bundleWithPath:path];
Class cls=[check principalClass];
[cls registerEngine];
}
}
}
+(void)registerEngine {
NSUnimplementedMethod();
}
-(NSRange)spellServer:(NSSpellServer *)sender checkGrammarInString:(NSString *)string language:(NSString *)language details:(NSArray **)outDetails {
NSUnimplementedMethod();
return NSMakeRange(0,0);

View File

@ -23,6 +23,6 @@
<key>CFBundleVersion</key>
<string>1</string>
<key>NSPrincipalClass</key>
<string></string>
<string>NSSpellEngine_hunspell</string>
</dict>
</plist>