From 865193b4bf78d87c5790708ec7b0e348cf424df5 Mon Sep 17 00:00:00 2001 From: wlux Date: Sat, 15 Jan 2011 19:28:24 +0000 Subject: [PATCH] Rename color (list) change notifications to match Cocoa (and OpenStep). git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31893 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 13 +++++++++++++ Headers/AppKit/NSColorList.h | 2 +- Headers/AppKit/NSColorPanel.h | 2 +- Source/NSColorList.m | 6 +++--- Source/NSColorPanel.m | 4 ++-- Source/NSColorWell.m | 2 +- Source/NSWindow.m | 2 +- Source/externs.m | 13 ++++++++++--- 8 files changed, 32 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8111785e4..ab4a44990 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2011-01-15 Wolfgang Lux + + * Headers/AppKit/NSColorList.h: + * Headers/AppKit/NSColorPanel.h: + * Source/NSColorList.m (-insertColor:key:atIndex:, + -removeColorWithKey:, -setColorForKey:): + * Source/NSColorPanel.m (-setColor:): + * Source/NSColorWell.m (-activate:): + * Source/NSWindow.m (-initWithContentRect:styleMask:backing:defer:): + * Source/externs.m(NSColorListDidChangeNotification, + NSColorPanelColorDidChangeNotification): + Rename notifications to match Cocoa (and OpenStep). + 2011-01-15 Wolfgang Lux * Source/NSApplication.m (-rightMouseDown:): diff --git a/Headers/AppKit/NSColorList.h b/Headers/AppKit/NSColorList.h index fa6340564..9eb21b96c 100644 --- a/Headers/AppKit/NSColorList.h +++ b/Headers/AppKit/NSColorList.h @@ -164,6 +164,6 @@ @end /* Notifications */ -APPKIT_EXPORT NSString *NSColorListChangedNotification; +APPKIT_EXPORT NSString *NSColorListDidChangeNotification; #endif // _GNUstep_H_NSColorList diff --git a/Headers/AppKit/NSColorPanel.h b/Headers/AppKit/NSColorPanel.h index bf0fa2c1a..a754eae46 100644 --- a/Headers/AppKit/NSColorPanel.h +++ b/Headers/AppKit/NSColorPanel.h @@ -138,6 +138,6 @@ enum { @end /* Notifications */ -APPKIT_EXPORT NSString *NSColorPanelColorChangedNotification; +APPKIT_EXPORT NSString *NSColorPanelColorDidChangeNotification; #endif // _GNUstep_H_NSColorPanel diff --git a/Source/NSColorList.m b/Source/NSColorList.m index 8e5cd1884..a89c9b652 100644 --- a/Source/NSColorList.m +++ b/Source/NSColorList.m @@ -342,7 +342,7 @@ static NSColorList *themeColorList = nil; [_orderedColorKeys removeObject: key]; [_orderedColorKeys insertObject: key atIndex: location]; - n = [NSNotification notificationWithName: NSColorListChangedNotification + n = [NSNotification notificationWithName: NSColorListDidChangeNotification object: self userInfo: nil]; [[NSNotificationQueue defaultQueue] @@ -363,7 +363,7 @@ static NSColorList *themeColorList = nil; [_colorDictionary removeObjectForKey: key]; [_orderedColorKeys removeObject: key]; - n = [NSNotification notificationWithName: NSColorListChangedNotification + n = [NSNotification notificationWithName: NSColorListDidChangeNotification object: self userInfo: nil]; [[NSNotificationQueue defaultQueue] @@ -387,7 +387,7 @@ static NSColorList *themeColorList = nil; if ([_orderedColorKeys containsObject: key] == NO) [_orderedColorKeys addObject: key]; - n = [NSNotification notificationWithName: NSColorListChangedNotification + n = [NSNotification notificationWithName: NSColorListDidChangeNotification object: self userInfo: nil]; [[NSNotificationQueue defaultQueue] diff --git a/Source/NSColorPanel.m b/Source/NSColorPanel.m index f73f25156..8eeac01c0 100644 --- a/Source/NSColorPanel.m +++ b/Source/NSColorPanel.m @@ -676,7 +676,7 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel; } /**

Sets the NSColor displayed to aColor. This method post a - NSColorPanelColorChangedNotification notification if needed.

+ NSColorPanelColorDidChangeNotification notification if needed.

See Also: -color [NSColorWell-setColor:]

*/ @@ -691,7 +691,7 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel; [NSApp sendAction: _action to: _target from: self]; [[NSNotificationCenter defaultCenter] - postNotificationName: NSColorPanelColorChangedNotification + postNotificationName: NSColorPanelColorDidChangeNotification object: (id)self]; } diff --git a/Source/NSColorWell.m b/Source/NSColorWell.m index 6538e199f..9237d9f07 100644 --- a/Source/NSColorWell.m +++ b/Source/NSColorWell.m @@ -98,7 +98,7 @@ static NSString *GSColorWellDidBecomeExclusiveNotification = [nc addObserver: self selector: @selector(_takeColorFromPanel:) - name: NSColorPanelColorChangedNotification + name: NSColorPanelColorDidChangeNotification object: nil]; _is_active = YES; diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 960f356d0..949f43061 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -1030,7 +1030,7 @@ many times. [nc addObserver: self selector: @selector(colorListChanged:) - name: NSColorListChangedNotification + name: NSColorListDidChangeNotification object: nil]; if (style == NSWindows95InterfaceStyle) diff --git a/Source/externs.m b/Source/externs.m index de2456cee..647bceb2b 100644 --- a/Source/externs.m +++ b/Source/externs.m @@ -149,11 +149,18 @@ NSString *NSSystemColorsDidChangeNotification = @"NSSystemColorsDidChangeNotification"; // NSColorList notifications -NSString *NSColorListChangedNotification = @"NSColorListChange"; +NSString *NSColorListDidChangeNotification = @"NSColorListDidChange"; // NSColorPanel notifications -NSString *NSColorPanelColorChangedNotification = -@"NSColorPanelColorChangedNotification"; +NSString *NSColorPanelColorDidChangeNotification = + @"NSColorPanelColorDidChange"; + +#if GNUSTEP_GUI_MAJOR_VERSION == 0 && GNUSTEP_GUI_MINOR_VERSION < 20 +/* The above notifications had been misspelled in GNUstep. We keep them around + here to preserve binary compatibility until the next release. */ +NSString *NSColorListChangedNotification = @"NSColorListDidChange"; +NSString *NSColorPanelColorChangedNotification = @"NSColorPanelColorDidChange"; +#endif // NSComboBox notifications NSString *NSComboBoxWillPopUpNotification =