From 36dd211066029f67557854a43e7a5fddff0d8c44 Mon Sep 17 00:00:00 2001 From: Marcian Lytwyn Date: Thu, 28 Jun 2012 19:40:57 +0000 Subject: [PATCH] Fixes to NSOpenSavePanelDelegate and NSTextFieldDelegate definitions git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@35243 72102866-910b-0410-8b05-ffd578937521 --- Headers/AppKit/NSControl.h | 32 ++++++++++++-------------------- Headers/AppKit/NSSavePanel.h | 7 +++++-- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/Headers/AppKit/NSControl.h b/Headers/AppKit/NSControl.h index e020fc21b..7d20f3f11 100644 --- a/Headers/AppKit/NSControl.h +++ b/Headers/AppKit/NSControl.h @@ -44,23 +44,6 @@ @class NSEvent; @class NSTextView; -@protocol NSControlTextEditingDelegate -#if defined(__OBJC2__) -@optional -- (BOOL)control:(NSControl*)control didFailToFormatString:(NSString*)formatString errorDescription:(NSString*)error; -- (void)control:(NSControl*)control didFailToValidatePartialString:(NSString*)string errorDescription:(NSString*)error; -- (BOOL)control:(NSControl*)control isValidObject:(id)object; -- (BOOL)control:(NSControl*)control textShouldBeginEditing:(NSText*)fieldEditor; -- (BOOL)control:(NSControl*)control textShouldEndEditing:(NSText*)fieldEditor; -- (NSArray*)control:(NSControl*)control textView:(NSTextView*)textView - completions:(NSArray*)words - forPartialWordRange:(NSRange)charRange - indexOfSelectedItem:(NSInteger*)index; -- (BOOL)control:(NSControl*)control textView:(NSTextView*)textView doCommandBySelector:(SEL)command; -#endif -@end - - @interface NSControl : NSView { // Attributes @@ -217,7 +200,13 @@ APPKIT_EXPORT NSString *NSControlTextDidChangeNotification; // // Methods Implemented by the Delegate // -@interface NSObject (NSControlDelegate) +@protocol NSControlTextEditingDelegate +#ifdef __OBJC2__ +@optional +#else +@end +@interface NSObject (NSControlTextEditingDelegate) +#endif - (BOOL) control: (NSControl *)control isValidObject:(id)object; - (BOOL) control: (NSControl *)control @@ -227,9 +216,7 @@ APPKIT_EXPORT NSString *NSControlTextDidChangeNotification; textShouldEndEditing: (NSText *)fieldEditor; - (void) controlTextDidBeginEditing: (NSNotification *)aNotification; - - (void) controlTextDidEndEditing: (NSNotification *)aNotification; - - (void) controlTextDidChange: (NSNotification *)aNotification; - (BOOL) control: (NSControl *)control @@ -254,5 +241,10 @@ APPKIT_EXPORT NSString *NSControlTextDidChangeNotification; @end +@interface NSObject (NSControlDelegate) +- (void) controlTextDidBeginEditing: (NSNotification *)aNotification; +- (void) controlTextDidEndEditing: (NSNotification *)aNotification; +- (void) controlTextDidChange: (NSNotification *)aNotification; +@end #endif // _GNUstep_H_NSControl diff --git a/Headers/AppKit/NSSavePanel.h b/Headers/AppKit/NSSavePanel.h index dd94bf333..05ad0897f 100644 --- a/Headers/AppKit/NSSavePanel.h +++ b/Headers/AppKit/NSSavePanel.h @@ -58,8 +58,12 @@ enum { }; @protocol NSOpenSavePanelDelegate -#if defined(__OBJC2__) +#ifdef __OBJC2__ @optional +#else +@end +@interface NSObject (NSOpenSavePanelDelegate) +#endif - (BOOL)panel:(id)sender shouldEnableURL:(NSURL*)url; - (BOOL)panel:(id)sender validateURL:(NSURL*)url error:(NSError **)error; - (void)panel:(id)sender didChangeToDirectoryURL:(NSURL*)url; @@ -75,7 +79,6 @@ enum { with:(NSString*)name2 caseSensitive:(BOOL)caseSensitive; - (BOOL)panel:(id)sender shouldShowFilename:(NSString*)filename; -#endif @end