From 4d2dcb9e0491c9ffd0825e50ce45e148d604e648 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Thu, 25 Apr 2024 09:18:13 -0400 Subject: [PATCH 01/48] Add skeleton for NSTableRowView class that includes set/get methods --- Headers/AppKit/NSTableRowView.h | 56 +++++++++++++++++- Headers/AppKit/NSTableView.h | 9 +++ Source/NSTableRowView.m | 100 ++++++++++++++++++++++++++++++++ 3 files changed, 164 insertions(+), 1 deletion(-) diff --git a/Headers/AppKit/NSTableRowView.h b/Headers/AppKit/NSTableRowView.h index dde6daf0d..4f580f09f 100644 --- a/Headers/AppKit/NSTableRowView.h +++ b/Headers/AppKit/NSTableRowView.h @@ -25,7 +25,8 @@ #ifndef _NSTableRowView_h_GNUSTEP_GUI_INCLUDE #define _NSTableRowView_h_GNUSTEP_GUI_INCLUDE -#import +#import +#import #if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST) @@ -34,6 +35,59 @@ extern "C" { #endif @interface NSTableRowView : NSView +{ + // Display style... + BOOL _emphasized; + NSBackgroundStyle _interiorBackgroundStyle; + BOOL _floating; + + // Row selection... + BOOL _selected; + NSTableViewSelectionHighlightStyle _selectionHighlightStyle; + + // Drag and Drop... + NSTableViewDraggingDestinationFeedbackStyle _draggingDestinationFeedbackStyle; + CGFloat _indentationForDropOperation; + BOOL _targetForDropOperation; + + // Row grouping... + BOOL _groupRowStyle; + NSInteger _numberOfColumns; + + // Overriding row view display characteristics... + NSColor *_backgroundColor; +} + +- (BOOL) isEmphasized; +- (void) setEmphasized: (BOOL)flag; + +- (NSBackgroundStyle) interiorBackgroundStyle; + +- (BOOL) isFloating; +- (void) setFloating: (BOOL)flag; + +- (BOOL) isSelected; +- (void) setSelected: (BOOL)flag; + +- (NSTableViewSelectionHighlightStyle) selectionHighlightStyle; +- (void) setSelectionHighlightStyle: (NSTableViewSelectionHighlightStyle) selectionHighlightStyle; + +- (NSTableViewDraggingDestinationFeedbackStyle) draggingDestinationFeedbackStyle; +- (void) setTableViewDraggingDestinationFeedbackStyle: (NSTableViewDraggingDestinationFeedbackStyle) draggingDestinationFeedbackStyle; + +- (CGFloat) indentationForDropOperation; +- (void) setIndentationForDropOperation: (CGFloat)indentationForDropOperation; + +- (BOOL) targetForDropOperation; +- (void) setTargetForDropOperation: (BOOL)flag; + +- (BOOL) groupRowStyle; +- (void) setGroupRowStyle: (BOOL)flag; + +- (NSInteger) numberOfColumns; + +- (NSColor *) backgroundColor; +- (void) setBackgroundColor: (NSColor *)color; @end diff --git a/Headers/AppKit/NSTableView.h b/Headers/AppKit/NSTableView.h index df7baf539..f8b66a620 100644 --- a/Headers/AppKit/NSTableView.h +++ b/Headers/AppKit/NSTableView.h @@ -102,6 +102,15 @@ typedef enum _NSTableViewRowSizeStyle } NSTableViewRowSizeStyle; #endif +#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) +typedef enum _NSTableViewDraggingDestinationFeedbackStyle +{ + NSTableViewDraggingDestinationFeedbackStyleNone = 0, + NSTableViewDraggingDestinationFeedbackStyleRegular, + NSTableViewDraggingDestinationFeedbackStyleSourceList, + NSTableViewDraggingDestinationFeedbackStyleGap, +} NSTableViewDraggingDestinationFeedbackStyle; +#endif APPKIT_EXPORT_CLASS @interface NSTableView : NSControl diff --git a/Source/NSTableRowView.m b/Source/NSTableRowView.m index 1bffbf354..a7c1ab424 100644 --- a/Source/NSTableRowView.m +++ b/Source/NSTableRowView.m @@ -26,5 +26,105 @@ @implementation NSTableRowView +- (BOOL) isEmphasized +{ + return _emphasized; +} + +- (void) setEmphasized: (BOOL)flag +{ + _emphasized = flag; +} + +- (NSBackgroundStyle) interiorBackgroundStyle +{ + return _interiorBackgroundStyle; +} + +- (BOOL) isFloating +{ + return _floating; +} + +- (void) setFloating: (BOOL)flag +{ + _floating = flag; +} + +- (BOOL) isSelected +{ + return _selected; +} + +- (void) setSelected: (BOOL)flag +{ + _selected = flag; +} + +- (NSTableViewSelectionHighlightStyle) selectionHighlightStyle +{ + return _selectionHighlightStyle; +} + +- (void) setSelectionHighlightStyle: (NSTableViewSelectionHighlightStyle) selectionHighlightStyle +{ + _selectionHighlightStyle = selectionHighlightStyle; +} + +- (NSTableViewDraggingDestinationFeedbackStyle) draggingDestinationFeedbackStyle +{ + return _draggingDestinationFeedbackStyle; +} + +- (void) setTableViewDraggingDestinationFeedbackStyle: (NSTableViewDraggingDestinationFeedbackStyle) draggingDestinationFeedbackStyle +{ + _draggingDestinationFeedbackStyle = draggingDestinationFeedbackStyle; +} + +- (CGFloat) indentationForDropOperation +{ + return _indentationForDropOperation; +} + +- (void) setIndentationForDropOperation: (CGFloat)indentationForDropOperation +{ + _indentationForDropOperation = indentationForDropOperation; +} + +- (BOOL) targetForDropOperation +{ + return _targetForDropOperation; +} + +- (void) setTargetForDropOperation: (BOOL)flag +{ + _targetForDropOperation = flag; +} + +- (BOOL) groupRowStyle +{ + return _groupRowStyle; +} + +- (void) setGroupRowStyle: (BOOL)flag +{ + _groupRowStyle = flag; +} + +- (NSInteger) numberOfColumns +{ + return 0; +} + +- (NSColor *) backgroundColor +{ + return _backgroundColor; +} + +- (void) setBackgroundColor: (NSColor *)color +{ + ASSIGN(_backgroundColor, color); +} + @end From dfef9c9e1f02bf7d48111dd127f9df29b41e3838 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Thu, 25 Apr 2024 23:58:21 -0400 Subject: [PATCH 02/48] Finish skeleton --- Headers/AppKit/NSTableRowView.h | 16 ++++++++++++++ Source/NSTableRowView.m | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/Headers/AppKit/NSTableRowView.h b/Headers/AppKit/NSTableRowView.h index 4f580f09f..f3a81bbb7 100644 --- a/Headers/AppKit/NSTableRowView.h +++ b/Headers/AppKit/NSTableRowView.h @@ -89,6 +89,22 @@ extern "C" { - (NSColor *) backgroundColor; - (void) setBackgroundColor: (NSColor *)color; +- (void) drawBackgroundInRect: (NSRect)dirtyRect; + +- (void) drawDraggingDestinationFeedbackInRect: (NSRect)dirtyRect; + +- (void) drawSelectionInRect: (NSRect)dirtyRect; + +- (void) drawSeparatorInRect: (NSRect)dirtyRect; + +- (id) viewAtColumn: (NSInteger)column; + +- (BOOL) isNextRowSelected; +- (void) setNextRowSelected: (BOOL)flag; + +- (BOOL) isPreviousRowSelected; +- (void) setPreviousRowSelected: (BOOL)flag; + @end #if defined(__cplusplus) diff --git a/Source/NSTableRowView.m b/Source/NSTableRowView.m index a7c1ab424..7e24107b4 100644 --- a/Source/NSTableRowView.m +++ b/Source/NSTableRowView.m @@ -126,5 +126,44 @@ ASSIGN(_backgroundColor, color); } +- (void) drawBackgroundInRect: (NSRect)dirtyRect +{ +} + +- (void) drawDraggingDestinationFeedbackInRect: (NSRect)dirtyRect +{ +} + +- (void) drawSelectionInRect: (NSRect)dirtyRect +{ +} + +- (void) drawSeparatorInRect: (NSRect)dirtyRect +{ +} + +- (id) viewAtColumn: (NSInteger)column +{ + return nil; +} + +- (BOOL) isNextRowSelected +{ + return NO; +} + +- (void) setNextRowSelected: (BOOL)flag +{ +} + +- (BOOL) isPreviousRowSelected +{ + return NO; +} + +- (void) setPreviousRowSelected: (BOOL)flag +{ +} + @end From 41c7257d4b292497a037fc254b41c6529d199ff7 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Fri, 26 Apr 2024 11:28:43 -0400 Subject: [PATCH 03/48] Add 10.7 methods and add next/prev row selected ivars --- Headers/AppKit/NSTableRowView.h | 3 +++ Headers/AppKit/NSTableView.h | 2 ++ Source/NSTableRowView.m | 6 ++++-- Source/NSTableView.m | 10 ++++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Headers/AppKit/NSTableRowView.h b/Headers/AppKit/NSTableRowView.h index f3a81bbb7..6f8db8649 100644 --- a/Headers/AppKit/NSTableRowView.h +++ b/Headers/AppKit/NSTableRowView.h @@ -56,6 +56,9 @@ extern "C" { // Overriding row view display characteristics... NSColor *_backgroundColor; + + BOOL _nextRowSelected; + BOOL _previousRowSelected; } - (BOOL) isEmphasized; diff --git a/Headers/AppKit/NSTableView.h b/Headers/AppKit/NSTableView.h index f8b66a620..0c17a0ec0 100644 --- a/Headers/AppKit/NSTableView.h +++ b/Headers/AppKit/NSTableView.h @@ -411,6 +411,8 @@ APPKIT_EXPORT_CLASS - (void) removeRowsAtIndexes: (NSIndexSet*)indexes withAnimation: (NSTableViewAnimationOptions)animationOptions; - (NSInteger) rowForView: (NSView*)view; - (NSView *) makeViewWithIdentifier: (NSUserInterfaceItemIdentifier)identifier owner: (id)owner; +- (NSTableRowView *) rowViewAtRow: (NSInteger)row makeIfNecessary: (BOOL)flag; +- (NSView *) viewAtColumn: (NSInteger)column row: (NSInteger)row makeIfNecessary: (BOOL)flag; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_8, GS_API_LATEST) diff --git a/Source/NSTableRowView.m b/Source/NSTableRowView.m index 7e24107b4..c17971ea5 100644 --- a/Source/NSTableRowView.m +++ b/Source/NSTableRowView.m @@ -149,20 +149,22 @@ - (BOOL) isNextRowSelected { - return NO; + return _nextRowSelected; } - (void) setNextRowSelected: (BOOL)flag { + _nextRowSelected = flag; } - (BOOL) isPreviousRowSelected { - return NO; + return _previousRowSelected; } - (void) setPreviousRowSelected: (BOOL)flag { + _previousRowSelected = flag; } @end diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 145c3c37c..ae6a09ae3 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -6940,6 +6940,16 @@ For a more detailed explanation, -setSortDescriptors:. */ return view; } +- (NSTableRowView *) rowViewAtRow: (NSInteger)row makeIfNecessary: (BOOL)flag +{ + return nil; +} + +- (NSView *) viewAtColumn: (NSInteger)column row: (NSInteger)row makeIfNecessary: (BOOL)flag +{ + return nil; +} + - (void) registerNib: (NSNib *)nib forIdentifier: (NSUserInterfaceItemIdentifier)identifier { From d3a0dd23c03c2e5b560aee298503e272170ccbf6 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Fri, 26 Apr 2024 11:40:17 -0400 Subject: [PATCH 04/48] Add 10.7 methods to NSTableView, implement viewAtColumn:row:makeIfnecessary: --- Source/NSTableView.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/NSTableView.m b/Source/NSTableView.m index ae6a09ae3..7e1454a7f 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -6947,7 +6947,10 @@ For a more detailed explanation, -setSortDescriptors:. */ - (NSView *) viewAtColumn: (NSInteger)column row: (NSInteger)row makeIfNecessary: (BOOL)flag { - return nil; + NSIndexPath *path = [NSIndexPath indexPathForItem: row inSection: column]; + NSView *view = [_renderedViewPaths objectForKey: path]; + + return view; } - (void) registerNib: (NSNib *)nib From f7e4b70f544e6e0cc5a49bbc9bb112d6574c45ea Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sat, 27 Apr 2024 09:07:56 -0400 Subject: [PATCH 05/48] Return the NSTableRowView for the current row --- Headers/AppKit/NSTableView.h | 3 +++ Source/NSTableView.m | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Headers/AppKit/NSTableView.h b/Headers/AppKit/NSTableView.h index 0c17a0ec0..cd56b5bbc 100644 --- a/Headers/AppKit/NSTableView.h +++ b/Headers/AppKit/NSTableView.h @@ -204,6 +204,9 @@ APPKIT_EXPORT_CLASS NSMapTable *_pathsToViews; NSMutableDictionary *_registeredNibs; NSMutableDictionary *_registeredViews; + + /* NSTableRowView support */ + NSMutableArray *_rowViews; } /* Data Source */ diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 7e1454a7f..5c3726f15 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -60,6 +60,7 @@ #import "AppKit/NSScrollView.h" #import "AppKit/NSTableColumn.h" #import "AppKit/NSTableHeaderView.h" +#import "AppKit/NSTableRowView.h" #import "AppKit/NSText.h" #import "AppKit/NSTextFieldCell.h" #import "AppKit/NSWindow.h" @@ -2052,6 +2053,7 @@ static void computeNewSelection _pathsToViews = RETAIN([NSMapTable weakToStrongObjectsMapTable]); _registeredNibs = [[NSMutableDictionary alloc] init]; _registeredViews = [[NSMutableDictionary alloc] init]; + _rowViews = [[NSMutableArray alloc] init]; } - (id) initWithFrame: (NSRect)frameRect @@ -2087,6 +2089,7 @@ static void computeNewSelection RELEASE (_pathsToViews); RELEASE (_registeredNibs); RELEASE (_registeredViews); + RELEASE (_rowViews); TEST_RELEASE (_headerView); TEST_RELEASE (_cornerView); if (_autosaveTableColumns == YES) @@ -6942,7 +6945,17 @@ For a more detailed explanation, -setSortDescriptors:. */ - (NSTableRowView *) rowViewAtRow: (NSInteger)row makeIfNecessary: (BOOL)flag { - return nil; + NSTableRowView *rv = [_rowViews objectAtIndex: row]; + + if (rv == nil) + { + if (flag == YES) + { + rv = [[NSTableRowView alloc] init]; + } + } + + return rv; } - (NSView *) viewAtColumn: (NSInteger)column row: (NSInteger)row makeIfNecessary: (BOOL)flag From 77ce97c266b97a26024603cac15e94921df146da Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sun, 28 Apr 2024 07:17:43 -0400 Subject: [PATCH 06/48] Update to use NSTableRowView --- Source/GSThemeDrawing.m | 8 +++++-- Source/NSTableView.m | 48 ++++++++++++++++++++++++++++++++++------- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index a87fe7458..2ebf0f855 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -3698,6 +3698,7 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; /* Draw the row between startingColumn and endingColumn */ for (i = startingColumn; i <= endingColumn; i++) { + id rv = [v rowViewAtRow: rowIndex makeIfNecessary: YES]; NSRect drawingRect = [v frameOfCellAtColumn: i row: rowIndex]; NSTableColumn *tb = [tableColumns objectAtIndex: i]; @@ -3753,10 +3754,13 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; // Store the object... [v _setRenderedView: view forPath: path]; - [v addSubview: view]; + [v addSubview: rv]; + [rv addSubview: view]; // Place the view... - [view setFrame: drawingRect]; + NSRect newRect = drawingRect; + newRect.origin.y = 0.0; + [view setFrame: newRect]; } } diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 5c3726f15..8572f13c7 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -2374,6 +2374,7 @@ static void computeNewSelection { [_renderedViewPaths removeAllObjects]; [_pathsToViews removeAllObjects]; + [_rowViews removeAllObjects]; } [self noteNumberOfRowsChanged]; @@ -6922,13 +6923,13 @@ For a more detailed explanation, -setSortDescriptors:. */ if (loaded) { NSEnumerator *en = [tlo objectEnumerator]; - id o = nil; + id v = nil; - while ((o = [en nextObject]) != nil) + while ((v = [en nextObject]) != nil) { - if ([o isKindOfClass: [NSView class]]) + if ([v isKindOfClass: [NSView class]]) { - view = o; + view = v; break; } } @@ -6945,13 +6946,44 @@ For a more detailed explanation, -setSortDescriptors:. */ - (NSTableRowView *) rowViewAtRow: (NSInteger)row makeIfNecessary: (BOOL)flag { - NSTableRowView *rv = [_rowViews objectAtIndex: row]; + NSTableRowView *rv = nil; - if (rv == nil) + if (_viewBased == YES) { - if (flag == YES) + // NSLog(@"_rowViews = %@", _rowViews); + if (row < [_rowViews count]) { - rv = [[NSTableRowView alloc] init]; + rv = [_rowViews objectAtIndex: row]; + } + + if (rv == nil) + { + if (flag == YES) + { + if ([_delegate respondsToSelector: @selector(tableView:rowViewForRow:)]) + { + rv = [_delegate tableView: self rowViewForRow: row]; + } + } + + if (rv == nil) + { + rv = [[NSTableRowView alloc] init]; + } + + NSRect cellFrame = [self frameOfCellAtColumn: 0 row: row]; + + CGFloat x = 0.0; // cellFrame.origin.x; + CGFloat y = cellFrame.origin.y; + CGFloat w = [self frame].size.width; + CGFloat h = [self rowHeight]; + + NSRect rvFrame = NSMakeRect(x, y, w, h); + NSAutoresizingMaskOptions options = NSViewWidthSizable | NSViewMinYMargin; + + [rv setAutoresizingMask: options]; + [rv setFrame: rvFrame]; + [_rowViews addObject: rv]; } } From 4d5957eaf729429de396865247ea77dd2012cb3a Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sun, 28 Apr 2024 09:49:19 -0400 Subject: [PATCH 07/48] Fully refactor delegate calls into NSTableView/NSOutlineView and move outlineColumn drawing to a public method --- Headers/Additions/GNUstepGUI/GSTheme.h | 7 + Source/GSThemeDrawing.m | 233 ++++++++----------------- Source/NSOutlineView.m | 51 +++++- Source/NSTableView.m | 51 ++++++ 4 files changed, 182 insertions(+), 160 deletions(-) diff --git a/Headers/Additions/GNUstepGUI/GSTheme.h b/Headers/Additions/GNUstepGUI/GSTheme.h index 455d9dced..db81e124b 100644 --- a/Headers/Additions/GNUstepGUI/GSTheme.h +++ b/Headers/Additions/GNUstepGUI/GSTheme.h @@ -253,6 +253,7 @@ @class NSPopUpButtonCell; @class NSMenuView; @class NSProgressIndicator; +@class NSTableColumn; @class NSTableHeaderCell; @class NSTableView; @class NSTabViewItem; @@ -1341,6 +1342,12 @@ APPKIT_EXPORT_CLASS clipRect: (NSRect)clipRect inView: (NSTableView *)view; +- (NSRect) drawOutlineTableColumn: (NSTableColumn *)tb + outlineView: (NSOutlineView *)outlineView + item: (id)item + drawingRect: (NSRect)inputRect + rowIndex: (NSInteger)rowIndex; + - (void) drawCellViewRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect inView: (NSTableView *)v; diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index 2ebf0f855..a5e9e054a 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -84,10 +84,8 @@ row: (NSInteger)index; - (NSView *) _renderedViewForPath: (NSIndexPath *)path; - (void) _setRenderedView: (NSView *)view forPath: (NSIndexPath *)path; -@end - -@interface NSTableColumn (Private) -- (NSArray *) _prototypeCellViews; +- (NSView *) _delegateInvocationForRowIndex: (NSInteger)rowIndex + inColumn: (NSInteger)columnIndex; @end @interface NSCell (Private) @@ -3495,71 +3493,6 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; } } -- (NSRect) _drawOutlineTableColumn: (NSTableColumn *)tb - outlineView: (NSOutlineView *)outlineView - item: (id)item - drawingRect: (NSRect)inputRect - rowIndex: (NSInteger)rowIndex -{ - NSRect drawingRect = inputRect; - NSImage *image = nil; - NSInteger level = 0; - CGFloat indentationFactor = 0.0; - CGFloat indentationPerLevel = [outlineView indentationPerLevel]; - NSCell *imageCell = nil; - NSRect imageRect; - id delegate = [outlineView delegate]; - - // display the correct arrow... - if ([outlineView isItemExpanded: item]) - { - image = [NSImage imageNamed: @"common_ArrowDownH"]; - } - else - { - image = [NSImage imageNamed: @"common_ArrowRightH"]; - } - - if (![outlineView isExpandable: item]) - { - image = AUTORELEASE([[NSImage alloc] initWithSize: NSMakeSize(14.0,14.0)]); - } - - level = [outlineView levelForItem: item]; - indentationFactor = indentationPerLevel * level; - imageCell = [[NSCell alloc] initImageCell: image]; - imageRect = [outlineView frameOfOutlineCellAtRow: rowIndex]; - - if ([delegate respondsToSelector: @selector(outlineView:willDisplayOutlineCell:forTableColumn:item:)]) - { - [delegate outlineView: outlineView - willDisplayOutlineCell: imageCell - forTableColumn: tb - item: item]; - } - - /* Do not indent if the delegate set the image to nil. */ - if ([imageCell image]) - { - imageRect.size.width = [image size].width; - imageRect.size.height = [image size].height + 5; - [imageCell drawWithFrame: imageRect inView: outlineView]; - drawingRect.origin.x - += indentationFactor + imageRect.size.width + 5; - drawingRect.size.width - -= indentationFactor + imageRect.size.width + 5; - } - else - { - drawingRect.origin.x += indentationFactor; - drawingRect.size.width -= indentationFactor; - } - - RELEASE(imageCell); - - return drawingRect; -} - - (void) drawOutlineViewRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect inView: (NSOutlineView *)outlineView @@ -3620,11 +3553,11 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; if (tb == outlineTableColumn) { - drawingRect = [self _drawOutlineTableColumn: tb - outlineView: outlineView - item: item - drawingRect: drawingRect - rowIndex: rowIndex]; + drawingRect = [self drawOutlineTableColumn: tb + outlineView: outlineView + item: item + drawingRect: drawingRect + rowIndex: rowIndex]; } [cell drawWithFrame: drawingRect inView: outlineView]; @@ -3636,35 +3569,80 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; } } -- (id) _prototypeCellViewFromTableColumn: (NSTableColumn *)tb +- (NSRect) drawOutlineTableColumn: (NSTableColumn *)tb + outlineView: (NSOutlineView *)outlineView + item: (id)item + drawingRect: (NSRect)inputRect + rowIndex: (NSInteger)rowIndex { - NSArray *protoCellViews = [tb _prototypeCellViews]; - id view = nil; - - // it seems there is always one prototype... - if ([protoCellViews count] > 0) - { - view = [protoCellViews objectAtIndex: 0]; - view = [view copy]; // instantiate the prototype... - } + NSRect drawingRect = inputRect; + NSImage *image = nil; + NSInteger level = 0; + CGFloat indentationFactor = 0.0; + CGFloat indentationPerLevel = [outlineView indentationPerLevel]; + NSCell *imageCell = nil; + NSRect imageRect; + id delegate = [outlineView delegate]; - return view; + // display the correct arrow... + if ([outlineView isItemExpanded: item]) + { + image = [NSImage imageNamed: @"common_ArrowDownH"]; + } + else + { + image = [NSImage imageNamed: @"common_ArrowRightH"]; + } + + if (![outlineView isExpandable: item]) + { + image = AUTORELEASE([[NSImage alloc] initWithSize: NSMakeSize(14.0,14.0)]); + } + + level = [outlineView levelForItem: item]; + indentationFactor = indentationPerLevel * level; + imageCell = [[NSCell alloc] initImageCell: image]; + imageRect = [outlineView frameOfOutlineCellAtRow: rowIndex]; + + if ([delegate respondsToSelector: @selector(outlineView:willDisplayOutlineCell:forTableColumn:item:)]) + { + [delegate outlineView: outlineView + willDisplayOutlineCell: imageCell + forTableColumn: tb + item: item]; + } + + /* Do not indent if the delegate set the image to nil. */ + if ([imageCell image]) + { + imageRect.size.width = [image size].width; + imageRect.size.height = [image size].height + 5; + [imageCell drawWithFrame: imageRect inView: outlineView]; + drawingRect.origin.x + += indentationFactor + imageRect.size.width + 5; + drawingRect.size.width + -= indentationFactor + imageRect.size.width + 5; + } + else + { + drawingRect.origin.x += indentationFactor; + drawingRect.size.width -= indentationFactor; + } + + RELEASE(imageCell); + + return drawingRect; } - (void) drawCellViewRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect inView: (NSTableView *)v { - NSArray *tableColumns = [v tableColumns]; NSInteger numberOfRows = [v numberOfRows]; NSInteger startingColumn; NSInteger endingColumn; - NSInteger i; + NSInteger columnIndex; id dataSource = [v dataSource]; - id delegate = [v delegate]; - BOOL hasMethod = NO; - NSTableColumn *outlineTableColumn = nil; - NSOutlineView *ov = nil; // If we have no data source, there is nothing to do... if (dataSource == nil) @@ -3678,87 +3656,24 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; return; } - // Check the delegate method... - hasMethod = [delegate respondsToSelector: @selector(outlineView:viewForTableColumn:item:)]; - if (hasMethod) - { - ov = (NSOutlineView *)v; - outlineTableColumn = [ov outlineTableColumn]; - } - else - { - hasMethod = [delegate respondsToSelector: @selector(tableView:viewForTableColumn:row:)]; - } - [self _calculatedStartingColumn: &startingColumn endingColumn: &endingColumn withTableView: v inClipRect: clipRect]; /* Draw the row between startingColumn and endingColumn */ - for (i = startingColumn; i <= endingColumn; i++) + for (columnIndex = startingColumn; columnIndex <= endingColumn; columnIndex++) { - id rv = [v rowViewAtRow: rowIndex makeIfNecessary: YES]; - NSRect drawingRect = [v frameOfCellAtColumn: i - row: rowIndex]; - NSTableColumn *tb = [tableColumns objectAtIndex: i]; - NSIndexPath *path = [NSIndexPath indexPathForItem: i - inSection: rowIndex]; - NSView *view = [v _renderedViewForPath: path]; - - if (ov != nil) - { - id item = [ov itemAtRow: rowIndex]; - - if (tb == outlineTableColumn) - { - drawingRect = [self _drawOutlineTableColumn: tb - outlineView: ov - item: item - drawingRect: drawingRect - rowIndex: rowIndex]; - } - - if (view == nil) - { - if (hasMethod) - { - view = [delegate outlineView: ov - viewForTableColumn: tb - item: item]; - } - else - { - view = [self _prototypeCellViewFromTableColumn: tb]; - } - } - } - else - { - // If the view has been stored use it, if not - // then grab it. - if (view == nil) - { - if (hasMethod) - { - view = [delegate tableView: v - viewForTableColumn: tb - row: rowIndex]; - } - else - { - view = [self _prototypeCellViewFromTableColumn: tb]; - } - } - } + id rv = [v rowViewAtRow: rowIndex makeIfNecessary: YES]; + NSView *view = [v _delegateInvocationForRowIndex: rowIndex + inColumn: columnIndex]; // Store the object... - [v _setRenderedView: view forPath: path]; [v addSubview: rv]; [rv addSubview: view]; // Place the view... - NSRect newRect = drawingRect; + NSRect newRect = [view frame]; newRect.origin.y = 0.0; [view setFrame: newRect]; } diff --git a/Source/NSOutlineView.m b/Source/NSOutlineView.m index 37d11e6cf..37da88405 100644 --- a/Source/NSOutlineView.m +++ b/Source/NSOutlineView.m @@ -131,10 +131,18 @@ static NSImage *unexpandable = nil; - (void) _noteNumberOfRowsChangedBelowItem: (id)item by: (NSInteger)n; @end -@interface NSOutlineView (Private) +@interface NSOutlineView (Private) +- (NSView *) _delegateInvocationForRowIndex: (NSInteger)rowIndex + inColumn: (NSInteger)columnIndex; - (void) _autoCollapse; @end +@interface NSTableView (Private) +- (NSView *) _renderedViewForPath: (NSIndexPath *)path; +- (void) _setRenderedView: (NSView *)view forPath: (NSIndexPath *)path; +- (id) _prototypeCellViewFromTableColumn: (NSTableColumn *)tb; +@end + @implementation NSOutlineView // Initialize the class when it is loaded @@ -2219,4 +2227,45 @@ Also returns the child index relative to this parent. */ } [autoExpanded removeAllObjects]; } + +- (NSView *) _delegateInvocationForRowIndex: (NSInteger)rowIndex + inColumn: (NSInteger)columnIndex +{ + NSTableColumn *tb = [_tableColumns objectAtIndex: columnIndex]; + NSIndexPath *path = [NSIndexPath indexPathForItem: columnIndex + inSection: rowIndex]; + NSView *view = [self _renderedViewForPath: path]; + NSRect drawingRect = [self frameOfCellAtColumn: columnIndex + row: rowIndex]; + id item = [self itemAtRow: rowIndex]; + + if (tb == _outlineTableColumn) + { + drawingRect = [[GSTheme theme] drawOutlineTableColumn: tb + outlineView: self + item: item + drawingRect: drawingRect + rowIndex: rowIndex]; + } + + if (view == nil) + { + if ([_delegate respondsToSelector: @selector(outlineView:viewForTableColumn:item:)]) + { + view = [_delegate outlineView: self + viewForTableColumn: tb + item: item]; + } + else + { + view = [self _prototypeCellViewFromTableColumn: tb]; + } + } + + [view setFrame: drawingRect]; + [self _setRenderedView: view forPath: path]; + + return view; +} + @end diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 8572f13c7..13968e2a9 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -180,6 +180,10 @@ typedef struct _tableViewFlags - (BOOL) _startDragOperationWithEvent:(NSEvent *)theEvent; @end +@interface NSTableColumn (Private) +- (NSArray *) _prototypeCellViews; +@end + /* * A specific struct and its associated quick sort function * This is used by the -sizeToFit method @@ -6944,6 +6948,53 @@ For a more detailed explanation, -setSortDescriptors:. */ return view; } +- (id) _prototypeCellViewFromTableColumn: (NSTableColumn *)tb +{ + NSArray *protoCellViews = [tb _prototypeCellViews]; + id view = nil; + + // it seems there is always one prototype... + if ([protoCellViews count] > 0) + { + view = [protoCellViews objectAtIndex: 0]; + view = [view copy]; // instantiate the prototype... + } + + return view; +} + +- (NSView *) _delegateInvocationForRowIndex: (NSInteger)rowIndex + inColumn: (NSInteger)columnIndex +{ + NSTableColumn *tb = [_tableColumns objectAtIndex: columnIndex]; + NSIndexPath *path = [NSIndexPath indexPathForItem: columnIndex + inSection: rowIndex]; + NSView *view = [self _renderedViewForPath: path]; + NSRect drawingRect = [self frameOfCellAtColumn: columnIndex + row: rowIndex]; + + // If the view has been stored use it, if not + // then grab it. + if (view == nil) + { + if ([_delegate respondsToSelector: @selector(tableView:viewForTableColumn:row:)]) + { + view = [_delegate tableView: self + viewForTableColumn: tb + row: rowIndex]; + } + else + { + view = [self _prototypeCellViewFromTableColumn: tb]; + } + } + + [view setFrame: drawingRect]; + [self _setRenderedView: view forPath: path]; + + return view; +} + - (NSTableRowView *) rowViewAtRow: (NSInteger)row makeIfNecessary: (BOOL)flag { NSTableRowView *rv = nil; From 9070a9d30f54a848c3e381e7d2a8b47543f82ace Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sun, 28 Apr 2024 15:04:29 -0400 Subject: [PATCH 08/48] Move view rendering to viewAtColumn:row:makeIfNecessary: and eliminate uneeded private method --- Source/GSThemeDrawing.m | 7 +--- Source/NSOutlineView.m | 82 ++++++++++++++++++++--------------------- Source/NSTableView.m | 60 +++++++++++++----------------- 3 files changed, 67 insertions(+), 82 deletions(-) diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index a5e9e054a..8e1304851 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -82,10 +82,6 @@ row: (NSInteger)index; - (id)_objectValueForTableColumn: (NSTableColumn *)tb row: (NSInteger)index; -- (NSView *) _renderedViewForPath: (NSIndexPath *)path; -- (void) _setRenderedView: (NSView *)view forPath: (NSIndexPath *)path; -- (NSView *) _delegateInvocationForRowIndex: (NSInteger)rowIndex - inColumn: (NSInteger)columnIndex; @end @interface NSCell (Private) @@ -3665,8 +3661,7 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; for (columnIndex = startingColumn; columnIndex <= endingColumn; columnIndex++) { id rv = [v rowViewAtRow: rowIndex makeIfNecessary: YES]; - NSView *view = [v _delegateInvocationForRowIndex: rowIndex - inColumn: columnIndex]; + NSView *view = [v viewAtColumn: columnIndex row: rowIndex makeIfNecessary: YES]; // Store the object... [v addSubview: rv]; diff --git a/Source/NSOutlineView.m b/Source/NSOutlineView.m index 37da88405..794d309b9 100644 --- a/Source/NSOutlineView.m +++ b/Source/NSOutlineView.m @@ -132,8 +132,6 @@ static NSImage *unexpandable = nil; @end @interface NSOutlineView (Private) -- (NSView *) _delegateInvocationForRowIndex: (NSInteger)rowIndex - inColumn: (NSInteger)columnIndex; - (void) _autoCollapse; @end @@ -2210,6 +2208,46 @@ Also returns the child index relative to this parent. */ return cell; } +- (NSView *) viewAtColumn: (NSInteger)column row: (NSInteger)row makeIfNecessary: (BOOL)flag +{ + NSTableColumn *tb = [_tableColumns objectAtIndex: column]; + NSIndexPath *path = [NSIndexPath indexPathForItem: column + inSection: row]; + NSView *view = [self _renderedViewForPath: path]; + NSRect drawingRect = [self frameOfCellAtColumn: column + row: row]; + id item = [self itemAtRow: row]; + + if (tb == _outlineTableColumn) + { + drawingRect = [[GSTheme theme] drawOutlineTableColumn: tb + outlineView: self + item: item + drawingRect: drawingRect + rowIndex: row]; + } + + if (view == nil + && flag == YES) + { + if ([_delegate respondsToSelector: @selector(outlineView:viewForTableColumn:item:)]) + { + view = [_delegate outlineView: self + viewForTableColumn: tb + item: item]; + } + else + { + view = [self _prototypeCellViewFromTableColumn: tb]; + } + } + + [view setFrame: drawingRect]; + [self _setRenderedView: view forPath: path]; + + return view; +} + @end @implementation NSOutlineView (Private) @@ -2228,44 +2266,4 @@ Also returns the child index relative to this parent. */ [autoExpanded removeAllObjects]; } -- (NSView *) _delegateInvocationForRowIndex: (NSInteger)rowIndex - inColumn: (NSInteger)columnIndex -{ - NSTableColumn *tb = [_tableColumns objectAtIndex: columnIndex]; - NSIndexPath *path = [NSIndexPath indexPathForItem: columnIndex - inSection: rowIndex]; - NSView *view = [self _renderedViewForPath: path]; - NSRect drawingRect = [self frameOfCellAtColumn: columnIndex - row: rowIndex]; - id item = [self itemAtRow: rowIndex]; - - if (tb == _outlineTableColumn) - { - drawingRect = [[GSTheme theme] drawOutlineTableColumn: tb - outlineView: self - item: item - drawingRect: drawingRect - rowIndex: rowIndex]; - } - - if (view == nil) - { - if ([_delegate respondsToSelector: @selector(outlineView:viewForTableColumn:item:)]) - { - view = [_delegate outlineView: self - viewForTableColumn: tb - item: item]; - } - else - { - view = [self _prototypeCellViewFromTableColumn: tb]; - } - } - - [view setFrame: drawingRect]; - [self _setRenderedView: view forPath: path]; - - return view; -} - @end diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 13968e2a9..070097225 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -6963,38 +6963,6 @@ For a more detailed explanation, -setSortDescriptors:. */ return view; } -- (NSView *) _delegateInvocationForRowIndex: (NSInteger)rowIndex - inColumn: (NSInteger)columnIndex -{ - NSTableColumn *tb = [_tableColumns objectAtIndex: columnIndex]; - NSIndexPath *path = [NSIndexPath indexPathForItem: columnIndex - inSection: rowIndex]; - NSView *view = [self _renderedViewForPath: path]; - NSRect drawingRect = [self frameOfCellAtColumn: columnIndex - row: rowIndex]; - - // If the view has been stored use it, if not - // then grab it. - if (view == nil) - { - if ([_delegate respondsToSelector: @selector(tableView:viewForTableColumn:row:)]) - { - view = [_delegate tableView: self - viewForTableColumn: tb - row: rowIndex]; - } - else - { - view = [self _prototypeCellViewFromTableColumn: tb]; - } - } - - [view setFrame: drawingRect]; - [self _setRenderedView: view forPath: path]; - - return view; -} - - (NSTableRowView *) rowViewAtRow: (NSInteger)row makeIfNecessary: (BOOL)flag { NSTableRowView *rv = nil; @@ -7043,8 +7011,32 @@ For a more detailed explanation, -setSortDescriptors:. */ - (NSView *) viewAtColumn: (NSInteger)column row: (NSInteger)row makeIfNecessary: (BOOL)flag { - NSIndexPath *path = [NSIndexPath indexPathForItem: row inSection: column]; - NSView *view = [_renderedViewPaths objectForKey: path]; + NSTableColumn *tb = [_tableColumns objectAtIndex: column]; + NSIndexPath *path = [NSIndexPath indexPathForItem: column + inSection: row]; + NSView *view = [self _renderedViewForPath: path]; + NSRect drawingRect = [self frameOfCellAtColumn: column + row: row]; + + // If the view has been stored use it, if not + // then grab it. + if (view == nil + && flag == YES) + { + if ([_delegate respondsToSelector: @selector(tableView:viewForTableColumn:row:)]) + { + view = [_delegate tableView: self + viewForTableColumn: tb + row: row]; + } + else + { + view = [self _prototypeCellViewFromTableColumn: tb]; + } + } + + [view setFrame: drawingRect]; + [self _setRenderedView: view forPath: path]; return view; } From b9c5ba35be0cde8ddc5e13c679aa008f5650d38d Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Tue, 30 Apr 2024 04:38:41 -0400 Subject: [PATCH 09/48] Rename variables to be a bit more meaningful --- Source/GSThemeDrawing.m | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index 8e1304851..c30027837 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -3632,13 +3632,13 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; - (void) drawCellViewRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect - inView: (NSTableView *)v + inView: (NSTableView *)tv { - NSInteger numberOfRows = [v numberOfRows]; + NSInteger numberOfRows = [tv numberOfRows]; NSInteger startingColumn; NSInteger endingColumn; NSInteger columnIndex; - id dataSource = [v dataSource]; + id dataSource = [tv dataSource]; // If we have no data source, there is nothing to do... if (dataSource == nil) @@ -3654,18 +3654,18 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; [self _calculatedStartingColumn: &startingColumn endingColumn: &endingColumn - withTableView: v + withTableView: tv inClipRect: clipRect]; /* Draw the row between startingColumn and endingColumn */ for (columnIndex = startingColumn; columnIndex <= endingColumn; columnIndex++) { - id rv = [v rowViewAtRow: rowIndex makeIfNecessary: YES]; - NSView *view = [v viewAtColumn: columnIndex row: rowIndex makeIfNecessary: YES]; + id rowView = [tv rowViewAtRow: rowIndex makeIfNecessary: YES]; + NSView *view = [tv viewAtColumn: columnIndex row: rowIndex makeIfNecessary: YES]; // Store the object... - [v addSubview: rv]; - [rv addSubview: view]; + [tv addSubview: rowView]; + [rowView addSubview: view]; // Place the view... NSRect newRect = [view frame]; From bec2392e33e22068dd540bb0d2e858138b7cc4b4 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Wed, 1 May 2024 19:19:45 -0400 Subject: [PATCH 10/48] Fix to NSTextView issue where it goes into an infinite loop if the event is returned as nil --- Source/NSTextView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 34cbae105..93c9b6e1d 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -5844,7 +5844,7 @@ other than copy/paste or dragging. */ untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; - } while ([currentEvent type] != NSLeftMouseUp); + } while ([currentEvent type] != NSLeftMouseUp && currentEvent != nil); if (gettingPeriodic) { From b7bea0213b7f75f0fad17af0c86b8234134990d5 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Fri, 3 May 2024 10:40:08 -0400 Subject: [PATCH 11/48] Fix issue with view refresh/editability, refactor so that view sizing happens in the correct place --- Source/GSThemeDrawing.m | 57 ++++++++++++++++++++++++++++++----------- Source/NSTableView.m | 13 +--------- 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index c30027837..97f0e430a 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -3632,13 +3632,13 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; - (void) drawCellViewRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect - inView: (NSTableView *)tv + inView: (NSTableView *)tableView { - NSInteger numberOfRows = [tv numberOfRows]; + NSInteger numberOfRows = [tableView numberOfRows]; NSInteger startingColumn; NSInteger endingColumn; NSInteger columnIndex; - id dataSource = [tv dataSource]; + id dataSource = [tableView dataSource]; // If we have no data source, there is nothing to do... if (dataSource == nil) @@ -3654,23 +3654,50 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; [self _calculatedStartingColumn: &startingColumn endingColumn: &endingColumn - withTableView: tv + withTableView: tableView inClipRect: clipRect]; /* Draw the row between startingColumn and endingColumn */ for (columnIndex = startingColumn; columnIndex <= endingColumn; columnIndex++) { - id rowView = [tv rowViewAtRow: rowIndex makeIfNecessary: YES]; - NSView *view = [tv viewAtColumn: columnIndex row: rowIndex makeIfNecessary: YES]; - - // Store the object... - [tv addSubview: rowView]; - [rowView addSubview: view]; - - // Place the view... - NSRect newRect = [view frame]; - newRect.origin.y = 0.0; - [view setFrame: newRect]; + id rowView = [tableView rowViewAtRow: rowIndex + makeIfNecessary: YES]; + NSView *view = [tableView viewAtColumn: columnIndex + row: rowIndex + makeIfNecessary: YES]; + + // If the view is already part of the table, don't re-add it... + if ([[tableView subviews] containsObject: rowView] == NO + && rowView != nil) + { + NSRect cellFrame = [tableView frameOfCellAtColumn: 0 + row: rowIndex]; + CGFloat x = 0.0; + CGFloat y = cellFrame.origin.y; + CGFloat w = [tableView frame].size.width; + CGFloat h = [tableView rowHeight]; + + NSRect rvFrame = NSMakeRect(x, y, w, h); + NSAutoresizingMaskOptions options = NSViewWidthSizable + | NSViewMinYMargin; + + [tableView addSubview: rowView]; + [rowView setAutoresizingMask: options]; + [rowView setFrame: rvFrame]; + } + + // Create the view if needed... + if ([[rowView subviews] containsObject: view] == NO + && view != nil) + { + // Add the view to the row... + [rowView addSubview: view]; + + // Place the view... + NSRect newRect = [view frame]; + newRect.origin.y = 0.0; + [view setFrame: newRect]; + } } } diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 070097225..ed87441a1 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -6990,18 +6990,6 @@ For a more detailed explanation, -setSortDescriptors:. */ rv = [[NSTableRowView alloc] init]; } - NSRect cellFrame = [self frameOfCellAtColumn: 0 row: row]; - - CGFloat x = 0.0; // cellFrame.origin.x; - CGFloat y = cellFrame.origin.y; - CGFloat w = [self frame].size.width; - CGFloat h = [self rowHeight]; - - NSRect rvFrame = NSMakeRect(x, y, w, h); - NSAutoresizingMaskOptions options = NSViewWidthSizable | NSViewMinYMargin; - - [rv setAutoresizingMask: options]; - [rv setFrame: rvFrame]; [_rowViews addObject: rv]; } } @@ -7035,6 +7023,7 @@ For a more detailed explanation, -setSortDescriptors:. */ } } + // [view setPostsFrameChangedNotifications: NO]; [view setFrame: drawingRect]; [self _setRenderedView: view forPath: path]; From bd4e093bad6dd3102de616072fe223c22725f586 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Fri, 3 May 2024 13:52:23 -0400 Subject: [PATCH 12/48] Add NSMenuToolbarItem skeleton --- Headers/AppKit/AppKit.h | 1 + Headers/AppKit/NSMenuToolbarItem.h | 65 ++++++++++++++++++++++++++++ MISSING | 1 - Source/GNUmakefile | 2 + Source/NSMenuToolbarItem.m | 68 ++++++++++++++++++++++++++++++ 5 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 Headers/AppKit/NSMenuToolbarItem.h create mode 100644 Source/NSMenuToolbarItem.m diff --git a/Headers/AppKit/AppKit.h b/Headers/AppKit/AppKit.h index 8395122e1..8dd97ae55 100644 --- a/Headers/AppKit/AppKit.h +++ b/Headers/AppKit/AppKit.h @@ -101,6 +101,7 @@ #import #import #import +#import #import #import #import diff --git a/Headers/AppKit/NSMenuToolbarItem.h b/Headers/AppKit/NSMenuToolbarItem.h new file mode 100644 index 000000000..80b4ffbe3 --- /dev/null +++ b/Headers/AppKit/NSMenuToolbarItem.h @@ -0,0 +1,65 @@ +/* Definition of class NSMenuToolbarItem + Copyright (C) 2024 Free Software Foundation, Inc. + + By: Gregory John Casamento + Date: 03-05-2024 + + This file is part of the GNUstep Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110 USA. +*/ + +#ifndef _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE +#define _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE + +#import +#import + +#if OS_API_VERSION(MAC_OS_X_VERSION_10_15, GS_API_LATEST) + +#if defined(__cplusplus) +extern "C" { +#endif + +@class NSMenu; + +APPKIT_EXPORT_CLASS +@interface NSMenuToolbarItem : NSToolbarItem +{ + BOOL _showsIndicator; + NSMenu *_menu; + NSMenu *_itemMenu; +} + +- (BOOL) showsIndicator; +- (void) setShowsIndicator: (BOOL)flag; + +- (NSMenu *) menu; +- (void) setMenu: (NSMenu *)menu; + +- (NSMenu *) itemMenu; +- (void) setItemMenu: (NSMenu *)itemMenu; + +@end + +#if defined(__cplusplus) +} +#endif + +#endif /* GS_API_MACOSX */ + +#endif /* _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE */ + diff --git a/MISSING b/MISSING index ec97238bf..536d32859 100644 --- a/MISSING +++ b/MISSING @@ -7,7 +7,6 @@ MISSING HEADERS ( * = difficult, - = quick, + = placeholder, x = won't do ) > NSFilePromiseProvider.h - > NSFilePromiseReceiver.h - > NSItemProvider.h + -> NSMenuToolbarItem.h - > NSOpenGLLayer.h + > NSTypesetter.h + > NSUserActivity.h - diff --git a/Source/GNUmakefile b/Source/GNUmakefile index 5e1409a10..f6ae04d33 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -180,6 +180,7 @@ NSStoryboardSegue.m \ NSMagnificationGestureRecognizer.m \ NSMatrix.m \ NSMenu.m \ +NSMenuToolbarItem.m \ NSMenuView.m \ NSMenuItem.m \ NSMenuItemCell.m \ @@ -496,6 +497,7 @@ NSMediaLibraryBrowserController.h \ NSMenu.h \ NSMenuItem.h \ NSMenuItemCell.h \ +NSMenuToolbarItem.h \ NSMenuView.h \ NSMovie.h \ NSMovieView.h \ diff --git a/Source/NSMenuToolbarItem.m b/Source/NSMenuToolbarItem.m new file mode 100644 index 000000000..0f664abc4 --- /dev/null +++ b/Source/NSMenuToolbarItem.m @@ -0,0 +1,68 @@ +/* Implementation of class NSMenuToolbarItem + Copyright (C) 2024 Free Software Foundation, Inc. + + By: Gregory John Casamento + Date: 03-05-2024 + + This file is part of the GNUstep Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110 USA. +*/ + +#import "AppKit/NSMenuToolbarItem.h" +#import "AppKit/NSMenu.h" + +@implementation NSMenuToolbarItem + +- (void) dealloc +{ + RELEASE(_menu); + RELEASE(_itemMenu); + [super dealloc]; +} + +- (BOOL) showsIndicator +{ + return _showsIndicator; +} + +- (void) setShowsIndicator: (BOOL)flag +{ + _showsIndicator = flag; +} + +- (NSMenu *) menu +{ + return _menu; +} + +- (void) setMenu: (NSMenu *)menu +{ + ASSIGN(_menu, menu); +} + +- (NSMenu *) itemMenu +{ + return _itemMenu; +} + +- (void) setItemMenu: (NSMenu *)itemMenu +{ + ASSIGN(_itemMenu, itemMenu); +} + +@end + From 842b0d80143419cead9d63db70424e26dbe6dcd3 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Fri, 3 May 2024 14:02:46 -0400 Subject: [PATCH 13/48] Update changelog --- ChangeLog | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index b93166b0b..eacf427cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2024-05-03 Gregory John Casamento + + * Headers/Additions/GNUstepGUI/GSTheme.h: Add new methods + for rendering view-based outline/table views. + * Headers/AppKit/NSTableRowView.h: Add implementation + * Headers/AppKit/NSTableView.h: Add references to + NSTableRowView.h + * Source/GSThemeDrawing.m: Factor out NSTableView and + NSOutlineView rendering so that GSThemeDrawing methods + are as minimal as possible. + * Source/NSOutlineView.m: Refactor to use new methods + to generate NSTableRowView when it is view-based. + * Source/NSTableRowView.m: Add implementation of + NSTableRowView implementation. + * Source/NSTableView.m: Update to use NSTableRowView + when it is view-based. + 2024-03-18 Fred Kiefer * Source/NSTextView.m: Add support for NSFilenamenPboardType. From 5ab876828327cf1e509a339c6c82a73d8ab9ece8 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Fri, 3 May 2024 16:28:24 -0400 Subject: [PATCH 14/48] Add code to show image for NSMenuToolbarItem --- Headers/AppKit/NSMenuToolbarItem.h | 4 ---- Source/NSMenuToolbarItem.m | 32 ++++++++++++++++++++++-------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/Headers/AppKit/NSMenuToolbarItem.h b/Headers/AppKit/NSMenuToolbarItem.h index 80b4ffbe3..f1a0b2aa4 100644 --- a/Headers/AppKit/NSMenuToolbarItem.h +++ b/Headers/AppKit/NSMenuToolbarItem.h @@ -41,7 +41,6 @@ APPKIT_EXPORT_CLASS { BOOL _showsIndicator; NSMenu *_menu; - NSMenu *_itemMenu; } - (BOOL) showsIndicator; @@ -49,9 +48,6 @@ APPKIT_EXPORT_CLASS - (NSMenu *) menu; - (void) setMenu: (NSMenu *)menu; - -- (NSMenu *) itemMenu; -- (void) setItemMenu: (NSMenu *)itemMenu; @end diff --git a/Source/NSMenuToolbarItem.m b/Source/NSMenuToolbarItem.m index 0f664abc4..b9771e587 100644 --- a/Source/NSMenuToolbarItem.m +++ b/Source/NSMenuToolbarItem.m @@ -24,13 +24,25 @@ #import "AppKit/NSMenuToolbarItem.h" #import "AppKit/NSMenu.h" +#import "AppKit/NSImage.h" @implementation NSMenuToolbarItem +- (instancetype) initWithItemIdentifier: (NSString *)identifier +{ + self = [super initWithItemIdentifier: identifier]; + if (self != nil) + { + [self setImage: [NSImage imageNamed: @"common_ArrowDown"]]; + [self setTarget: self]; + [self setAction: @selector(_showMenu:)]; + } + return self; +} + - (void) dealloc { RELEASE(_menu); - RELEASE(_itemMenu); [super dealloc]; } @@ -42,6 +54,15 @@ - (void) setShowsIndicator: (BOOL)flag { _showsIndicator = flag; + + if (_showsIndicator == YES) + { + [self setImage: [NSImage imageNamed: @"common_ArrowDown"]]; + } + else + { + [self setImage: nil]; + } } - (NSMenu *) menu @@ -54,14 +75,9 @@ ASSIGN(_menu, menu); } -- (NSMenu *) itemMenu +- (void) _showMenu: (id)sender { - return _itemMenu; -} - -- (void) setItemMenu: (NSMenu *)itemMenu -{ - ASSIGN(_itemMenu, itemMenu); + NSLog(@"menu = %@", _menu); } @end From 61ff6962dfe2f630bbfc527d7b0c5e6bab8d5439 Mon Sep 17 00:00:00 2001 From: Gregory Casamento Date: Sat, 4 May 2024 06:21:28 -0400 Subject: [PATCH 15/48] Add common_MenuToolbarItem.tiff and corresponding mapping --- Images/GNUmakefile | 1 + Images/common_MenuToolbarItem.tiff | Bin 0 -> 3626 bytes Images/nsmapping.strings | 3 ++- 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Images/common_MenuToolbarItem.tiff diff --git a/Images/GNUmakefile b/Images/GNUmakefile index aa6b6cc18..cf32413b0 100644 --- a/Images/GNUmakefile +++ b/Images/GNUmakefile @@ -90,6 +90,7 @@ Images_RESOURCE_FILES = \ common_Info.tiff\ common_LeftTabStop.tiff \ common_LibraryFolder.tiff \ + common_MenuToolbarItem.tiff \ common_MiniWindowTile.tiff \ common_Miniaturize.tiff \ common_MiniaturizeH.tiff \ diff --git a/Images/common_MenuToolbarItem.tiff b/Images/common_MenuToolbarItem.tiff new file mode 100644 index 0000000000000000000000000000000000000000..a7c904ed051f1ffd50c83120264d99539b76ef37 GIT binary patch literal 3626 zcmbW32UJtp7KYEg=^>#dgbtxMsZs(+?*h_02r&r|O281RSWrX-?1)IQAfr+QN2RK$ zh+<(-P{BT+BB1EtC`EDf-Ka}>Z>^d4);o8tv%b5}f6m@#?|rl4?G1DRfWSIH_hqQl z$hdq*rf(bDTv2SZ^9nykO|ZUnu`A23?Rkcc@(y>lzomMqw^qqgj(lHg zW-!^Ja#>tJ`}3LAb_adq1FbY@Tit5>xq%%V^D3WXfeAs3SD*1J4M2YS1nI)Y=(SA^ zzJ;&-U4rul(Pnket2-S}+#8;WFs<%~nMA;qJHk&9--!3`4}`=be2_ISE-wWZ2Oyaz;QPBd(nG_->9{@s z0|LMTV*r?}v{df^*FfQR4;LqT8X^+%&oMLj^=9CXRzmy?O`9fZ}B(v!Ie&ml}r<}lL$K$C=a0f!ZjFj5gf;s^RWA-n`h zA}MYGuUNnWP8Jd;08S~X*?ewXynwFF(xDq$S~BSFoXjMSK%no-WF<2BY`RlQaw?OT z4ZycM3wHrYVQ%S2lFf}R&CT^q43PBy82`BVL-o%ftnD|&JHM|rgJ``!Z9n(^w53!7 zz?epIv*V|2#XbO9Hv%B@;HORfAOK?d0JPj(a37kmU*ZLVR4YTn%*;#!E{A0xOz4mC zUj;vue-8`%83_IT$Q|986U$6b63~T7Wu+vgr1R-%sZ17!uK%A+{C{s;5Y~b?7Ws2x zIeZQeaTSbo8J8D_l$*!q3b-jeI+yo%75+cBEr>yg-})K>O3i0LjWz({H>m*ix)-1+ zA^;V+A6bEZ)Xj?!41`}^i1OICzDF2Y|2qHM1aC)P;WTa>U1)al52Ulw`58h+z6s%k z0Yo4Ms6ZAd0X3iv^nnSm0M@`BxPYa=2LysJupF>JJV*w7kO^`@9w-1sU_d$Hb6ztE~p$j1l2;nLhaB+=o-`y-G@e?3FuGgBaDJcFcnsWHDN=T z0Xx8+a3CB7$H6P%95^4|2A9Fra0A=|UxaVKcj0096+Dgn$cvz8C>4}Gih*)M`Jlp4 zu_!)j4XO}TimFC6qB>ALsN1Mv)FkQy8jGf&>1chlHQF5=gl3^vqSv5{(dFo4=oWN0 z`Zjt5J%#>^A!8IUdKfE=2PPB~hsnegU`jDZFwL0Dn7f!!%nTNbrD3(O7Fc&|7&ZaB z3R{e=!Zu+qVEeJpu+umkP8O$!v%&e`m^cBh0JjgVVO@FI9+yb0bFACBkY z*W*j^b@)#F0DcTVPY@?)5UdD31U4a?u$@pt=pfuAj1uOF5=1Sc4Ka|IK+GeS5gUn@ ziI0fyL_|bXMJz@9M7SdBM9M@?h+GvJ5&1xpBrl2ruZ813h{RFA@OMmiiEL*k3_OWu|%E3HHmRaoTR3tizHhzU-GczCCO(L6h)2V zL}5`jP--ZbDWg;@Rg3CDO`sN0k5l`oQ&N&rrc%LDSyB~J=cI;dD4HhCgO)_wPCH2( zq$C zPNfNDin6UTSGh#_yz)!B6y1TIL@%Rv)2CDvRNPh4RSv22sm!ZtsRpU8S8Y;#tVUF0 zsKu(4sCB7LsVl2{tLLiMt3S{nXfQP5HTG)sXv}JAX@+QS(rncn*OJll(8|%O*LtK) z*0$4Lsa>soM+d9J&`H#((z&Gz>ze7t>sILA)PwcR^|*Rfdi{$qi!2xM7F91A(kJOV z=x6BH>yH@F47?218?+j{F;q7UH{5C1WBA#~%qYpI#^|B3r14VY^~N2>f12o;uuLjU z?kpxRc3r%7aoggzrh29v)BUFR%qV8wW}D2q%>FXBFz1^$non4$Tf|sYS`0C$3|~eu z%Pur1v-#`d7? zu$_t>)2`a?slA##+y03Cn1hZ(f7S@4|ynhusmu#rj}YPUA?s1ljIrTS?>ANOV^9< z)!_|$FZJH-{b-rSGTyRQAK>HRv)kvfua@sh-!pz#KVQEJzZd?-{<;1=0hEB~fVzO0 zK*zxCfe(YUgVKY#g2jR(gKL9lL!3i)g$#!phOQ315hfSL4QmU>g$IWp37?K|iP#e{ z8fg|;5IGp76_pirZMod?q~+(L#iE(fr(!TMAu)9^pO`+(YUcC`j}?_GrdUp_y{uPk zdv*zXf@8zk#TkpWiQN@D9%mD`J8mN0F1|E=lIz4R=e|vFPdJb;o9L5xH1SJPNK#WW zJ~<}2ohQjlDuWV(?>FF zGb%FXGJ`WuWl3c5vU;<1v$tfA<+$ejvI@P5wW=#uB{wg3WVOTULu;TlE7o+aRa=|C zc66QFx?_37yu`fU)*G$gwf_BvkPRLAiuvpEpKWy8SYIGoz%LluWWDLYX7pz6=Dsb9 zx9r>UxsY9Wy~wDjwCGbYtN8j>>|zif-$*0ed_ym?E6$6Uw*g3v7)I`p>j**Y!$m| zV88wT#si86iVl1{$US)PklUe_YR&4>!`QxRqe;wr=9X{rN zth?5twzf{8ZhJjkpI$%F5ZQ3+xbyM0M*YS^O|+(>6W~PpiI=~|{5p8j^JLd4#;L~B z8mB9pDb0l~P)l~pRBL?ea9dbgfBVw*t`6&t<}(Ioj-FLHTX9b6-1bglXMX3G^Ev0I zFQi_Wycl=!Syyz|!%Lx;?sWTg_g(h9eD#X!l}kMiJ?F35Ts?cu>RS7C#`V@4<~Le; z&3c=EGyAQ%&%CeYrp3*+Tb8#v`j_-~4%iJ`yzPAZ${mk8H|{RG+dmjIcyB0jX!suc z-uV5b`)?m)JeYsD?h)ou;bZZ~rB4)|RR6B?d(*J_@VOD^k=~~PPai&GJ$v;$?fIwC z{1@aGrDMutwc{q^XD3`IZoQ0nIr=K~)%;|^Yl+vDZ?xZ>{=@!{-l@>3(YO4!U;Zq9 zC;RT`d(-z_)4tPBW|C*-XA9?K=Z<|~eCYWY@^NfF^Aqk<* Date: Sat, 4 May 2024 06:26:19 -0400 Subject: [PATCH 16/48] Revert questionable change to NSTextView --- Source/NSTextView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 93c9b6e1d..34cbae105 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -5844,7 +5844,7 @@ other than copy/paste or dragging. */ untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; - } while ([currentEvent type] != NSLeftMouseUp && currentEvent != nil); + } while ([currentEvent type] != NSLeftMouseUp); if (gettingPeriodic) { From d3f05037eb14b99e40fdc1d007b8b7e8038aada3 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sat, 4 May 2024 09:27:05 -0400 Subject: [PATCH 17/48] Finish implementation of NSMenuToolbarItem --- Source/NSMenuToolbarItem.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/NSMenuToolbarItem.m b/Source/NSMenuToolbarItem.m index b9771e587..2f2c4a3e7 100644 --- a/Source/NSMenuToolbarItem.m +++ b/Source/NSMenuToolbarItem.m @@ -26,6 +26,12 @@ #import "AppKit/NSMenu.h" #import "AppKit/NSImage.h" +#import "GNUstepGUI/GSTheme.h" + +@interface NSToolbarItem (Private) +- (NSView *) _backView; +@end + @implementation NSMenuToolbarItem - (instancetype) initWithItemIdentifier: (NSString *)identifier @@ -33,7 +39,7 @@ self = [super initWithItemIdentifier: identifier]; if (self != nil) { - [self setImage: [NSImage imageNamed: @"common_ArrowDown"]]; + [self setImage: [NSImage imageNamed: @"NSMenuToolbarItem"]]; [self setTarget: self]; [self setAction: @selector(_showMenu:)]; } @@ -57,7 +63,7 @@ if (_showsIndicator == YES) { - [self setImage: [NSImage imageNamed: @"common_ArrowDown"]]; + [self setImage: [NSImage imageNamed: @"NSMenuToolbarItem"]]; } else { @@ -77,7 +83,8 @@ - (void) _showMenu: (id)sender { - NSLog(@"menu = %@", _menu); + [[GSTheme theme] rightMouseDisplay: _menu + forEvent: nil]; } @end From 615b3e9b27b6ce5a71cb9388097192a26f68c70f Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sat, 4 May 2024 09:51:56 -0400 Subject: [PATCH 18/48] Update changelog --- ChangeLog | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index b93166b0b..aa8286523 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2024-05-04 Gregory John Casamento + + * Headers/AppKit/AppKit.h: Add NSMenuToolbarItem.h + * Headers/AppKit/NSMenuToolbarItem.h: Declarations + for NSMenuToolbarItem. + * Images/GNUmakefile: Add new image + * Images/nsmapping.strings: Add image mapping + * MISSING: Remove this class from the list + * Source/GNUmakefile: Add class to build + * Source/NSMenuToolbarItem.m: Implementation of + NSMenuToolbarItem. + 2024-03-18 Fred Kiefer * Source/NSTextView.m: Add support for NSFilenamenPboardType. From 8fc0bffc5c89c66e440fdc741cb0f7586421bc0f Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Mon, 6 May 2024 09:49:19 -0400 Subject: [PATCH 19/48] Eliminate white-space --- Headers/AppKit/NSMenuToolbarItem.h | 13 ++++++------- Source/NSMenuToolbarItem.m | 9 ++++----- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Headers/AppKit/NSMenuToolbarItem.h b/Headers/AppKit/NSMenuToolbarItem.h index f1a0b2aa4..aad8d515b 100644 --- a/Headers/AppKit/NSMenuToolbarItem.h +++ b/Headers/AppKit/NSMenuToolbarItem.h @@ -1,21 +1,21 @@ /* Definition of class NSMenuToolbarItem Copyright (C) 2024 Free Software Foundation, Inc. - + By: Gregory John Casamento Date: 03-05-2024 This file is part of the GNUstep Library. - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, @@ -36,7 +36,7 @@ extern "C" { @class NSMenu; -APPKIT_EXPORT_CLASS +APPKIT_EXPORT_CLASS @interface NSMenuToolbarItem : NSToolbarItem { BOOL _showsIndicator; @@ -48,7 +48,7 @@ APPKIT_EXPORT_CLASS - (NSMenu *) menu; - (void) setMenu: (NSMenu *)menu; - + @end #if defined(__cplusplus) @@ -58,4 +58,3 @@ APPKIT_EXPORT_CLASS #endif /* GS_API_MACOSX */ #endif /* _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE */ - diff --git a/Source/NSMenuToolbarItem.m b/Source/NSMenuToolbarItem.m index 2f2c4a3e7..53fdea0b1 100644 --- a/Source/NSMenuToolbarItem.m +++ b/Source/NSMenuToolbarItem.m @@ -1,21 +1,21 @@ /* Implementation of class NSMenuToolbarItem Copyright (C) 2024 Free Software Foundation, Inc. - + By: Gregory John Casamento Date: 03-05-2024 This file is part of the GNUstep Library. - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, @@ -88,4 +88,3 @@ } @end - From 27c9dc92072e671c16994eb0ad6ab411128be72a Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Mon, 6 May 2024 10:09:39 -0400 Subject: [PATCH 20/48] Fix whitespace in NSTableRowView.[hm] --- Headers/AppKit/NSTableRowView.h | 12 ++++++------ Source/NSTableRowView.m | 9 ++++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Headers/AppKit/NSTableRowView.h b/Headers/AppKit/NSTableRowView.h index 6f8db8649..2345f2200 100644 --- a/Headers/AppKit/NSTableRowView.h +++ b/Headers/AppKit/NSTableRowView.h @@ -1,21 +1,21 @@ /* Definition of class NSTableRowView Copyright (C) 2022 Free Software Foundation, Inc. - + By: Gregory John Casamento Date: 03-09-2022 This file is part of the GNUstep Library. - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, @@ -90,7 +90,7 @@ extern "C" { - (NSInteger) numberOfColumns; - (NSColor *) backgroundColor; -- (void) setBackgroundColor: (NSColor *)color; +- (void) setBackgroundColor: (NSColor *)color; - (void) drawBackgroundInRect: (NSRect)dirtyRect; @@ -107,7 +107,7 @@ extern "C" { - (BOOL) isPreviousRowSelected; - (void) setPreviousRowSelected: (BOOL)flag; - + @end #if defined(__cplusplus) diff --git a/Source/NSTableRowView.m b/Source/NSTableRowView.m index c17971ea5..0aa0ac48b 100644 --- a/Source/NSTableRowView.m +++ b/Source/NSTableRowView.m @@ -1,21 +1,21 @@ /* Implementation of class NSTableRowView Copyright (C) 2022 Free Software Foundation, Inc. - + By: Gregory John Casamento Date: 03-09-2022 This file is part of the GNUstep Library. - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, @@ -168,4 +168,3 @@ } @end - From 656fe6e576c73fff9c5a1dae59e35c0d0fed7a7f Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Tue, 14 May 2024 00:56:39 +0200 Subject: [PATCH 21/48] seek for trailing signature and recognize v2 TGA files and hint that to ImageMagick --- Source/GSImageMagickImageRep.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/GSImageMagickImageRep.m b/Source/GSImageMagickImageRep.m index 385b2c568..d89462f00 100644 --- a/Source/GSImageMagickImageRep.m +++ b/Source/GSImageMagickImageRep.m @@ -2,9 +2,11 @@ ImageMagick image representation. - Copyright (C) 2011 Free Software Foundation, Inc. + Copyright (C) 2011-2024 Free Software Foundation, Inc. Author: Eric Wasylishen + Riccardo Mottola + Date: June 2011 This file is part of the GNUstep Application Kit Library. @@ -130,6 +132,7 @@ ExceptionInfo *exception = AcquireExceptionInfo(); ImageInfo *imageinfo = CloneImageInfo(NULL); Image *images, *image; + char signature[32]; // Set the background color to transparent // (otherwise SVG's are rendered against a white background by default) @@ -139,6 +142,14 @@ QueryColorDatabase("none", &imageinfo->background_color, exception); #endif + bzero(signature, 32); + [data getBytes:signature range:NSMakeRange([data length]-18, 18)]; + if (strncmp(signature, "TRUEVISION-XFILE.", 17) == 0) + { + NSWarnLog(@"Targa file detected!, giving a magick hint..."); + strcpy(imageinfo->magick, "TGA"); + } + images = BlobToImage(imageinfo, [data bytes], [data length], exception); if (exception->severity != UndefinedException) From f02d54ee8a31b80d1def9fe016bbf64b44a1f7fd Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Fri, 17 May 2024 10:58:37 +0200 Subject: [PATCH 22/48] code reformat --- Source/GSImageMagickImageRep.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/GSImageMagickImageRep.m b/Source/GSImageMagickImageRep.m index d89462f00..1747fda80 100644 --- a/Source/GSImageMagickImageRep.m +++ b/Source/GSImageMagickImageRep.m @@ -131,7 +131,8 @@ ExceptionInfo *exception = AcquireExceptionInfo(); ImageInfo *imageinfo = CloneImageInfo(NULL); - Image *images, *image; + Image *images; + Image *image; char signature[32]; // Set the background color to transparent @@ -143,7 +144,7 @@ #endif bzero(signature, 32); - [data getBytes:signature range:NSMakeRange([data length]-18, 18)]; + [data getBytes: signature range: NSMakeRange([data length] - 18, 18)]; if (strncmp(signature, "TRUEVISION-XFILE.", 17) == 0) { NSWarnLog(@"Targa file detected!, giving a magick hint..."); From 7feeccceabfb4773cde4d95b445b3913c501c233 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Fri, 17 May 2024 11:37:57 +0200 Subject: [PATCH 23/48] use memset instead of bzeo, to conform to the rest of the file --- Source/GSImageMagickImageRep.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/GSImageMagickImageRep.m b/Source/GSImageMagickImageRep.m index 1747fda80..03e94fd41 100644 --- a/Source/GSImageMagickImageRep.m +++ b/Source/GSImageMagickImageRep.m @@ -143,7 +143,7 @@ QueryColorDatabase("none", &imageinfo->background_color, exception); #endif - bzero(signature, 32); + memset(signature, 0, 32); [data getBytes: signature range: NSMakeRange([data length] - 18, 18)]; if (strncmp(signature, "TRUEVISION-XFILE.", 17) == 0) { From 3ec731943c4ef2fcfbe269612a016f88bde7ea3e Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Tue, 21 May 2024 14:38:26 +0200 Subject: [PATCH 24/48] use a constant for signature and use for now only the bytes needed for TGA --- Source/GSImageMagickImageRep.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/GSImageMagickImageRep.m b/Source/GSImageMagickImageRep.m index 03e94fd41..55d59b75b 100644 --- a/Source/GSImageMagickImageRep.m +++ b/Source/GSImageMagickImageRep.m @@ -125,6 +125,8 @@ return bmp; } +#define SIGNATURE_LENGTH 18 + + (NSArray*) imageRepsWithData: (NSData *)data allImages: (BOOL)allImages { NSMutableArray *reps = [NSMutableArray array]; @@ -133,7 +135,7 @@ ImageInfo *imageinfo = CloneImageInfo(NULL); Image *images; Image *image; - char signature[32]; + char signature[SIGNATURE_LENGTH]; // Set the background color to transparent // (otherwise SVG's are rendered against a white background by default) @@ -143,7 +145,7 @@ QueryColorDatabase("none", &imageinfo->background_color, exception); #endif - memset(signature, 0, 32); + memset(signature, 0, SIGNATURE_LENGTH); [data getBytes: signature range: NSMakeRange([data length] - 18, 18)]; if (strncmp(signature, "TRUEVISION-XFILE.", 17) == 0) { From 276d12da9f1309328335c4264490da835b67b4d7 Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Sun, 26 May 2024 22:00:44 +0200 Subject: [PATCH 25/48] Update for new release --- ANNOUNCE | 81 ++-- ChangeLog | 8 + Documentation/news.texi | 45 ++- NEWS | 839 ++++++++++++++++++++++------------------ Version | 6 +- 5 files changed, 558 insertions(+), 421 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 2caf7362d..23a487998 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,13 +1,13 @@ 1 Announcement ************** -This is version 0.29.0 of the GNUstep GUI library ('gnustep-gui'). +This is version 0.31.0 of the GNUstep GUI library (‘gnustep-gui’). 1.1 What is the GNUstep GUI Library? ==================================== It is a library of graphical user interface classes written completely -in the Objective-C language; the classes are based upon Apple's Cocoa +in the Objective-C language; the classes are based upon Apple’s Cocoa framework. The library has been enhanced in a number of ways to take advantage of the GNU system. These classes include graphical objects such as buttons, text fields, popup lists, browser lists, and windows; @@ -25,58 +25,65 @@ systems. The GNUstep GUI Library requires the GNU Objective-C compiler, the GNUstep Base Library, the TIFF Graphics library, Independent JPEG -Group's libjpeg library, and a back-end component from the GNUstep -'Back' library. +Group’s libjpeg library, and a back-end component from the GNUstep +’Back’ library. Additional functionality may be enabled by installing additional libraries. For example, to build the Cairo backend in the GNUstep Back library, you will need to install Cairo. -1.2 Noteworthy changes in version '0.29.0' +1.2 Noteworthy changes in version ‘0.31.0’ ========================================== -This version adds support for storyboard files and many new classes. -Plus the usual bunch of bug fixes. +This version adds view based cell support for NSTableView and +NSOutlineView. Plus the usual bunch of bug fixes. - * Support loading of storyboard files. - * Add classes NSSwitch, NSFontAssetRequest, - NSMediaLibraryBrowserController, NSScrubberItemView, - NSScrubberLayout, NSScrubber, NSSharingServicePickerToolbarItem, - NSPathCell, NSPathComponentCell, NSPathControl, NSPathControlItem, - NSPersistentDocument, NSAccessibilityCustomAction, - NSAccessibilityCustomRotor, NSAccessibilityElement, NSStoryboard, - NSStoryboardSegue, NSPageController, NSSplitViewController, - NSSplitViewItem, NSTabViewController, NSLayoutAnchor, - NSLayoutConstraint, NSLayoutGuide, NSStatusBarButton, - NSTextCheckingController, NSTextFinder, NSTextInputContext, - NSGridView. Some of these classes are still skeletons. - * Fix extraline fragment in text layout. - * Better encoding handling in RTF files. - * Add more italian translations. - * Add MacOSX methods to NSNib, NSMenu and NSWindow. - * Focus handling fixes for WindowMaker. - * Fix missing colours when loading old colour lists. - * Support JPEG export as greyscale image. - * Fix memory leak in NSPopupButtonCell. - * Fix toolbar flickering. - * NSSearchFieldCell use code from GSTheme to display popup. - * Fix int decoding to get it working on 64 bit big endian machines. - * Add tab stops after last defined at default intervals. - * Stop NSWindow from handling windows that are gone, but possibly - returned by a slow window manager. - * Fix NSTableView/NSTableColumn bindings. + • Add TGA detection for ImageMagick extension. + • Correct endianess swapping for saving 16 and 32 bit TIFF images. + • NSParagraphStyle restore old behaviour to have default tab stops. + • Documentation updates. + • A fix for autogsdoc documentation creation. + • Improve theming for many classes. + • Correct keyEquivalentModifierMask decoding in XIB files. + • Add imageViewWithImage: to NSImageView. + • Add implementation of NSUserInterfaceItemIdentifier to NSView. + • Fix NSImageView intercepting mouse events when not editable + • Move NSBox method isOpaque to GSTheme. + • Many decoding improvements. + • Fix compiler warnings. + • Generate and install a gnustep-gui.pc file. + • Add support for NSFilenamenPboardType in NSTextView. + • Add support for NSPasteboardTypePNG in NSBitmapImageRep if the + libpng is present. + • Add support for ImageMagick >= 7.0 + • Increase pasteboard timeout to 30 seconds. + • Add NSAppearance implementation. + • Make PACKAGE_SCOPE public on MinGW. + • Started implementing NSShadow. + • Move awakeFromNib implementation to NSObject instead of NSView. + • Changes for libGIF 5.2 and later. + • Update NSViewController with lifeCycle methods. + • Avoid accessing instance variables in inline functions when + compiling with MSVC. + • Add method removeAllItems to NSMenu. + • Add badge handling to NSDockTile. + • More improvements to layout constraints. + • Add implementation of NSDictionaryController. + • Add implementation of the NSCollectionView classes. + • Improve NSDrawer opening. + • Improver CI pipeline. 1.3 Where can you get it? How can you compile it? ================================================= -The gnustep-gui-0.29.0.tar.gz distribution file has been placed at +The gnustep-gui-0.31.0.tar.gz distribution file has been placed at . - It is accompanied by gnustep-gui-0.29.0.tar.gz.sig, a PGP signature + It is accompanied by gnustep-gui-0.31.0.tar.gz.sig, a PGP signature which you can validate by putting both files in the same directory and using: - gpg --verify gnustep-gui-0.29.0.tar.gz.sig + gpg --verify gnustep-gui-0.31.0.tar.gz.sig Signature has been created using the key with the following fingerprint: diff --git a/ChangeLog b/ChangeLog index a82f8da45..4c2b9b933 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2024-05-26 Fred Kiefer + + * ChangeLog: Update for new release + * ANNOUNCE: + * NEWS: + * Documentation/news.texi: Update of release notes for 0.31.0. + * Version: bump to 0.31.0 + 2024-05-13 Adam Fox * Source/NSParagraphStyle.m (-init): Apply the old default diff --git a/Documentation/news.texi b/Documentation/news.texi index afea0d296..2784d3d77 100644 --- a/Documentation/news.texi +++ b/Documentation/news.texi @@ -9,6 +9,48 @@ The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}. @end ifclear +@section Noteworthy changes in version @samp{0.31.0} + +This version adds view based cell support for NSTableView and NSOutlineView. +Plus the usual bunch of bug fixes. + +@itemize @bullet +@item Add TGA detection for ImageMagick extension. +@item Correct endianess swapping for saving 16 and 32 bit TIFF images. +@item NSParagraphStyle restore old behaviour to have default tab stops. +@item Documentation updates. +@item A fix for autogsdoc documentation creation. +@item Improve theming for many classes. +@item Correct keyEquivalentModifierMask decoding in XIB files. +@item Add imageViewWithImage: to NSImageView. +@item Add implementation of NSUserInterfaceItemIdentifier to NSView. +@item Fix NSImageView intercepting mouse events when not editable +@item Move NSBox method isOpaque to GSTheme. +@item Many decoding improvements. +@item Fix compiler warnings. +@item Generate and install a gnustep-gui.pc file. +@item Add support for NSFilenamenPboardType in NSTextView. +@item Add support for NSPasteboardTypePNG in NSBitmapImageRep if the libpng is present. +@item Add support for ImageMagick >= 7.0 +@item Increase pasteboard timeout to 30 seconds. +@item Add NSAppearance implementation. +@item Make PACKAGE_SCOPE public on MinGW. +@item Started implementing NSShadow. +@item Move awakeFromNib implementation to NSObject instead of NSView. +@item Changes for libGIF 5.2 and later. +@item Update NSViewController with lifeCycle methods. +@item Avoid accessing instance variables in inline functions when compiling with MSVC. +@item Add method removeAllItems to NSMenu. +@item Add badge handling to NSDockTile. +@item More improvements to layout constraints. +@item Add implementation of NSDictionaryController. +@item Add implementation of the NSCollectionView classes. +@item Improve NSDrawer opening. +@item Improver CI pipeline. +@end itemize + +@ifclear ANNOUNCE-ONLY + @section Noteworthy changes in version @samp{0.30.0} This version adds parsing support for layout constraints, compilation with MSVC @@ -48,11 +90,8 @@ and many new classes. Plus the usual bunch of bug fixes. @item Support ImageMagick version >= 7. @item Add github workflow. @item Add icon for speech synthesizer. -@item -@item @end itemize -@ifclear ANNOUNCE-ONLY @section Noteworthy changes in version @samp{0.29.0} diff --git a/NEWS b/NEWS index 52e8a37ed..f4afc383d 100644 --- a/NEWS +++ b/NEWS @@ -1,16 +1,99 @@ 1 NEWS ****** -The currently released version of the library is '0.29.0'. +The currently released version of the library is ‘0.31.0’. -1.1 Noteworthy changes in version '0.29.0' +1.1 Noteworthy changes in version ‘0.31.0’ +========================================== + +This version adds view based cell support for NSTableView and +NSOutlineView. Plus the usual bunch of bug fixes. + + • Add TGA detection for ImageMagick extension. + • Correct endianess swapping for saving 16 and 32 bit TIFF images. + • NSParagraphStyle restore old behaviour to have default tab stops. + • Documentation updates. + • A fix for autogsdoc documentation creation. + • Improve theming for many classes. + • Correct keyEquivalentModifierMask decoding in XIB files. + • Add imageViewWithImage: to NSImageView. + • Add implementation of NSUserInterfaceItemIdentifier to NSView. + • Fix NSImageView intercepting mouse events when not editable + • Move NSBox method isOpaque to GSTheme. + • Many decoding improvements. + • Fix compiler warnings. + • Generate and install a gnustep-gui.pc file. + • Add support for NSFilenamenPboardType in NSTextView. + • Add support for NSPasteboardTypePNG in NSBitmapImageRep if the + libpng is present. + • Add support for ImageMagick >= 7.0 + • Increase pasteboard timeout to 30 seconds. + • Add NSAppearance implementation. + • Make PACKAGE_SCOPE public on MinGW. + • Started implementing NSShadow. + • Move awakeFromNib implementation to NSObject instead of NSView. + • Changes for libGIF 5.2 and later. + • Update NSViewController with lifeCycle methods. + • Avoid accessing instance variables in inline functions when + compiling with MSVC. + • Add method removeAllItems to NSMenu. + • Add badge handling to NSDockTile. + • More improvements to layout constraints. + • Add implementation of NSDictionaryController. + • Add implementation of the NSCollectionView classes. + • Improve NSDrawer opening. + • Improver CI pipeline. + +1.2 Noteworthy changes in version ‘0.30.0’ +========================================== + +This version adds parsing support for layout constraints, compilation +with MSVC and many new classes. Plus the usual bunch of bug fixes. + + • Add classes NSStackView, NSGlyphInfo. + • Add more formal protocols to headers. + • Add extra pixels so that tool tip doesn’t overrun the window. + • More improvements from Testplant. + • NSSplitView support different divider styles. + • Improve on Wayland support. + • NSPopUpButtonCell attempt to fix deallocation and item selection. + • NSImageCell fix refuse first responder. + • Improve NIB and XIB unarchiving. + • GSStandardWindowDecorationView fix resizing mode + • Make resize bar notch themable. + • NSButton add radio button behavior from MacOS 10.7. + • Fix clicking on test attachment cells. + • Add missing methods to GSLayoutManager. + • Add NSLayoutConstraint parsing. + • Add APPKIT_EXPORT_CLASS to support compilation with MSVC. + • Remove libgnustep-gui_INTERFACE_VERSION. + • Fix to build GSSpell in custom build dir. + • Add all new header files to DocMakefile. + • Fix memory leaks in NSView, NSTextView and NSBox. + • Add placeholder string handling in NSTextField.m. + • Apply userSpaceScaleFactor to title bar height when calculating + offsets. + • Add new constants from MacOS 10.14 to NSBezierPath. + • Add README.md file. + • Add helper methods in GSWindowDecorator protocol for pointer hit + test on window decorations. + • Improve support for 16 bit colour values in images. + • NSTextStorage update signatures to match MacOS. + • Add a preference to disable spellchecker. + • Fix crash in JPEG reading. + • Improve NSPopover and NSAccessibilityCustomAction. + • Support ImageMagick version >= 7. + • Add github workflow. + • Add icon for speech synthesizer. + +1.3 Noteworthy changes in version ‘0.29.0’ ========================================== This version adds support for storyboard files and many new classes. Plus the usual bunch of bug fixes. - * Support loading of storyboard files. - * Add classes NSSwitch, NSFontAssetRequest, + • Support loading of storyboard files. + • Add classes NSSwitch, NSFontAssetRequest, NSMediaLibraryBrowserController, NSScrubberItemView, NSScrubberLayout, NSScrubber, NSSharingServicePickerToolbarItem, NSPathCell, NSPathComponentCell, NSPathControl, NSPathControlItem, @@ -21,34 +104,34 @@ Plus the usual bunch of bug fixes. NSLayoutConstraint, NSLayoutGuide, NSStatusBarButton, NSTextCheckingController, NSTextFinder, NSTextInputContext, NSGridView. Some of these classes are still skeletons. - * Fix extraline fragment in text layout. - * Better encoding handling in RTF files. - * Add more italian translations. - * Add MacOSX methods to NSNib, NSMenu and NSWindow. - * Focus handling fixes for WindowMaker. - * Fix missing colours when loading old colour lists. - * Support JPEG export as greyscale image. - * Fix memory leak in NSPopupButtonCell. - * Fix toolbar flickering. - * NSSearchFieldCell use code from GSTheme to display popup. - * Fix int decoding to get it working on 64 bit big endian machines. - * Add tab stops after last defined at default intervals. - * Stop NSWindow from handling windows that are gone, but possibly + • Fix extraline fragment in text layout. + • Better encoding handling in RTF files. + • Add more italian translations. + • Add MacOSX methods to NSNib, NSMenu and NSWindow. + • Focus handling fixes for WindowMaker. + • Fix missing colours when loading old colour lists. + • Support JPEG export as greyscale image. + • Fix memory leak in NSPopupButtonCell. + • Fix toolbar flickering. + • NSSearchFieldCell use code from GSTheme to display popup. + • Fix int decoding to get it working on 64 bit big endian machines. + • Add tab stops after last defined at default intervals. + • Stop NSWindow from handling windows that are gone, but possibly returned by a slow window manager. - * Fix NSTableView/NSTableColumn bindings. + • Fix NSTableView/NSTableColumn bindings. -1.2 Noteworthy changes in version '0.28.0' +1.4 Noteworthy changes in version ‘0.28.0’ ========================================== This version adds support for modern XIB files and many new classes. Plus the usual bunch of bug fixes. - * Support loading of document XIB files. - * Improve Key Value Binding for NSArrayController and add more + • Support loading of document XIB files. + • Improve Key Value Binding for NSArrayController and add more bindings. - * Better support for multi monitor usage and other improvement in the + • Better support for multi monitor usage and other improvement in the backend integration. - * Add classes NSFontCollection, NSColorSampler, NSSpeechRecognizer, + • Add classes NSFontCollection, NSColorSampler, NSSpeechRecognizer, NSAppearance, NSPDFInfo, NSPICTImageRep, NSCIImageRep, NSPDFImageRep, NSPDFPanel, NSDataAsset, NSDatePicker, NSDatePickerCell, NSPredicateEditor, NSPredicateEditorRowTemplate, @@ -61,52 +144,52 @@ Plus the usual bunch of bug fixes. NSRotationGestureRecognizer, NSSharingServicePickerTouchBarItem, NSSliderTouchBarItem, NSStepperTouchBarItem, NSTouchBarItem, NSTouchBar, NSTouch, NSDockTile. - * Implement NSEPSImageRep. - * Better encoding handling in RTF files. - * Theming and drawing improvements. - * Increase small font size to 10. - * New cursor and stepper images. - * Move NSFileWrapper to Foundation. - * Fixed build on Debian GNU/kFreeBSD. - * With command line argument -autolaunch YES, do not activate the + • Implement NSEPSImageRep. + • Better encoding handling in RTF files. + • Theming and drawing improvements. + • Increase small font size to 10. + • New cursor and stepper images. + • Move NSFileWrapper to Foundation. + • Fixed build on Debian GNU/kFreeBSD. + • With command line argument -autolaunch YES, do not activate the application when -activateIgnoringOtherApps: is invoked. - * Improvements to WindowMaker compatibility (e.g. WMFHideApplication + • Improvements to WindowMaker compatibility (e.g. WMFHideApplication support). - * Lowered NSFloatingWindowLevel by one to distinguish floating panels + • Lowered NSFloatingWindowLevel by one to distinguish floating panels from menus. -1.3 Noteworthy changes in version '0.27.0' +1.5 Noteworthy changes in version ‘0.27.0’ ========================================== This version includes numerous bugfixes, compatibility improvements and other changes accumulated over the last year. It also enables work to be done on integrating NSViews with a Core Animation renderer. - * Make targetForAction safer. - * Speed up menu updates. - * Clean up speech tool compilation and switch to newer interface. - * Fix bug in CUPS subclassing introduced in last release. - * Minor improvements to typesetting. - * Add NSIsControllerMarker. - * Fix tracking on segmented cell. - * Bring slider cell closer to Cocoa implementation. - * Add ivar for Core Animation in NSView. - * Improve border calculation on printing. - * Lazy load app icon. - * Better detection of removable volumes. - * Polish translations. - * Japanese translations. - * Lots of bug fixes. + • Make targetForAction safer. + • Speed up menu updates. + • Clean up speech tool compilation and switch to newer interface. + • Fix bug in CUPS subclassing introduced in last release. + • Minor improvements to typesetting. + • Add NSIsControllerMarker. + • Fix tracking on segmented cell. + • Bring slider cell closer to Cocoa implementation. + • Add ivar for Core Animation in NSView. + • Improve border calculation on printing. + • Lazy load app icon. + • Better detection of removable volumes. + • Polish translations. + • Japanese translations. + • Lots of bug fixes. -1.4 Noteworthy changes in version '0.26.2' +1.6 Noteworthy changes in version ‘0.26.2’ ========================================== This version is a small, but important bugfix release. - * printing: Fix allocation of the CUPS printing classes. - * installation: Fix the configure script. + • printing: Fix allocation of the CUPS printing classes. + • installation: Fix the configure script. -1.5 Noteworthy changes in version '0.26.1' +1.7 Noteworthy changes in version ‘0.26.1’ ========================================== This version is released to conincide with version 1.25.1 of @@ -117,7 +200,7 @@ gnustep-gui and gnustep-back. Runtime (libobjc2) and non-fragile ABI to avoid a bug in interaction between the clang compiler and the runtime when non-fragile ABI is in use. Specifically, Clang and the runtime may disagree on what is the -offset of an ivar in a class's RAM. This manifested in a crash at +offset of an ivar in a class’s RAM. This manifested in a crash at application startup due to misalignment of _gcontext inside NSThread. See the mailing list discussion (http://lists.gnu.org/archive/html/discuss-gnustep/2017-12/msg00129.html) @@ -125,15 +208,15 @@ for more information. It also contains the following changes: - * tests: Cleanup of warnings. - * tests: Fix text system deallocation test. - * printing: Undefine __BLOCKS__ before including cups.h, as some + • tests: Cleanup of warnings. + • tests: Fix text system deallocation test. + • printing: Undefine __BLOCKS__ before including cups.h, as some versions of the header expect that libdispatch is present and used if __BLOCKS__ is defined. - * graphics context: Workaround for Clang+libobjc2+nonfragile ABI + • graphics context: Workaround for Clang+libobjc2+nonfragile ABI issue. -1.6 Noteworthy changes in version '0.26.0' +1.8 Noteworthy changes in version ‘0.26.0’ ========================================== This version was bumped due to previous binary incompatibilities between @@ -142,108 +225,108 @@ improvements from the Summer of Code project, and a wide variety of other fixes. Notably, it fixes the use of cupsGetPPD() in the printing system. - * printing: Add an include to get deprecated function cupsGetPPD() on + • printing: Add an include to get deprecated function cupsGetPPD() on newer CUPS systems. - * chore: Bump required base version. - * tiff: Support for writing resolution. - * jpeg: Save resolution information if it is different from 72 dpi. - * save panel: Fix return type of sorting function. - * events: Add some newer Cocoa enums and one method with dummy + • chore: Bump required base version. + • tiff: Support for writing resolution. + • jpeg: Save resolution information if it is different from 72 dpi. + • save panel: Fix return type of sorting function. + • events: Add some newer Cocoa enums and one method with dummy implementation. - * speech synthesis: NSSpeechSynthesizerDelegate is now a @protocol on + • speech synthesis: NSSpeechSynthesizerDelegate is now a @protocol on runtimes that support it. - * pasteboard: New type identifiers. - * translations: Some work on Polish, Russian and German translations - * cell: Improvements to mouse tracking logic on NSCell. - * image: If an unknown named image is unarchived with a coder or + • pasteboard: New type identifiers. + • translations: Some work on Polish, Russian and German translations + • cell: Improvements to mouse tracking logic on NSCell. + • image: If an unknown named image is unarchived with a coder or keyed coder, keep the name. - * screen: Add -backingScaleFactor and return 1.0. - * window: Return 1.0 from -backingScaleFactor. + • screen: Add -backingScaleFactor and return 1.0. + • window: Return 1.0 from -backingScaleFactor. - * compatibility: Numerous stub implementations of constants, classes + • compatibility: Numerous stub implementations of constants, classes and methods to improve source-level compatibility. - * other bugfixes + • other bugfixes -1.7 Noteworthy changes in version '0.25.1' +1.9 Noteworthy changes in version ‘0.25.1’ ========================================== - * JPEG (saving) alpha channel fixes and size with resolution != 72 - * JPEG resolution read support - * TIFF saving fixes - * Improved volumes mounting and support - * Portability improvements in volume mounting and support - * Corrected layout of empty strings - * Only update visible menus + • JPEG (saving) alpha channel fixes and size with resolution != 72 + • JPEG resolution read support + • TIFF saving fixes + • Improved volumes mounting and support + • Portability improvements in volume mounting and support + • Corrected layout of empty strings + • Only update visible menus -1.8 Noteworthy changes in version '0.25.0' -========================================== +1.10 Noteworthy changes in version ‘0.25.0’ +=========================================== - * Fixes for new GIF library versions - * Theming of named images for specific applications by the use of the + • Fixes for new GIF library versions + • Theming of named images for specific applications by the use of the CFBundleIdentifier in the theme - * New icons and corresponding constants for special folders, recycler + • New icons and corresponding constants for special folders, recycler and others - * Improvements in NSWorkspace icon lookup - * Improvements in removable media commands, imported and cleaned from + • Improvements in NSWorkspace icon lookup + • Improvements in removable media commands, imported and cleaned from GWorkspace - * Numerous bug fixes and improvements in Cocoa compatibility - * Numerous theme tweaks - * Spanish locale + • Numerous bug fixes and improvements in Cocoa compatibility + • Numerous theme tweaks + • Spanish locale -1.9 Noteworthy changes in version '0.24.1' -========================================== +1.11 Noteworthy changes in version ‘0.24.1’ +=========================================== From a look through ChangeLog, we can see a lot of bugfixes for this release, with the main focus on avoiding display glitches and improving OSX compatibility. -1.10 Noteworthy changes in version '0.24.0' +1.12 Noteworthy changes in version ‘0.24.0’ =========================================== New features include: - * Require newer base release as we moved the + • Require newer base release as we moved the -replaceObject:withObject: of NSKeyedUnarchiver there. - * Support for newer releases of the gif library. - * NSTabView is now flipped. - * Theme improvements and changes to image mapping. + • Support for newer releases of the gif library. + • NSTabView is now flipped. + • Theme improvements and changes to image mapping. Many bugfixes. -1.11 Noteworthy changes in version '0.23.1' +1.13 Noteworthy changes in version ‘0.23.1’ =========================================== This is a bugfix release, primarily to deal with coding/archiving issues. -1.12 Noteworthy changes in version '0.22.0' +1.14 Noteworthy changes in version ‘0.22.0’ =========================================== New features include: - * This version is binary incompatible with previous versions due to + • This version is binary incompatible with previous versions due to the change of NSNotFound in GNUstep base. - * Support for drawing the GUI with a scale factor, for high-DPI + • Support for drawing the GUI with a scale factor, for high-DPI monitors. - * Character panel - * Color picker "Magnifier" tool, for grabbing the color of arbitrary + • Character panel + • Color picker “Magnifier” tool, for grabbing the color of arbitrary parts of the screen Many NSImage improvements (Mac OS X 10.6 drawing methods, better selection of image reps, better support for icons). Many bugfixes, including in Xib loading, printing, and NSView geometry. -1.13 Noteworthy changes in version '0.20.0' +1.15 Noteworthy changes in version ‘0.20.0’ =========================================== A new stable release. Many improvments with Nib loading, documents and document controllers. Fixed many drawing issues, particularly ones related to flipping. Much improved theming. -1.14 Noteworthy changes in version '0.19.0' +1.16 Noteworthy changes in version ‘0.19.0’ =========================================== This is an (unstable) copy of the 0.18.0 release -1.15 Noteworthy changes in version '0.18.0' +1.17 Noteworthy changes in version ‘0.18.0’ =========================================== A new stable release that has had many improvements. Many new Mac OS X @@ -252,131 +335,131 @@ were made (particularly with the use of the Windows theme). There is also better compatibility with Mac OS X in terms of usage of NSInteger and other definitions. -1.16 Noteworthy changes in version '0.17.1' +1.18 Noteworthy changes in version ‘0.17.1’ =========================================== - * New Mac OS X 10.5 methods in NSFont - * Add live resize in NSSplitView + • New Mac OS X 10.5 methods in NSFont + • Add live resize in NSSplitView -1.17 Noteworthy changes in version '0.17.0' +1.19 Noteworthy changes in version ‘0.17.0’ =========================================== - * New Mac OS X 10.5 methods in many classes - * Toolbars have been completely rewritten and improved. - * Several improvements for Garbage Collection + • New Mac OS X 10.5 methods in many classes + • Toolbars have been completely rewritten and improved. + • Several improvements for Garbage Collection -1.18 Noteworthy changes in version '0.16.0' +1.20 Noteworthy changes in version ‘0.16.0’ =========================================== - * Nib loading refractored and improved. - * Added support for autosaving in NSDocuments - * NSWindowController made a subclass of NSResponder - * NSTokenField and netokenFiledCell classes added. + • Nib loading refractored and improved. + • Added support for autosaving in NSDocuments + • NSWindowController made a subclass of NSResponder + • NSTokenField and netokenFiledCell classes added. -1.19 Noteworthy changes in version '0.14.0' +1.21 Noteworthy changes in version ‘0.14.0’ =========================================== - * New class NSGlyphGenerator for glyph generation - * NSSplitView implemented setAutosaveName: - * NSOpenGLView added some Mac OS X 10.3 methods - * Manu bug fixes. + • New class NSGlyphGenerator for glyph generation + • NSSplitView implemented setAutosaveName: + • NSOpenGLView added some Mac OS X 10.3 methods + • Manu bug fixes. -1.20 Noteworthy changes in version '0.13.2' +1.22 Noteworthy changes in version ‘0.13.2’ =========================================== - * Printing works a little better now. - * NSPopUpButtonCell - object encoding was changed - * NSTextView - several updates and Mac OS X methods added - * NSWindow - devince interaction was changed. You need to use + • Printing works a little better now. + • NSPopUpButtonCell - object encoding was changed + • NSTextView - several updates and Mac OS X methods added + • NSWindow - devince interaction was changed. You need to use gnustep-back 0.13.2 with this version - * New class NSSegmentedCell. - * NSDrawer was implemented. + • New class NSSegmentedCell. + • NSDrawer was implemented. -1.21 Noteworthy changes in version '0.13.1' +1.23 Noteworthy changes in version ‘0.13.1’ =========================================== - * NSMenu - Added more MacOS X methods and an ivar. - * Added support for hiding views. - * Added Key-Value bindings implementation (NSKeyValueBinding) with + • NSMenu - Added more MacOS X methods and an ivar. + • Added support for hiding views. + • Added Key-Value bindings implementation (NSKeyValueBinding) with support in several classes (NSControl, NSTextField, NSView, etc). - * Added some MacOS X 10.4 methods to NSTableView. - * Changed the NSCursor hot point to 0,0 for MacOS X compatibility. + • Added some MacOS X 10.4 methods to NSTableView. + • Changed the NSCursor hot point to 0,0 for MacOS X compatibility. -1.22 Noteworthy changes in version '0.13.0' +1.24 Noteworthy changes in version ‘0.13.0’ =========================================== This is an unstable release. There may be backward compatibility issues with previous releases of the gui library. - * Switched to use LGPL 3 and GPL 3. - * Added new methods from Mac OS X 10.4 for NSDragging, + • Switched to use LGPL 3 and GPL 3. + • Added new methods from Mac OS X 10.4 for NSDragging, NSFontDescriptor, NSAttributedString, NSImageView, NSStringDrawing, NSParagraphStyle, NSView, NSCell, NSActionCell, NSAlert, NSApplication, NSBitmapImageRep, NSBox, NSColor, NSColorSpace, NSComboBox, NSComboBoxCell, NSDocumentController, NSEvent, NSScreen, NSFont, NSFontManager, NSFormCell, NSForm, NSWindow, NSTextField, NSTextFieldCell. Some ivar names were changed also. - * Moved Postscript printing methods from NSView to NSGraphicsContext. - * Rewrote the NSView drawing mechanism to always use + • Moved Postscript printing methods from NSView to NSGraphicsContext. + • Rewrote the NSView drawing mechanism to always use [displayRectIgnoringOpacity:inContext]. - * Report more controls as being flipped. (NSTextField, + • Report more controls as being flipped. (NSTextField, NSTableHeaderView, NSSlider, NSProgressIndicator, NSButton) NSTabView is still missing. - * In NSAffineTransform use optimized primitive methods from base. - * Add font attribute fixing to NSAttributedString. To allow for the + • In NSAffineTransform use optimized primitive methods from base. + • Add font attribute fixing to NSAttributedString. To allow for the output of glyphs not present in the current font. - * Optimized the validation of edited cells. - * Implementation of special connectors for Key-Value binding. - * Base library version 1.15.1 is required for this release + • Optimized the validation of edited cells. + • Implementation of special connectors for Key-Value binding. + • Base library version 1.15.1 is required for this release -1.23 Noteworthy changes in version '0.12.0' +1.25 Noteworthy changes in version ‘0.12.0’ =========================================== It has been a long time since the last release and many things have been added and changed, including new classes, new ivars, and new methods. - * Lots of improvements to the NSBitmapImage subclasses thanks to Mark + • Lots of improvements to the NSBitmapImage subclasses thanks to Mark Tracy - * GSTheme and other classes were added to improve support of theming. - * Added new methods from Mac OS X 10.4 for NSControl, NSResponder, + • GSTheme and other classes were added to improve support of theming. + • Added new methods from Mac OS X 10.4 for NSControl, NSResponder, NSDocument, NSPrintOperation, NSWindowController, NSCell, NSMenuItem, NSView. Some ivar names were changed also. - * Added new ivars for NSMenuItem, NSPrintOperation, NSTableView, + • Added new ivars for NSMenuItem, NSPrintOperation, NSTableView, NSDrawer, NSScrollView. - * New classes from Mac OS X 10.4 and earlier were added including + • New classes from Mac OS X 10.4 and earlier were added including NSLevelIndicator, NSObjectController, NSUserDefaultsController, NSKeyValueBinding, NSArrayController, NSController. - * NSSpellServer and NSAffineTransform was moved to GNUstep base for + • NSSpellServer and NSAffineTransform was moved to GNUstep base for Mac OS X compatibility. -1.24 Noteworthy changes in version '0.11.0' +1.26 Noteworthy changes in version ‘0.11.0’ =========================================== - * Added support for keyed encoding in all gui classes. - * Added mechanism to allow for dynamic extension of model loading + • Added support for keyed encoding in all gui classes. + • Added mechanism to allow for dynamic extension of model loading mechanism - * Implemented glue code in GSNibCompatibility for classes such as + • Implemented glue code in GSNibCompatibility for classes such as NSIBObjectData, NSClassSwapper, etc. to facilitate nib loading. -1.25 Noteworthy changes in version '0.10.3' +1.27 Noteworthy changes in version ‘0.10.3’ =========================================== - * Horizontal menus now work - * Better support for tracking active applications. + • Horizontal menus now work + • Better support for tracking active applications. -1.26 Noteworthy changes in version '0.10.2' +1.28 Noteworthy changes in version ‘0.10.2’ =========================================== Mostly bug fixes. -1.27 Noteworthy changes in version '0.10.1' +1.29 Noteworthy changes in version ‘0.10.1’ =========================================== GNUstep now uses v19 of portaudio for the sound daemon. Version v19 -hasn't been officially released, but it is still used in several +hasn’t been officially released, but it is still used in several distributions (SuSE, etc) as v18 is very old. -1.28 Noteworthy changes in version '0.10.0' +1.30 Noteworthy changes in version ‘0.10.0’ =========================================== This release is binary incompatible with previous releases. The @@ -384,161 +467,161 @@ interface version of the library has changed so that apps, tools and libraries that use the base library need to be recompiled to use this new version. - * Model loading supports window auto-positioning - * Keyed encoding is supported in many classes. + • Model loading supports window auto-positioning + • Keyed encoding is supported in many classes. -1.29 Noteworthy changes in version '0.9.5' +1.31 Noteworthy changes in version ‘0.9.5’ ========================================== - * Beginnings of CUPS interface were added. - * Added new control colors and methods from 10.3 version of Cocoa. - * Added new font methods from 10.3 version of Cocoa. - * NSApplication -runModalSession behavior changed. - * You can find the GUI library's version using the Info.plist + • Beginnings of CUPS interface were added. + • Added new control colors and methods from 10.3 version of Cocoa. + • Added new font methods from 10.3 version of Cocoa. + • NSApplication -runModalSession behavior changed. + • You can find the GUI library’s version using the Info.plist -1.30 Noteworthy changes in version '0.9.4' +1.32 Noteworthy changes in version ‘0.9.4’ ========================================== - * The printing classes have been completely reorganized to + • The printing classes have been completely reorganized to accommodate different native printing systems (Thanks to Chad Hardin). - * PPD files have been moved to a separate package. - * NSToolbar now allows rearranging items. - * NSScroller, NSScrollView has a new ivar. - * Some improvement of NSDataLink classes. + • PPD files have been moved to a separate package. + • NSToolbar now allows rearranging items. + • NSScroller, NSScrollView has a new ivar. + • Some improvement of NSDataLink classes. -1.31 Noteworthy changes in version '0.9.3' +1.33 Noteworthy changes in version ‘0.9.3’ ========================================== - * Spell checker reimplemented using libaspell - * New NSComboBox implementation - * NSToolbar much improved - * Binary incompatibilites from ivar additions in NSView and + • Spell checker reimplemented using libaspell + • New NSComboBox implementation + • NSToolbar much improved + • Binary incompatibilites from ivar additions in NSView and subclasses. -1.32 Noteworthy changes in version '0.9.2' +1.34 Noteworthy changes in version ‘0.9.2’ ========================================== - * Working NSToolbar implementation - * New Mac OS X methods in NSView and other classes - * Fixed some sheet handling problems. - * Integrated gif, jpg, and png handling in front-end. - * Added overridable button and frame drawing functions - * Add some keyed decode/encoding to some classes - * NSStringDrawing redesigned. - * Much improved loading of gorm files + • Working NSToolbar implementation + • New Mac OS X methods in NSView and other classes + • Fixed some sheet handling problems. + • Integrated gif, jpg, and png handling in front-end. + • Added overridable button and frame drawing functions + • Add some keyed decode/encoding to some classes + • NSStringDrawing redesigned. + • Much improved loading of gorm files -1.33 Noteworthy changes in version '0.9.1' +1.35 Noteworthy changes in version ‘0.9.1’ ========================================== - * NSWindow - DnD works on whole window and events are propogated up + • NSWindow - DnD works on whole window and events are propogated up to first DnD aware view. - * Absolute paths and DnD works in OpenPanels. + • Absolute paths and DnD works in OpenPanels. -1.34 Noteworthy changes in version '0.9.0' +1.36 Noteworthy changes in version ‘0.9.0’ ========================================== Improvements in various classes, include NSPopUpButton, NSBitmapImageRep, NSMenu, NSToolbar. Added support for thumbnail images in NSWorkspace. -1.35 Noteworthy changes in version '0.8.9' +1.37 Noteworthy changes in version ‘0.8.9’ ========================================== Note that many headers have moved to new locations (both in the package and when installed), so it is possible, although not likely that some applications may not compile because they cannot find the right header. - * New Language Setup documentation. + • New Language Setup documentation. -1.36 Noteworthy changes in version '0.8.8' +1.38 Noteworthy changes in version ‘0.8.8’ ========================================== - * Updated LanguageSetup documentation - * Improved RTF reader (unicode support, etc). + • Updated LanguageSetup documentation + • Improved RTF reader (unicode support, etc). -1.37 Noteworthy changes in version '0.8.7' +1.39 Noteworthy changes in version ‘0.8.7’ ========================================== - * NSBezierPath glyph methods implemented (depends on backend). - * NSDataLink[Panel/Manager] - some implementation - * Added default to load user-defined bundles (GSAppKitUserBundles + • NSBezierPath glyph methods implemented (depends on backend). + • NSDataLink[Panel/Manager] - some implementation + • Added default to load user-defined bundles (GSAppKitUserBundles default). -1.38 Noteworthy changes in version '0.8.6' +1.40 Noteworthy changes in version ‘0.8.6’ ========================================== Updated to install in new locations based on changes in gnustep-make 1.7.0. - * New implementation of RTF producer (from Axel "Mikesch" Katerbau) - * Speed improvements, especially in tracking mouses movements. - * Lots of menu improvements. + • New implementation of RTF producer (from Axel "Mikesch" Katerbau) + • Speed improvements, especially in tracking mouses movements. + • Lots of menu improvements. -1.39 Noteworthy changes in version '0.8.5' +1.41 Noteworthy changes in version ‘0.8.5’ ========================================== Bug fixes. NSStringDrawing now uses text system implementation. -1.40 Noteworthy changes in version '0.8.4' +1.42 Noteworthy changes in version ‘0.8.4’ ========================================== This release features a brand new text and layout system thanks to Alexander Malmberg. Other improvements include: - * Various display optimizations. - * Default border to NSScrollView changed - * Printing fixes. - * NSToolbar partially implemented. + • Various display optimizations. + • Default border to NSScrollView changed + • Printing fixes. + • NSToolbar partially implemented. -1.41 Noteworthy changes in version '0.8.3' +1.43 Noteworthy changes in version ‘0.8.3’ ========================================== - * Additions for Gorm support. - * Alpha support for OpenGL - * Better ruler support - dragging of tab markers. - * Document support, recent files, etc. - * Simple printing to printer and print previewing. - * Window focus fixes - * Key view handling rewritten. + • Additions for Gorm support. + • Alpha support for OpenGL + • Better ruler support - dragging of tab markers. + • Document support, recent files, etc. + • Simple printing to printer and print previewing. + • Window focus fixes + • Key view handling rewritten. -1.42 Noteworthy changes in version '0.8.2' +1.44 Noteworthy changes in version ‘0.8.2’ ========================================== - * Handle fonts that aren't found better. - * Implement pageUp/Down. - * Some window focusing problems fixed. - * Quartz-like interface partially implemented. - * NSSecureTextField partially rewritten. More secure. - * NSBrowser: implement non-separate columns - * Fix firstResponder status in text fields. + • Handle fonts that aren’t found better. + • Implement pageUp/Down. + • Some window focusing problems fixed. + • Quartz-like interface partially implemented. + • NSSecureTextField partially rewritten. More secure. + • NSBrowser: implement non-separate columns + • Fix firstResponder status in text fields. -1.43 Noteworthy changes in version '0.8.1' +1.45 Noteworthy changes in version ‘0.8.1’ ========================================== - * Handle scaled curves correctly. - * Handle alpha channel with images correctly - * NSWindow frame string save without flipping coordinates. - * NSSound implemented. gssnd sound server. - * Spell checker starts correctly now. + • Handle scaled curves correctly. + • Handle alpha channel with images correctly + • NSWindow frame string save without flipping coordinates. + • NSSound implemented. gssnd sound server. + • Spell checker starts correctly now. -1.44 Noteworthy changes in version '0.8.0' +1.46 Noteworthy changes in version ‘0.8.0’ ========================================== -1.45 Noteworthy changes in version '0.7.9' +1.47 Noteworthy changes in version ‘0.7.9’ ========================================== - * NSTableView, NSOutlineView improvements. - * Menus no longer work in modal loop. - * Skeleton implementation of NSToolBar + • NSTableView, NSOutlineView improvements. + • Menus no longer work in modal loop. + • Skeleton implementation of NSToolBar -1.46 Noteworthy changes in version '0.7.8' +1.48 Noteworthy changes in version ‘0.7.8’ ========================================== - * Wheel color picker, standard color picker (bundles) added. - * System colors now use named colors. Easier configuration + • Wheel color picker, standard color picker (bundles) added. + • System colors now use named colors. Easier configuration -1.47 Noteworthy changes in version '0.7.7' +1.49 Noteworthy changes in version ‘0.7.7’ ========================================== The graphics/window interface was completely revamped. Window functions @@ -556,82 +639,82 @@ for improved code sharing. computers, although it is in a very alpha state. Other improvements: - * Mutliple screens are now handled properly (untested) - * Better autolayout with GSTable and subclasses. - * NSOutlineView much improved. + • Mutliple screens are now handled properly (untested) + • Better autolayout with GSTable and subclasses. + • NSOutlineView much improved. -1.48 Noteworthy changes in version '0.7.6' +1.50 Noteworthy changes in version ‘0.7.6’ ========================================== - * NSOutlineView implemented. - * Improvements to NSTableView, NSPopUpButton, NSTextView, NSFontPanel - * Scroll wheel support. - * Fully-functional keybindings, including multi-stroke keybindings. - * Memory panel available from Info Panel. + • NSOutlineView implemented. + • Improvements to NSTableView, NSPopUpButton, NSTextView, NSFontPanel + • Scroll wheel support. + • Fully-functional keybindings, including multi-stroke keybindings. + • Memory panel available from Info Panel. -1.49 Noteworthy changes in version '0.7.5' +1.51 Noteworthy changes in version ‘0.7.5’ ========================================== - * Drag and drop and image sliding much improved. - * Better handling of remote startup/display. - * Some localization. - * Keybinding support. - * Text handling improvements. - * New gopen command (like MacOSX open command). - * Implemented simple pagination and printing of views. - * Support for rulers. - * Spell checking support. - * Blinking insertion point. - * New NSStepper class. - * Implemented NSOutlineView, NSSelection, NSInputManager. - * Near rewrite of Menu handling code. - * Gmodel code compiled as a separate bundle. + • Drag and drop and image sliding much improved. + • Better handling of remote startup/display. + • Some localization. + • Keybinding support. + • Text handling improvements. + • New gopen command (like MacOSX open command). + • Implemented simple pagination and printing of views. + • Support for rulers. + • Spell checking support. + • Blinking insertion point. + • New NSStepper class. + • Implemented NSOutlineView, NSSelection, NSInputManager. + • Near rewrite of Menu handling code. + • Gmodel code compiled as a separate bundle. -1.50 Noteworthy changes in version '0.7.0' +1.52 Noteworthy changes in version ‘0.7.0’ ========================================== - * Much improvement in NSBrowser, NSMatrix, NSPopUpButton, combo + • Much improvement in NSBrowser, NSMatrix, NSPopUpButton, combo boxes. - * NSTextAttachement implemented, many other text improvements. - * Fonts cached in the frontend. - * Changes so that backend can be loaded as a bundle at runtime. - * simpler, faster compilation and installation. - * NSColorWell works. + • NSTextAttachement implemented, many other text improvements. + • Fonts cached in the frontend. + • Changes so that backend can be loaded as a bundle at runtime. + • simpler, faster compilation and installation. + • NSColorWell works. -1.51 Noteworthy changes in version '0.6.7' +1.53 Noteworthy changes in version ‘0.6.7’ ========================================== - * App Icons can support documents dropped using DnD. - * Added color conversions, working color picker and panel. - * Almost complete rewrite of NSBezierPath - * Loads of improvements to Text classes. - * NSImage, NSButton, NSCell, etc, implemented many missing methods. - * ...and even more changes to the Text classes. - * Starting implementation of printing. - * Scrollview fixes. - * Implemented deferred windows. - * NSTableView implemented. - * Implemented object value and formatter support in NSCell - * Support middle mouse button. + • App Icons can support documents dropped using DnD. + • Added color conversions, working color picker and panel. + • Almost complete rewrite of NSBezierPath + • Loads of improvements to Text classes. + • NSImage, NSButton, NSCell, etc, implemented many missing methods. + • ...and even more changes to the Text classes. + • Starting implementation of printing. + • Scrollview fixes. + • Implemented deferred windows. + • NSTableView implemented. + • Implemented object value and formatter support in NSCell + • Support middle mouse button. -1.52 Noteworthy changes in version '0.6.6' +1.54 Noteworthy changes in version ‘0.6.6’ ========================================== - * Window hints for motif and generic window managers. - * Major improvements to the text handling classes (NSText, + • Window hints for motif and generic window managers. + • Major improvements to the text handling classes (NSText, NSTextView, etc) - * Pasting of fonts and rulers. - * Much better RTF handling - * DnD for NSColorWell - * Much improved NSSplitView - * New classes - NSColorPanel, NSTableView - * NSScreen rewritten with full support for all methods and functions. - * Can use image reading routines from WindowMaker if available to + • Pasting of fonts and rulers. + • Much better RTF handling + • DnD for NSColorWell + • Much improved NSSplitView + • New classes - NSColorPanel, NSTableView + • NSScreen rewritten with full support for all methods and functions. + • Can use image reading routines from WindowMaker if available to read a variety of image formats besides TIFF. - * Many fixes to get the AppKit to work better with WindowMaker. - * Much better gmodel support (particularly with nibs translated from + • Many fixes to get the AppKit to work better with WindowMaker. + • Much better gmodel support (particularly with nibs translated from NeXT or OPENSTEP 4.2). - * Muh improved font classes and font support. + • Muh improved font classes and font support. In addition both the xgps and xdps backends have seen some large efficiency improvements. Much better font support. The xdps backend @@ -640,211 +723,211 @@ however, that the xdps backend is still considered experimental and you may have to deal with many problems in order to get it working. We recommend sticking with the xgps backend (the default) for now. -1.53 Noteworthy changes in version '0.6.5' +1.55 Noteworthy changes in version ‘0.6.5’ ========================================== Many of the basic GUI classes have been vastly improved or rewritten, thanks to Nicola Pero and many others. - * New Info Panel support - * New NSBezierPath - * Rewrite of several classes including Cell and Button classes. - * Rewrite of NSBrowser, NSSavePanel, menus, text classes, + • New Info Panel support + • New NSBezierPath + • Rewrite of several classes including Cell and Button classes. + • Rewrite of NSBrowser, NSSavePanel, menus, text classes, NSTableHeader. - * RTF Parser - * Implemented image caching. - * Implemented editing in Forms, Matricies. - * New autolayout classes GSHBox, GSTable, and GSVBox. - * Almost all back-end classes have been removed and code incorporated + • RTF Parser + • Implemented image caching. + • Implemented editing in Forms, Matricies. + • New autolayout classes GSHBox, GSTable, and GSVBox. + • Almost all back-end classes have been removed and code incorporated in a DPS-like graphics context structure. - * Better keyboard handling. - * NSHelpManager, NSComboBox, ProgressIndicator written. + • Better keyboard handling. + • NSHelpManager, NSComboBox, ProgressIndicator written. In addition a preliminary version of an Interface Builder (Gorm) has been written, thanks to Richard Frith-Macdonald -1.54 Noteworthy changes in version '0.6.0' +1.56 Noteworthy changes in version ‘0.6.0’ ========================================== -A Huge amount of progress, although a lot still needs to be done. It's +A Huge amount of progress, although a lot still needs to be done. It’s usable for a large base of moderately simple apps. Several NeXT/OpenStep apps and libraries have been ported with little changes. - * Drag and Drop support fleshed out but not completed. - * NSText and related classes rewritten. Basic functionality but much + • Drag and Drop support fleshed out but not completed. + • NSText and related classes rewritten. Basic functionality but much needs to be done to finish them off. - * nib2gmodel app works with MacOS-X - * Work done in minimizing the backend which allowed a lot of + • nib2gmodel app works with MacOS-X + • Work done in minimizing the backend which allowed a lot of functionality to move to the GNU library. - * Menu code rewritten. - * PopupButtons now work. - * Many new images - * Basic functionality for NSTabView - * Much better lockFocus support in NSView. Flipped views handled. - * Rewrite of NSSavePanel and NSOpenPanel - * Several fixes that at least double the speed of the gui. + • Menu code rewritten. + • PopupButtons now work. + • Many new images + • Basic functionality for NSTabView + • Much better lockFocus support in NSView. Flipped views handled. + • Rewrite of NSSavePanel and NSOpenPanel + • Several fixes that at least double the speed of the gui. -1.55 Noteworthy changes in version '0.5.5' +1.57 Noteworthy changes in version ‘0.5.5’ ========================================== Too extensive to list. - * A lot of rewritting has been done to the classes, with general + • A lot of rewritting has been done to the classes, with general cleanup of coordinate conversion code, etc. -1.56 Noteworthy changes in version '0.5.0' +1.58 Noteworthy changes in version ‘0.5.0’ ========================================== - * NSBrowser and NSBrowserCell have been implemented. There is one + • NSBrowser and NSBrowserCell have been implemented. There is one odd display artifact; lists which are smaller than the browser column area have the list justified to the bottom of the column versus the top of the column. This is actually an issue with NSMatrix and will be remedied when flip views are implemented. - * Two important optimizations that speed up the displaying of views + • Two important optimizations that speed up the displaying of views and flushing of windows have been implemented. Only the views that need display and those that produce visible effects on the screen receive the -drawRect: message. Flushing of windows occurs only in rectangles that get displayed not in the whole window. - * Rotation and scaling of views have been finally implemented. The + • Rotation and scaling of views have been finally implemented. The code requires backend support for changing the state of the graphics context accordingly. - * NSScrollView and NSClipView have been implemented. The current + • NSScrollView and NSClipView have been implemented. The current implemented behavior is to call the document view to display the exposed region. Copying on scroll will be supported soon, at least on Solaris DPS, where it seems the Postscript language has provisions for copying drawn regions of screen. Hopefully DGS will also have this facility by the end of the year. - * NSScroller has been completely reworked to gain speed by using + • NSScroller has been completely reworked to gain speed by using timer events. - * NSSlider has been implemented. Thanks to Frank Knobloch for + • NSSlider has been implemented. Thanks to Frank Knobloch for supporting this and the NSScrollView implementation. - * NSBox has been implemented. + • NSBox has been implemented. - * The library has been ported to work under Solaris with the native - DPS and the NeXT/Apple's Portable Distributed Objects (PDO) + • The library has been ported to work under Solaris with the native + DPS and the NeXT/Apple’s Portable Distributed Objects (PDO) environment. - * The library has been integrated with the makefile package so we now + • The library has been integrated with the makefile package so we now benefit from all of the features the makefile package gives us, especially the possibility to build shared libraries on various systems and having different types (debug and profile) of the library compiled at the same time. - * NSCell is able to continuosly send the action to the target while + • NSCell is able to continuosly send the action to the target while the user is tracking the mouse. - * Several cleanups and as usual, many bug fixes. + • Several cleanups and as usual, many bug fixes. -1.57 Noteworthy changes in version '0.3.0' +1.59 Noteworthy changes in version ‘0.3.0’ ========================================== - * Completely reworked the menu class. The NSMenu class is now + • Completely reworked the menu class. The NSMenu class is now inherited from NSObject and using the new implementation menus have been implemented for the XDPS backend (they have the look and feel of the NeXTStep menus!). - * NSRunLoop has been integrated with NSApplication. Using this + • NSRunLoop has been integrated with NSApplication. Using this capability time events have been implemented to NSEvent class. These events allow several improvements in the interaction between user and the graphic interface. - * NSMatrix has been reworked, it is now conforming to the OpenStep + • NSMatrix has been reworked, it is now conforming to the OpenStep specification and it knows all the selection modes. It uses time events to enhance the drawing speed during mouse drags. - * The initial implementation of NSForm has been made although it has + • The initial implementation of NSForm has been made although it has not been tested yet. - * NSPrinter has been implemented though it was not throughly tested; + • NSPrinter has been implemented though it was not throughly tested; thanks to Simon Frankau. - * Configure script has been changed to detect the underlaying + • Configure script has been changed to detect the underlaying Foundation library. The currently supported libraries are gnustep-base and libFoundation. - * Several cleanups have been made in a lot of classes: the + • Several cleanups have been made in a lot of classes: the retain/release policy has been fixed, the cell classes correctly implement the NSCopying protocol and many others. -1.58 Noteworthy changes in version '0.2.0' +1.60 Noteworthy changes in version ‘0.2.0’ ========================================== - * Additional NSImage and NSImageRep class work. Incorporated common + • Additional NSImage and NSImageRep class work. Incorporated common images for use with controls that were designed by Andrew Lindesay. - * Fill out implementation of NSColorWell class. + • Fill out implementation of NSColorWell class. - * Fill out implementation of NSColorList class. + • Fill out implementation of NSColorList class. - * Cleaned up the header files and added missing headers, methods, + • Cleaned up the header files and added missing headers, methods, categories, and protocols; thanks to Simon Frankau for much of this work. Major reorganization of header files. Types and constants were moved in the files they belong. Each header file includes - only the headers it really needs. Use '@class' to forward class + only the headers it really needs. Use ‘@class’ to forward class definitions instead of including the corresponding class file. - * Completely reworked the NSFont and NSFontManager classes so that + • Completely reworked the NSFont and NSFontManager classes so that NSUserDefaults is used for getting defaults and list of known fonts are maintained. - * Initial implementation of NSCursor class. + • Initial implementation of NSCursor class. - * Almost complete implementation of NSButton and NSButtonCell class. + • Almost complete implementation of NSButton and NSButtonCell class. Buttons can now display images and/or text, handles all of the OpenStep button types and styles. - * Fill out implementation of NSScroller class. + • Fill out implementation of NSScroller class. - * Put in underlying support for optimizing drawing; flushing of + • Put in underlying support for optimizing drawing; flushing of windows, backing store, and only display when needed. - * Many bug fixes and minor enhancements. + • Many bug fixes and minor enhancements. -1.59 Noteworthy changes in version '0.1.1' +1.61 Noteworthy changes in version ‘0.1.1’ ========================================== - * Almost complete implementation of the PXKMenu and PXKMenuCell + • Almost complete implementation of the PXKMenu and PXKMenuCell classes. - * Fill out implementation of NSFont and NSFontManager. + • Fill out implementation of NSFont and NSFontManager. - * Fill out implementation of NSColor including color spaces other + • Fill out implementation of NSColor including color spaces other than RGB. Now maintains the common colors as global variables. - * Integration with the Display Ghostscript System. This is mainly + • Integration with the Display Ghostscript System. This is mainly related to using the header files in the DPSclient library for defining the PostScript operator functions. - * Initial documentation set. + • Initial documentation set. - * Initial implementation of NSImage, NSImageRep, and NSImageRep + • Initial implementation of NSImage, NSImageRep, and NSImageRep subclass classes based upon work by Adam Fedor. - * Now requires the TIFF library for reading, writing, and + • Now requires the TIFF library for reading, writing, and manipulating tiff files and images. -1.60 Noteworthy changes in version '0.1.0' +1.62 Noteworthy changes in version ‘0.1.0’ ========================================== - * Integration of the GNUstep X/DPS GUI Backend. This has finally + • Integration of the GNUstep X/DPS GUI Backend. This has finally produced a set of core code with can display on X/Windows. Much of the X/Windows code has been written by Pascal Forget and integration efforts have been lead by Scott Christley . - * Some major directory reorganization for the new naming guidelines. + • Some major directory reorganization for the new naming guidelines. Headers previously in AppKit and DPSClient directories have been moved to gnustep/gui and gnustep/dps directores and symbol links are created for the AppKit and DPSClient directories. This should allow both GNUstep and other OpenStep implementations to reside on the same machine without conflicts. - Also see the 'ChangeLog' file for more detail. + Also see the ‘ChangeLog’ file for more detail. diff --git a/Version b/Version index 220a50e41..93a50d355 100644 --- a/Version +++ b/Version @@ -5,15 +5,15 @@ GNUSTEP_GUI_GCC=4.0.0 # Versions for libraries that gnustep-gui is dependent upon -GNUSTEP_GUI_BASE=1.28.0 +GNUSTEP_GUI_BASE=1.30.0 GNUSTEP_GUI_LIBTIFF=3.4 # The version number of this release. GNUSTEP_GUI_MAJOR_VERSION=0 -GNUSTEP_GUI_MINOR_VERSION=30 +GNUSTEP_GUI_MINOR_VERSION=31 GNUSTEP_GUI_SUBMINOR_VERSION=0 # numeric value should match above -VERSION_NUMBER=030.0 +VERSION_NUMBER=031.0 GNUSTEP_GUI_VERSION=${GNUSTEP_GUI_MAJOR_VERSION}.${GNUSTEP_GUI_MINOR_VERSION}.${GNUSTEP_GUI_SUBMINOR_VERSION} VERSION=${GNUSTEP_GUI_VERSION} From 7a98157dc7eba88cabd64655aa99cd1c7f8ce22e Mon Sep 17 00:00:00 2001 From: rfm Date: Thu, 30 May 2024 10:35:02 +0100 Subject: [PATCH 26/48] gnustep_global_lock is removed --- ChangeLog | 7 +++++++ Source/GSDisplayServer.m | 2 -- Source/NSGraphicsContext.m | 2 -- Source/NSWorkspace.m | 28 +++++++++++----------------- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c2b9b933..85ab0b9dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-05-30 Richard Frith-Macdonald + + * Source/GSDisplayServer.m: + * Source/NSGraphicsContext.m: + * Source/NSWorkspace.m: + Avoid using old gnustep_global_lock (removed from base) + 2024-05-26 Fred Kiefer * ChangeLog: Update for new release diff --git a/Source/GSDisplayServer.m b/Source/GSDisplayServer.m index 64577cde3..e5f494273 100644 --- a/Source/GSDisplayServer.m +++ b/Source/GSDisplayServer.m @@ -123,7 +123,6 @@ GSCurrentServer(void) { if (serverLock == nil) { - [gnustep_global_lock lock]; if (serverLock == nil) { serverLock = [NSRecursiveLock new]; @@ -132,7 +131,6 @@ GSCurrentServer(void) windowmaps = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 20); } - [gnustep_global_lock unlock]; } } diff --git a/Source/NSGraphicsContext.m b/Source/NSGraphicsContext.m index 5e7bef4cf..bcad98d26 100644 --- a/Source/NSGraphicsContext.m +++ b/Source/NSGraphicsContext.m @@ -138,7 +138,6 @@ NSGraphicsContext *GSCurrentContext(void) { if (contextLock == nil) { - [gnustep_global_lock lock]; if (contextLock == nil) { contextLock = [NSRecursiveLock new]; @@ -147,7 +146,6 @@ NSGraphicsContext *GSCurrentContext(void) classMethodTable = [[NSMutableDictionary allocWithZone: _globalGSZone] init]; } - [gnustep_global_lock unlock]; } } diff --git a/Source/NSWorkspace.m b/Source/NSWorkspace.m index 59629145f..0ed6dcef3 100644 --- a/Source/NSWorkspace.m +++ b/Source/NSWorkspace.m @@ -131,6 +131,7 @@ static NSImage *multipleFiles = nil; static NSImage *unknownApplication = nil; static NSImage *unknownTool = nil; +static NSLock *classLock = nil; static NSLock *mlock = nil; static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification"; @@ -598,26 +599,22 @@ static NSDictionary *urlPreferences = nil; { if (self == [NSWorkspace class]) { - static BOOL beenHere = NO; - NSFileManager *mgr = [NSFileManager defaultManager]; - NSString *service; - NSData *data; - NSDictionary *dict; - [self setVersion: 1]; - - [gnustep_global_lock lock]; - if (beenHere == YES) + if (classLock) { - [gnustep_global_lock unlock]; return; } - - beenHere = YES; + classLock = [NSLock new]; mlock = [NSLock new]; NS_DURING { + NSFileManager *mgr = [NSFileManager defaultManager]; + NSString *service; + NSData *data; + NSDictionary *dict; + + service = [[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex: 0] stringByAppendingPathComponent: @"Services"]; @@ -675,12 +672,9 @@ static NSDictionary *urlPreferences = nil; } NS_HANDLER { - [gnustep_global_lock unlock]; [localException raise]; } NS_ENDHANDLER - - [gnustep_global_lock unlock]; } } @@ -698,14 +692,14 @@ static NSDictionary *urlPreferences = nil; { if (sharedWorkspace == nil) { - [gnustep_global_lock lock]; + [classLock lock]; if (sharedWorkspace == nil) { sharedWorkspace = (NSWorkspace*)NSAllocateObject(self, 0, NSDefaultMallocZone()); [sharedWorkspace init]; } - [gnustep_global_lock unlock]; + [classLock unlock]; } return sharedWorkspace; } From f93ca6eeb64b437b6c77943628726217b807f3c2 Mon Sep 17 00:00:00 2001 From: rfm Date: Thu, 30 May 2024 11:15:19 +0100 Subject: [PATCH 27/48] Don't use lazy locks any more --- Source/NSAnimation.m | 6 +++--- Source/NSKeyValueBinding.m | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/NSAnimation.m b/Source/NSAnimation.m index 5165b4169..b60be90c9 100644 --- a/Source/NSAnimation.m +++ b/Source/NSAnimation.m @@ -35,7 +35,7 @@ #import #import #import -#import +#import #import "AppKit/NSAnimation.h" #import "AppKit/NSApplication.h" @@ -418,7 +418,7 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se (BOOL (*)(id,SEL,NSAnimation*)) NULL; _isThreaded = NO; - _isAnimatingLock = [GSLazyRecursiveLock new]; + _isAnimatingLock = [NSRecursiveLock new]; } return self; } @@ -430,7 +430,7 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se c->_progressMarks = GSIArrayCopyWithZone(_progressMarks, zone); c->_animator = nil; c->_isANewAnimatorNeeded = YES; - c->_isAnimatingLock = [GSLazyRecursiveLock new]; + c->_isAnimatingLock = [NSRecursiveLock new]; return c; } diff --git a/Source/NSKeyValueBinding.m b/Source/NSKeyValueBinding.m index 513e2ed4c..d5b9e2769 100644 --- a/Source/NSKeyValueBinding.m +++ b/Source/NSKeyValueBinding.m @@ -40,7 +40,7 @@ #import #import #import -#import +#import #import "AppKit/NSKeyValueBinding.h" #import "GSBindingHelpers.h" @@ -145,7 +145,7 @@ void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey, { if (self == [GSKeyValueBinding class]) { - bindingLock = [GSLazyRecursiveLock new]; + bindingLock = [NSRecursiveLock new]; classTable = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSObjectMapValueCallBacks, 128); objectTable = NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks, From 51ed6a9608e7dd6ecbb9c3826186b1e5ca0b48b9 Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 3 Jun 2024 16:06:00 +0100 Subject: [PATCH 28/48] Fix to work without fast enumeration, also fix codign style errors and compiler warnings about operator precedence. --- Tests/gui/NSButtonCell/encoding.m | 71 ++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 26 deletions(-) diff --git a/Tests/gui/NSButtonCell/encoding.m b/Tests/gui/NSButtonCell/encoding.m index a8ed7571b..9cbdb51f8 100644 --- a/Tests/gui/NSButtonCell/encoding.m +++ b/Tests/gui/NSButtonCell/encoding.m @@ -8,44 +8,57 @@ int main() { - START_SET("NSButtonCell encoding tests") + START_SET("NSButtonCell encoding tests") NS_DURING - { - [NSApplication sharedApplication]; - } + { + [NSApplication sharedApplication]; + } NS_HANDLER - { - if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) - SKIP("It looks like GNUstep backend is not yet installed") - } + { + if ([[localException name] + isEqualToString: NSInternalInconsistencyException ]) + { + SKIP("It looks like GNUstep backend is not yet installed") + } + } NS_ENDHANDLER - NSString* mask = @"NSButtonFlags2"; - NSButtonCell* item = [[NSButtonCell alloc] init]; + NSString *mask = @"NSButtonFlags2"; + NSButtonCell *item = [[NSButtonCell alloc] init]; + item.keyEquivalent = @"A"; item.keyEquivalentModifierMask = NSShiftKeyMask; - NSMutableData *data = [NSMutableData data]; - NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]; + NSMutableData *data = [NSMutableData data]; + NSKeyedArchiver *archiver; - [archiver encodeRootObject:item]; + archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData: data]; + + [archiver encodeRootObject: item]; [archiver finishEncoding]; - NSError* error; - NSDictionary* archive = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:nil error:&error]; + NSError *error; + NSDictionary *archive; - NSArray* topLevelObjects = [archive objectForKey:@"$objects"]; + archive = [NSPropertyListSerialization + propertyListWithData: data + options: NSPropertyListImmutable + format: nil + error: &error]; - NSDictionary* dict; + NSArray *topLevelObjects = [archive objectForKey: @"$objects"]; + NSEnumerator *enumerator = [topLevelObjects objectEnumerator]; + NSDictionary *dict; + id element; - for (id element in topLevelObjects) + while ((element = [enumerator nextObject]) != nil) { - if ([element isKindOfClass:[NSDictionary class]]) + if ([element isKindOfClass: [NSDictionary class]]) { dict = (NSDictionary*)element; - if ([[dict allKeys] containsObject:mask]) + if ([[dict allKeys] containsObject: mask]) { break; } @@ -53,14 +66,20 @@ int main() { dict = nil; } - } - } + } + } PASS(dict != nil, "Found a dict with a NSButtonFlags2 entry"); - NSNumber* encodedKeyMask = [dict valueForKey:mask]; + NSNumber *encodedKeyMask = [dict valueForKey: mask]; + int expect = (NSShiftKeyMask << 8); + int modMask = (NSEventModifierFlagDeviceIndependentFlagsMask << 8); + int found = [encodedKeyMask intValue] & modMask; + PASS(encodedKeyMask != nil, "Retrieved the NSButtonFlags2 value"); - PASS([encodedKeyMask intValue] & NSEventModifierFlagDeviceIndependentFlagsMask << 8 == NSShiftKeyMask, "Encoded key mask 0x%x matches expected key mask 0x%x", [encodedKeyMask intValue] & NSEventModifierFlagDeviceIndependentFlagsMask << 8, NSShiftKeyMask << 8); + PASS(found == expect, + "Encoded key mask 0x%x matches expected key mask 0x%x", + found, expect); - END_SET("NSButtonCell encoding tests") -} \ No newline at end of file + END_SET("NSButtonCell encoding tests") +} From d312fbe168fe191dd382647897a855a9aac18da7 Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 3 Jun 2024 16:55:33 +0100 Subject: [PATCH 29/48] Fix for #276 --- Source/NSMenuItem.m | 15 +++++++------- Tests/gui/NSNibLoading/basic.m | 38 ++++++++++++++++++++-------------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/Source/NSMenuItem.m b/Source/NSMenuItem.m index b482cd7c2..0c00d0adf 100644 --- a/Source/NSMenuItem.m +++ b/Source/NSMenuItem.m @@ -650,7 +650,6 @@ static Class imageClass; NSString *action; NSString *key; BOOL isSeparator = NO; - NSNumber *keyMask; if ([aDecoder containsValueForKey: @"NSIsSeparator"]) { @@ -703,13 +702,13 @@ static Class imageClass; [self setSubmenu: submenu]; } - // Set the key mask when it is present; or default to NSCommandKeyMask - // when not specified - keyMask = (NSNumber*)[aDecoder decodeObjectForKey: @"NSKeyEquivModMask"]; - - if (keyMask != nil) - { - [self setKeyEquivalentModifierMask: [keyMask intValue]]; + /* Set the key mask when it is present; or default to NSCommandKeyMask + * when not specified + */ + if ([aDecoder containsValueForKey: @"NSKeyEquivModMask"]) + { + [self setKeyEquivalentModifierMask: + [aDecoder decodeIntegerForKey: @"NSKeyEquivModMask"]]; } else { diff --git a/Tests/gui/NSNibLoading/basic.m b/Tests/gui/NSNibLoading/basic.m index 8b51cb285..ee06f61cd 100644 --- a/Tests/gui/NSNibLoading/basic.m +++ b/Tests/gui/NSNibLoading/basic.m @@ -16,24 +16,27 @@ int main() { - NSAutoreleasePool *arp = [NSAutoreleasePool new]; - NSArray **testObjects; - BOOL success = NO; - NSFileManager *mgr = [NSFileManager defaultManager]; - NSString *path = [mgr currentDirectoryPath]; - NSBundle *bundle = [[NSBundle alloc] initWithPath: path]; + NSAutoreleasePool *arp = [NSAutoreleasePool new]; + NSArray **testObjects = NULL; + BOOL success = NO; + NSFileManager *mgr = [NSFileManager defaultManager]; + NSString *path = [mgr currentDirectoryPath]; + NSBundle *bundle = [[NSBundle alloc] initWithPath: path]; START_SET("NSNibLoading GNUstep basic") NS_DURING - { - [NSApplication sharedApplication]; - } + { + [NSApplication sharedApplication]; + } NS_HANDLER - { - if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) - SKIP("It looks like GNUstep backend is not yet installed") - } + { + if ([[localException name] + isEqualToString: NSInternalInconsistencyException]) + { + SKIP("It looks like GNUstep backend is not yet installed") + } + } NS_ENDHANDLER if ([[path lastPathComponent] isEqualToString: @"obj"]) @@ -49,19 +52,22 @@ int main() owner: [NSApplication sharedApplication] topLevelObjects: testObjects]; - PASS(success == YES, ".gorm file was loaded properly using loadNibNamed:owner:topLevelObjects:"); + PASS(success == YES, ".gorm file was loaded properly" + " using loadNibNamed:owner:topLevelObjects:"); success = [bundle loadNibNamed: @"Test-xib" owner: [NSApplication sharedApplication] topLevelObjects: testObjects]; - PASS(success == YES, ".xib file was loaded properly using loadNibNamed:owner:topLevelObjects:"); + PASS(success == YES, ".xib file was loaded properly" + " using loadNibNamed:owner:topLevelObjects:"); success = [bundle loadNibNamed: @"Test-nib" owner: [NSApplication sharedApplication] topLevelObjects: testObjects]; - PASS(success == YES, ".nib file was loaded properly using loadNibNamed:owner:topLevelObjects:"); + PASS(success == YES, ".nib file was loaded properly" + " using loadNibNamed:owner:topLevelObjects:"); } NS_HANDLER { From 71b82ee7a2e9f4630604962de3beae4b810f5641 Mon Sep 17 00:00:00 2001 From: rfm Date: Wed, 5 Jun 2024 12:14:42 +0100 Subject: [PATCH 30/48] Fixup testcase to actually work on gcc systems etc --- Tests/gui/NSMenuItem/encoding.m | 50 ++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/Tests/gui/NSMenuItem/encoding.m b/Tests/gui/NSMenuItem/encoding.m index 40b275362..8b4862a75 100644 --- a/Tests/gui/NSMenuItem/encoding.m +++ b/Tests/gui/NSMenuItem/encoding.m @@ -7,30 +7,42 @@ int main() { - NSString* mask = @"NSKeyEquivModMask"; - NSMenuItem* item = [[NSMenuItem alloc] init]; + START_SET("NSMenuItem key equivalent mask") + + NSString *mask = @"NSKeyEquivModMask"; + NSMenuItem *item = [[NSMenuItem alloc] init]; + NSMutableData *data = [NSMutableData data]; + NSNumber *encodedKeyMask; + NSError *error = nil; + NSDictionary *dict = nil; + NSArray *topLevelObjects; + NSKeyedArchiver *archiver; + NSDictionary *archive; + NSEnumerator *enumerator; + id element; + item.keyEquivalentModifierMask = NSShiftKeyMask; - NSMutableData *data = [NSMutableData data]; - NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]; + archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData: data]; - [archiver encodeRootObject:item]; + [archiver encodeRootObject: item]; [archiver finishEncoding]; - NSError* error; - NSDictionary* archive = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:nil error:&error]; + archive = [NSPropertyListSerialization propertyListWithData: data + options: NSPropertyListImmutable + format: nil + error: &error]; - NSArray* topLevelObjects = [archive objectForKey:@"$objects"]; + topLevelObjects = [archive objectForKey: @"$objects"]; + enumerator = [topLevelObjects objectEnumerator]; - NSDictionary* dict; - - for (id element in topLevelObjects) + while ((element = [enumerator nextObject]) != nil) { - if ([element isKindOfClass:[NSDictionary class]]) + if ([element isKindOfClass: [NSDictionary class]]) { dict = (NSDictionary*)element; - if ([[dict allKeys] containsObject:mask]) + if ([[dict allKeys] containsObject: mask]) { break; } @@ -43,7 +55,11 @@ int main() PASS(dict != nil, "Found a dict with a NSKeyEquivModMask entry"); - NSNumber* encodedKeyMask = [dict valueForKey:mask]; - PASS(encodedKeyMask != nil, "Retrieved the NSKeyEquivModMask value"); - PASS([encodedKeyMask intValue] == NSShiftKeyMask, "Encoded key mask 0x%x matches expected key mask 0x%x", [encodedKeyMask intValue], NSShiftKeyMask); -} \ No newline at end of file + encodedKeyMask = [dict valueForKey: mask]; + PASS(encodedKeyMask != nil, "Retrieved the NSKeyEquivModMask value") + PASS([encodedKeyMask intValue] == NSShiftKeyMask, + "Encoded key mask 0x%x matches expected key mask 0x%x", + [encodedKeyMask intValue], NSShiftKeyMask) + + END_SET("NSMenuItem key equivalent mask") +} From a5410d9dc63dd69c810fb4c6c6fd5275ef59b80e Mon Sep 17 00:00:00 2001 From: rfm Date: Thu, 6 Jun 2024 10:38:15 +0100 Subject: [PATCH 31/48] Ready for bugfix release --- ANNOUNCE | 55 +-- ChangeLog | 13 + Documentation/news.texi | 13 +- NEWS | 906 ++++++++++++++++++++-------------------- Version | 4 +- 5 files changed, 494 insertions(+), 497 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 23a487998..a0005b33f 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,13 +1,13 @@ 1 Announcement ************** -This is version 0.31.0 of the GNUstep GUI library (‘gnustep-gui’). +This is version 0.31.1 of the GNUstep GUI library ('gnustep-gui'). 1.1 What is the GNUstep GUI Library? ==================================== It is a library of graphical user interface classes written completely -in the Objective-C language; the classes are based upon Apple’s Cocoa +in the Objective-C language; the classes are based upon Apple's Cocoa framework. The library has been enhanced in a number of ways to take advantage of the GNU system. These classes include graphical objects such as buttons, text fields, popup lists, browser lists, and windows; @@ -25,65 +25,32 @@ systems. The GNUstep GUI Library requires the GNU Objective-C compiler, the GNUstep Base Library, the TIFF Graphics library, Independent JPEG -Group’s libjpeg library, and a back-end component from the GNUstep -’Back’ library. +Group's libjpeg library, and a back-end component from the GNUstep +'Back' library. Additional functionality may be enabled by installing additional libraries. For example, to build the Cairo backend in the GNUstep Back library, you will need to install Cairo. -1.2 Noteworthy changes in version ‘0.31.0’ +1.2 Noteworthy changes in version '0.31.1' ========================================== -This version adds view based cell support for NSTableView and -NSOutlineView. Plus the usual bunch of bug fixes. +This is a bugfix release - • Add TGA detection for ImageMagick extension. - • Correct endianess swapping for saving 16 and 32 bit TIFF images. - • NSParagraphStyle restore old behaviour to have default tab stops. - • Documentation updates. - • A fix for autogsdoc documentation creation. - • Improve theming for many classes. - • Correct keyEquivalentModifierMask decoding in XIB files. - • Add imageViewWithImage: to NSImageView. - • Add implementation of NSUserInterfaceItemIdentifier to NSView. - • Fix NSImageView intercepting mouse events when not editable - • Move NSBox method isOpaque to GSTheme. - • Many decoding improvements. - • Fix compiler warnings. - • Generate and install a gnustep-gui.pc file. - • Add support for NSFilenamenPboardType in NSTextView. - • Add support for NSPasteboardTypePNG in NSBitmapImageRep if the - libpng is present. - • Add support for ImageMagick >= 7.0 - • Increase pasteboard timeout to 30 seconds. - • Add NSAppearance implementation. - • Make PACKAGE_SCOPE public on MinGW. - • Started implementing NSShadow. - • Move awakeFromNib implementation to NSObject instead of NSView. - • Changes for libGIF 5.2 and later. - • Update NSViewController with lifeCycle methods. - • Avoid accessing instance variables in inline functions when - compiling with MSVC. - • Add method removeAllItems to NSMenu. - • Add badge handling to NSDockTile. - • More improvements to layout constraints. - • Add implementation of NSDictionaryController. - • Add implementation of the NSCollectionView classes. - • Improve NSDrawer opening. - • Improver CI pipeline. + * Fix bug decoding menu items (breaking archive) + * Remove use of deprecated lock from base library 1.3 Where can you get it? How can you compile it? ================================================= -The gnustep-gui-0.31.0.tar.gz distribution file has been placed at +The gnustep-gui-0.31.1.tar.gz distribution file has been placed at . - It is accompanied by gnustep-gui-0.31.0.tar.gz.sig, a PGP signature + It is accompanied by gnustep-gui-0.31.1.tar.gz.sig, a PGP signature which you can validate by putting both files in the same directory and using: - gpg --verify gnustep-gui-0.31.0.tar.gz.sig + gpg --verify gnustep-gui-0.31.1.tar.gz.sig Signature has been created using the key with the following fingerprint: diff --git a/ChangeLog b/ChangeLog index 85ab0b9dc..79a19738e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2024-06-05 Richard Frith-Macdonald + + * ChangeLog: Update for new release + * ANNOUNCE: + * NEWS: + * Documentation/news.texi: Update of release notes for 0.31.1. + * Version: bump to 0.31.1 + +2024-06-03 Richard Frith-Macdonald + + * Source/NSMenuitem.m: + Fix bug in decoding of archived menu item modifier mask. + 2024-05-30 Richard Frith-Macdonald * Source/GSDisplayServer.m: diff --git a/Documentation/news.texi b/Documentation/news.texi index 2784d3d77..ffee7fb8e 100644 --- a/Documentation/news.texi +++ b/Documentation/news.texi @@ -9,6 +9,17 @@ The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}. @end ifclear +@section Noteworthy changes in version @samp{0.31.1} + +This is a bugfix release + +@itemize @bullet +@item Fix bug decoding menu items (breaking archive) +@item Remove use of deprecated lock from base library +@end itemize + +@ifclear ANNOUNCE-ONLY + @section Noteworthy changes in version @samp{0.31.0} This version adds view based cell support for NSTableView and NSOutlineView. @@ -49,8 +60,6 @@ Plus the usual bunch of bug fixes. @item Improver CI pipeline. @end itemize -@ifclear ANNOUNCE-ONLY - @section Noteworthy changes in version @samp{0.30.0} This version adds parsing support for layout constraints, compilation with MSVC diff --git a/NEWS b/NEWS index f4afc383d..7372f063d 100644 --- a/NEWS +++ b/NEWS @@ -1,99 +1,107 @@ 1 NEWS ****** -The currently released version of the library is ‘0.31.0’. +The currently released version of the library is '0.31.1'. -1.1 Noteworthy changes in version ‘0.31.0’ +1.1 Noteworthy changes in version '0.31.1' +========================================== + +This is a bugfix release + + * Fix bug decoding menu items (breaking archive) + * Remove use of deprecated lock from base library + +1.2 Noteworthy changes in version '0.31.0' ========================================== This version adds view based cell support for NSTableView and NSOutlineView. Plus the usual bunch of bug fixes. - • Add TGA detection for ImageMagick extension. - • Correct endianess swapping for saving 16 and 32 bit TIFF images. - • NSParagraphStyle restore old behaviour to have default tab stops. - • Documentation updates. - • A fix for autogsdoc documentation creation. - • Improve theming for many classes. - • Correct keyEquivalentModifierMask decoding in XIB files. - • Add imageViewWithImage: to NSImageView. - • Add implementation of NSUserInterfaceItemIdentifier to NSView. - • Fix NSImageView intercepting mouse events when not editable - • Move NSBox method isOpaque to GSTheme. - • Many decoding improvements. - • Fix compiler warnings. - • Generate and install a gnustep-gui.pc file. - • Add support for NSFilenamenPboardType in NSTextView. - • Add support for NSPasteboardTypePNG in NSBitmapImageRep if the + * Add TGA detection for ImageMagick extension. + * Correct endianess swapping for saving 16 and 32 bit TIFF images. + * NSParagraphStyle restore old behaviour to have default tab stops. + * Documentation updates. + * A fix for autogsdoc documentation creation. + * Improve theming for many classes. + * Correct keyEquivalentModifierMask decoding in XIB files. + * Add imageViewWithImage: to NSImageView. + * Add implementation of NSUserInterfaceItemIdentifier to NSView. + * Fix NSImageView intercepting mouse events when not editable + * Move NSBox method isOpaque to GSTheme. + * Many decoding improvements. + * Fix compiler warnings. + * Generate and install a gnustep-gui.pc file. + * Add support for NSFilenamenPboardType in NSTextView. + * Add support for NSPasteboardTypePNG in NSBitmapImageRep if the libpng is present. - • Add support for ImageMagick >= 7.0 - • Increase pasteboard timeout to 30 seconds. - • Add NSAppearance implementation. - • Make PACKAGE_SCOPE public on MinGW. - • Started implementing NSShadow. - • Move awakeFromNib implementation to NSObject instead of NSView. - • Changes for libGIF 5.2 and later. - • Update NSViewController with lifeCycle methods. - • Avoid accessing instance variables in inline functions when + * Add support for ImageMagick >= 7.0 + * Increase pasteboard timeout to 30 seconds. + * Add NSAppearance implementation. + * Make PACKAGE_SCOPE public on MinGW. + * Started implementing NSShadow. + * Move awakeFromNib implementation to NSObject instead of NSView. + * Changes for libGIF 5.2 and later. + * Update NSViewController with lifeCycle methods. + * Avoid accessing instance variables in inline functions when compiling with MSVC. - • Add method removeAllItems to NSMenu. - • Add badge handling to NSDockTile. - • More improvements to layout constraints. - • Add implementation of NSDictionaryController. - • Add implementation of the NSCollectionView classes. - • Improve NSDrawer opening. - • Improver CI pipeline. + * Add method removeAllItems to NSMenu. + * Add badge handling to NSDockTile. + * More improvements to layout constraints. + * Add implementation of NSDictionaryController. + * Add implementation of the NSCollectionView classes. + * Improve NSDrawer opening. + * Improver CI pipeline. -1.2 Noteworthy changes in version ‘0.30.0’ +1.3 Noteworthy changes in version '0.30.0' ========================================== This version adds parsing support for layout constraints, compilation with MSVC and many new classes. Plus the usual bunch of bug fixes. - • Add classes NSStackView, NSGlyphInfo. - • Add more formal protocols to headers. - • Add extra pixels so that tool tip doesn’t overrun the window. - • More improvements from Testplant. - • NSSplitView support different divider styles. - • Improve on Wayland support. - • NSPopUpButtonCell attempt to fix deallocation and item selection. - • NSImageCell fix refuse first responder. - • Improve NIB and XIB unarchiving. - • GSStandardWindowDecorationView fix resizing mode - • Make resize bar notch themable. - • NSButton add radio button behavior from MacOS 10.7. - • Fix clicking on test attachment cells. - • Add missing methods to GSLayoutManager. - • Add NSLayoutConstraint parsing. - • Add APPKIT_EXPORT_CLASS to support compilation with MSVC. - • Remove libgnustep-gui_INTERFACE_VERSION. - • Fix to build GSSpell in custom build dir. - • Add all new header files to DocMakefile. - • Fix memory leaks in NSView, NSTextView and NSBox. - • Add placeholder string handling in NSTextField.m. - • Apply userSpaceScaleFactor to title bar height when calculating + * Add classes NSStackView, NSGlyphInfo. + * Add more formal protocols to headers. + * Add extra pixels so that tool tip doesn't overrun the window. + * More improvements from Testplant. + * NSSplitView support different divider styles. + * Improve on Wayland support. + * NSPopUpButtonCell attempt to fix deallocation and item selection. + * NSImageCell fix refuse first responder. + * Improve NIB and XIB unarchiving. + * GSStandardWindowDecorationView fix resizing mode + * Make resize bar notch themable. + * NSButton add radio button behavior from MacOS 10.7. + * Fix clicking on test attachment cells. + * Add missing methods to GSLayoutManager. + * Add NSLayoutConstraint parsing. + * Add APPKIT_EXPORT_CLASS to support compilation with MSVC. + * Remove libgnustep-gui_INTERFACE_VERSION. + * Fix to build GSSpell in custom build dir. + * Add all new header files to DocMakefile. + * Fix memory leaks in NSView, NSTextView and NSBox. + * Add placeholder string handling in NSTextField.m. + * Apply userSpaceScaleFactor to title bar height when calculating offsets. - • Add new constants from MacOS 10.14 to NSBezierPath. - • Add README.md file. - • Add helper methods in GSWindowDecorator protocol for pointer hit + * Add new constants from MacOS 10.14 to NSBezierPath. + * Add README.md file. + * Add helper methods in GSWindowDecorator protocol for pointer hit test on window decorations. - • Improve support for 16 bit colour values in images. - • NSTextStorage update signatures to match MacOS. - • Add a preference to disable spellchecker. - • Fix crash in JPEG reading. - • Improve NSPopover and NSAccessibilityCustomAction. - • Support ImageMagick version >= 7. - • Add github workflow. - • Add icon for speech synthesizer. + * Improve support for 16 bit colour values in images. + * NSTextStorage update signatures to match MacOS. + * Add a preference to disable spellchecker. + * Fix crash in JPEG reading. + * Improve NSPopover and NSAccessibilityCustomAction. + * Support ImageMagick version >= 7. + * Add github workflow. + * Add icon for speech synthesizer. -1.3 Noteworthy changes in version ‘0.29.0’ +1.4 Noteworthy changes in version '0.29.0' ========================================== This version adds support for storyboard files and many new classes. Plus the usual bunch of bug fixes. - • Support loading of storyboard files. - • Add classes NSSwitch, NSFontAssetRequest, + * Support loading of storyboard files. + * Add classes NSSwitch, NSFontAssetRequest, NSMediaLibraryBrowserController, NSScrubberItemView, NSScrubberLayout, NSScrubber, NSSharingServicePickerToolbarItem, NSPathCell, NSPathComponentCell, NSPathControl, NSPathControlItem, @@ -104,34 +112,34 @@ Plus the usual bunch of bug fixes. NSLayoutConstraint, NSLayoutGuide, NSStatusBarButton, NSTextCheckingController, NSTextFinder, NSTextInputContext, NSGridView. Some of these classes are still skeletons. - • Fix extraline fragment in text layout. - • Better encoding handling in RTF files. - • Add more italian translations. - • Add MacOSX methods to NSNib, NSMenu and NSWindow. - • Focus handling fixes for WindowMaker. - • Fix missing colours when loading old colour lists. - • Support JPEG export as greyscale image. - • Fix memory leak in NSPopupButtonCell. - • Fix toolbar flickering. - • NSSearchFieldCell use code from GSTheme to display popup. - • Fix int decoding to get it working on 64 bit big endian machines. - • Add tab stops after last defined at default intervals. - • Stop NSWindow from handling windows that are gone, but possibly + * Fix extraline fragment in text layout. + * Better encoding handling in RTF files. + * Add more italian translations. + * Add MacOSX methods to NSNib, NSMenu and NSWindow. + * Focus handling fixes for WindowMaker. + * Fix missing colours when loading old colour lists. + * Support JPEG export as greyscale image. + * Fix memory leak in NSPopupButtonCell. + * Fix toolbar flickering. + * NSSearchFieldCell use code from GSTheme to display popup. + * Fix int decoding to get it working on 64 bit big endian machines. + * Add tab stops after last defined at default intervals. + * Stop NSWindow from handling windows that are gone, but possibly returned by a slow window manager. - • Fix NSTableView/NSTableColumn bindings. + * Fix NSTableView/NSTableColumn bindings. -1.4 Noteworthy changes in version ‘0.28.0’ +1.5 Noteworthy changes in version '0.28.0' ========================================== This version adds support for modern XIB files and many new classes. Plus the usual bunch of bug fixes. - • Support loading of document XIB files. - • Improve Key Value Binding for NSArrayController and add more + * Support loading of document XIB files. + * Improve Key Value Binding for NSArrayController and add more bindings. - • Better support for multi monitor usage and other improvement in the + * Better support for multi monitor usage and other improvement in the backend integration. - • Add classes NSFontCollection, NSColorSampler, NSSpeechRecognizer, + * Add classes NSFontCollection, NSColorSampler, NSSpeechRecognizer, NSAppearance, NSPDFInfo, NSPICTImageRep, NSCIImageRep, NSPDFImageRep, NSPDFPanel, NSDataAsset, NSDatePicker, NSDatePickerCell, NSPredicateEditor, NSPredicateEditorRowTemplate, @@ -144,52 +152,52 @@ Plus the usual bunch of bug fixes. NSRotationGestureRecognizer, NSSharingServicePickerTouchBarItem, NSSliderTouchBarItem, NSStepperTouchBarItem, NSTouchBarItem, NSTouchBar, NSTouch, NSDockTile. - • Implement NSEPSImageRep. - • Better encoding handling in RTF files. - • Theming and drawing improvements. - • Increase small font size to 10. - • New cursor and stepper images. - • Move NSFileWrapper to Foundation. - • Fixed build on Debian GNU/kFreeBSD. - • With command line argument -autolaunch YES, do not activate the + * Implement NSEPSImageRep. + * Better encoding handling in RTF files. + * Theming and drawing improvements. + * Increase small font size to 10. + * New cursor and stepper images. + * Move NSFileWrapper to Foundation. + * Fixed build on Debian GNU/kFreeBSD. + * With command line argument -autolaunch YES, do not activate the application when -activateIgnoringOtherApps: is invoked. - • Improvements to WindowMaker compatibility (e.g. WMFHideApplication + * Improvements to WindowMaker compatibility (e.g. WMFHideApplication support). - • Lowered NSFloatingWindowLevel by one to distinguish floating panels + * Lowered NSFloatingWindowLevel by one to distinguish floating panels from menus. -1.5 Noteworthy changes in version ‘0.27.0’ +1.6 Noteworthy changes in version '0.27.0' ========================================== This version includes numerous bugfixes, compatibility improvements and other changes accumulated over the last year. It also enables work to be done on integrating NSViews with a Core Animation renderer. - • Make targetForAction safer. - • Speed up menu updates. - • Clean up speech tool compilation and switch to newer interface. - • Fix bug in CUPS subclassing introduced in last release. - • Minor improvements to typesetting. - • Add NSIsControllerMarker. - • Fix tracking on segmented cell. - • Bring slider cell closer to Cocoa implementation. - • Add ivar for Core Animation in NSView. - • Improve border calculation on printing. - • Lazy load app icon. - • Better detection of removable volumes. - • Polish translations. - • Japanese translations. - • Lots of bug fixes. + * Make targetForAction safer. + * Speed up menu updates. + * Clean up speech tool compilation and switch to newer interface. + * Fix bug in CUPS subclassing introduced in last release. + * Minor improvements to typesetting. + * Add NSIsControllerMarker. + * Fix tracking on segmented cell. + * Bring slider cell closer to Cocoa implementation. + * Add ivar for Core Animation in NSView. + * Improve border calculation on printing. + * Lazy load app icon. + * Better detection of removable volumes. + * Polish translations. + * Japanese translations. + * Lots of bug fixes. -1.6 Noteworthy changes in version ‘0.26.2’ +1.7 Noteworthy changes in version '0.26.2' ========================================== This version is a small, but important bugfix release. - • printing: Fix allocation of the CUPS printing classes. - • installation: Fix the configure script. + * printing: Fix allocation of the CUPS printing classes. + * installation: Fix the configure script. -1.7 Noteworthy changes in version ‘0.26.1’ +1.8 Noteworthy changes in version '0.26.1' ========================================== This version is released to conincide with version 1.25.1 of @@ -200,7 +208,7 @@ gnustep-gui and gnustep-back. Runtime (libobjc2) and non-fragile ABI to avoid a bug in interaction between the clang compiler and the runtime when non-fragile ABI is in use. Specifically, Clang and the runtime may disagree on what is the -offset of an ivar in a class’s RAM. This manifested in a crash at +offset of an ivar in a class's RAM. This manifested in a crash at application startup due to misalignment of _gcontext inside NSThread. See the mailing list discussion (http://lists.gnu.org/archive/html/discuss-gnustep/2017-12/msg00129.html) @@ -208,15 +216,15 @@ for more information. It also contains the following changes: - • tests: Cleanup of warnings. - • tests: Fix text system deallocation test. - • printing: Undefine __BLOCKS__ before including cups.h, as some + * tests: Cleanup of warnings. + * tests: Fix text system deallocation test. + * printing: Undefine __BLOCKS__ before including cups.h, as some versions of the header expect that libdispatch is present and used if __BLOCKS__ is defined. - • graphics context: Workaround for Clang+libobjc2+nonfragile ABI + * graphics context: Workaround for Clang+libobjc2+nonfragile ABI issue. -1.8 Noteworthy changes in version ‘0.26.0’ +1.9 Noteworthy changes in version '0.26.0' ========================================== This version was bumped due to previous binary incompatibilities between @@ -225,108 +233,108 @@ improvements from the Summer of Code project, and a wide variety of other fixes. Notably, it fixes the use of cupsGetPPD() in the printing system. - • printing: Add an include to get deprecated function cupsGetPPD() on + * printing: Add an include to get deprecated function cupsGetPPD() on newer CUPS systems. - • chore: Bump required base version. - • tiff: Support for writing resolution. - • jpeg: Save resolution information if it is different from 72 dpi. - • save panel: Fix return type of sorting function. - • events: Add some newer Cocoa enums and one method with dummy + * chore: Bump required base version. + * tiff: Support for writing resolution. + * jpeg: Save resolution information if it is different from 72 dpi. + * save panel: Fix return type of sorting function. + * events: Add some newer Cocoa enums and one method with dummy implementation. - • speech synthesis: NSSpeechSynthesizerDelegate is now a @protocol on + * speech synthesis: NSSpeechSynthesizerDelegate is now a @protocol on runtimes that support it. - • pasteboard: New type identifiers. - • translations: Some work on Polish, Russian and German translations - • cell: Improvements to mouse tracking logic on NSCell. - • image: If an unknown named image is unarchived with a coder or + * pasteboard: New type identifiers. + * translations: Some work on Polish, Russian and German translations + * cell: Improvements to mouse tracking logic on NSCell. + * image: If an unknown named image is unarchived with a coder or keyed coder, keep the name. - • screen: Add -backingScaleFactor and return 1.0. - • window: Return 1.0 from -backingScaleFactor. + * screen: Add -backingScaleFactor and return 1.0. + * window: Return 1.0 from -backingScaleFactor. - • compatibility: Numerous stub implementations of constants, classes + * compatibility: Numerous stub implementations of constants, classes and methods to improve source-level compatibility. - • other bugfixes + * other bugfixes -1.9 Noteworthy changes in version ‘0.25.1’ -========================================== - - • JPEG (saving) alpha channel fixes and size with resolution != 72 - • JPEG resolution read support - • TIFF saving fixes - • Improved volumes mounting and support - • Portability improvements in volume mounting and support - • Corrected layout of empty strings - • Only update visible menus - -1.10 Noteworthy changes in version ‘0.25.0’ +1.10 Noteworthy changes in version '0.25.1' =========================================== - • Fixes for new GIF library versions - • Theming of named images for specific applications by the use of the - CFBundleIdentifier in the theme - • New icons and corresponding constants for special folders, recycler - and others - • Improvements in NSWorkspace icon lookup - • Improvements in removable media commands, imported and cleaned from - GWorkspace - • Numerous bug fixes and improvements in Cocoa compatibility - • Numerous theme tweaks - • Spanish locale + * JPEG (saving) alpha channel fixes and size with resolution != 72 + * JPEG resolution read support + * TIFF saving fixes + * Improved volumes mounting and support + * Portability improvements in volume mounting and support + * Corrected layout of empty strings + * Only update visible menus -1.11 Noteworthy changes in version ‘0.24.1’ +1.11 Noteworthy changes in version '0.25.0' +=========================================== + + * Fixes for new GIF library versions + * Theming of named images for specific applications by the use of the + CFBundleIdentifier in the theme + * New icons and corresponding constants for special folders, recycler + and others + * Improvements in NSWorkspace icon lookup + * Improvements in removable media commands, imported and cleaned from + GWorkspace + * Numerous bug fixes and improvements in Cocoa compatibility + * Numerous theme tweaks + * Spanish locale + +1.12 Noteworthy changes in version '0.24.1' =========================================== From a look through ChangeLog, we can see a lot of bugfixes for this release, with the main focus on avoiding display glitches and improving OSX compatibility. -1.12 Noteworthy changes in version ‘0.24.0’ +1.13 Noteworthy changes in version '0.24.0' =========================================== New features include: - • Require newer base release as we moved the + * Require newer base release as we moved the -replaceObject:withObject: of NSKeyedUnarchiver there. - • Support for newer releases of the gif library. - • NSTabView is now flipped. - • Theme improvements and changes to image mapping. + * Support for newer releases of the gif library. + * NSTabView is now flipped. + * Theme improvements and changes to image mapping. Many bugfixes. -1.13 Noteworthy changes in version ‘0.23.1’ +1.14 Noteworthy changes in version '0.23.1' =========================================== This is a bugfix release, primarily to deal with coding/archiving issues. -1.14 Noteworthy changes in version ‘0.22.0’ +1.15 Noteworthy changes in version '0.22.0' =========================================== New features include: - • This version is binary incompatible with previous versions due to + * This version is binary incompatible with previous versions due to the change of NSNotFound in GNUstep base. - • Support for drawing the GUI with a scale factor, for high-DPI + * Support for drawing the GUI with a scale factor, for high-DPI monitors. - • Character panel - • Color picker “Magnifier” tool, for grabbing the color of arbitrary + * Character panel + * Color picker "Magnifier" tool, for grabbing the color of arbitrary parts of the screen Many NSImage improvements (Mac OS X 10.6 drawing methods, better selection of image reps, better support for icons). Many bugfixes, including in Xib loading, printing, and NSView geometry. -1.15 Noteworthy changes in version ‘0.20.0’ +1.16 Noteworthy changes in version '0.20.0' =========================================== A new stable release. Many improvments with Nib loading, documents and document controllers. Fixed many drawing issues, particularly ones related to flipping. Much improved theming. -1.16 Noteworthy changes in version ‘0.19.0’ +1.17 Noteworthy changes in version '0.19.0' =========================================== This is an (unstable) copy of the 0.18.0 release -1.17 Noteworthy changes in version ‘0.18.0’ +1.18 Noteworthy changes in version '0.18.0' =========================================== A new stable release that has had many improvements. Many new Mac OS X @@ -335,131 +343,131 @@ were made (particularly with the use of the Windows theme). There is also better compatibility with Mac OS X in terms of usage of NSInteger and other definitions. -1.18 Noteworthy changes in version ‘0.17.1’ +1.19 Noteworthy changes in version '0.17.1' =========================================== - • New Mac OS X 10.5 methods in NSFont - • Add live resize in NSSplitView + * New Mac OS X 10.5 methods in NSFont + * Add live resize in NSSplitView -1.19 Noteworthy changes in version ‘0.17.0’ +1.20 Noteworthy changes in version '0.17.0' =========================================== - • New Mac OS X 10.5 methods in many classes - • Toolbars have been completely rewritten and improved. - • Several improvements for Garbage Collection + * New Mac OS X 10.5 methods in many classes + * Toolbars have been completely rewritten and improved. + * Several improvements for Garbage Collection -1.20 Noteworthy changes in version ‘0.16.0’ +1.21 Noteworthy changes in version '0.16.0' =========================================== - • Nib loading refractored and improved. - • Added support for autosaving in NSDocuments - • NSWindowController made a subclass of NSResponder - • NSTokenField and netokenFiledCell classes added. + * Nib loading refractored and improved. + * Added support for autosaving in NSDocuments + * NSWindowController made a subclass of NSResponder + * NSTokenField and netokenFiledCell classes added. -1.21 Noteworthy changes in version ‘0.14.0’ +1.22 Noteworthy changes in version '0.14.0' =========================================== - • New class NSGlyphGenerator for glyph generation - • NSSplitView implemented setAutosaveName: - • NSOpenGLView added some Mac OS X 10.3 methods - • Manu bug fixes. + * New class NSGlyphGenerator for glyph generation + * NSSplitView implemented setAutosaveName: + * NSOpenGLView added some Mac OS X 10.3 methods + * Manu bug fixes. -1.22 Noteworthy changes in version ‘0.13.2’ +1.23 Noteworthy changes in version '0.13.2' =========================================== - • Printing works a little better now. - • NSPopUpButtonCell - object encoding was changed - • NSTextView - several updates and Mac OS X methods added - • NSWindow - devince interaction was changed. You need to use + * Printing works a little better now. + * NSPopUpButtonCell - object encoding was changed + * NSTextView - several updates and Mac OS X methods added + * NSWindow - devince interaction was changed. You need to use gnustep-back 0.13.2 with this version - • New class NSSegmentedCell. - • NSDrawer was implemented. + * New class NSSegmentedCell. + * NSDrawer was implemented. -1.23 Noteworthy changes in version ‘0.13.1’ +1.24 Noteworthy changes in version '0.13.1' =========================================== - • NSMenu - Added more MacOS X methods and an ivar. - • Added support for hiding views. - • Added Key-Value bindings implementation (NSKeyValueBinding) with + * NSMenu - Added more MacOS X methods and an ivar. + * Added support for hiding views. + * Added Key-Value bindings implementation (NSKeyValueBinding) with support in several classes (NSControl, NSTextField, NSView, etc). - • Added some MacOS X 10.4 methods to NSTableView. - • Changed the NSCursor hot point to 0,0 for MacOS X compatibility. + * Added some MacOS X 10.4 methods to NSTableView. + * Changed the NSCursor hot point to 0,0 for MacOS X compatibility. -1.24 Noteworthy changes in version ‘0.13.0’ +1.25 Noteworthy changes in version '0.13.0' =========================================== This is an unstable release. There may be backward compatibility issues with previous releases of the gui library. - • Switched to use LGPL 3 and GPL 3. - • Added new methods from Mac OS X 10.4 for NSDragging, + * Switched to use LGPL 3 and GPL 3. + * Added new methods from Mac OS X 10.4 for NSDragging, NSFontDescriptor, NSAttributedString, NSImageView, NSStringDrawing, NSParagraphStyle, NSView, NSCell, NSActionCell, NSAlert, NSApplication, NSBitmapImageRep, NSBox, NSColor, NSColorSpace, NSComboBox, NSComboBoxCell, NSDocumentController, NSEvent, NSScreen, NSFont, NSFontManager, NSFormCell, NSForm, NSWindow, NSTextField, NSTextFieldCell. Some ivar names were changed also. - • Moved Postscript printing methods from NSView to NSGraphicsContext. - • Rewrote the NSView drawing mechanism to always use + * Moved Postscript printing methods from NSView to NSGraphicsContext. + * Rewrote the NSView drawing mechanism to always use [displayRectIgnoringOpacity:inContext]. - • Report more controls as being flipped. (NSTextField, + * Report more controls as being flipped. (NSTextField, NSTableHeaderView, NSSlider, NSProgressIndicator, NSButton) NSTabView is still missing. - • In NSAffineTransform use optimized primitive methods from base. - • Add font attribute fixing to NSAttributedString. To allow for the + * In NSAffineTransform use optimized primitive methods from base. + * Add font attribute fixing to NSAttributedString. To allow for the output of glyphs not present in the current font. - • Optimized the validation of edited cells. - • Implementation of special connectors for Key-Value binding. - • Base library version 1.15.1 is required for this release + * Optimized the validation of edited cells. + * Implementation of special connectors for Key-Value binding. + * Base library version 1.15.1 is required for this release -1.25 Noteworthy changes in version ‘0.12.0’ +1.26 Noteworthy changes in version '0.12.0' =========================================== It has been a long time since the last release and many things have been added and changed, including new classes, new ivars, and new methods. - • Lots of improvements to the NSBitmapImage subclasses thanks to Mark + * Lots of improvements to the NSBitmapImage subclasses thanks to Mark Tracy - • GSTheme and other classes were added to improve support of theming. - • Added new methods from Mac OS X 10.4 for NSControl, NSResponder, + * GSTheme and other classes were added to improve support of theming. + * Added new methods from Mac OS X 10.4 for NSControl, NSResponder, NSDocument, NSPrintOperation, NSWindowController, NSCell, NSMenuItem, NSView. Some ivar names were changed also. - • Added new ivars for NSMenuItem, NSPrintOperation, NSTableView, + * Added new ivars for NSMenuItem, NSPrintOperation, NSTableView, NSDrawer, NSScrollView. - • New classes from Mac OS X 10.4 and earlier were added including + * New classes from Mac OS X 10.4 and earlier were added including NSLevelIndicator, NSObjectController, NSUserDefaultsController, NSKeyValueBinding, NSArrayController, NSController. - • NSSpellServer and NSAffineTransform was moved to GNUstep base for + * NSSpellServer and NSAffineTransform was moved to GNUstep base for Mac OS X compatibility. -1.26 Noteworthy changes in version ‘0.11.0’ +1.27 Noteworthy changes in version '0.11.0' =========================================== - • Added support for keyed encoding in all gui classes. - • Added mechanism to allow for dynamic extension of model loading + * Added support for keyed encoding in all gui classes. + * Added mechanism to allow for dynamic extension of model loading mechanism - • Implemented glue code in GSNibCompatibility for classes such as + * Implemented glue code in GSNibCompatibility for classes such as NSIBObjectData, NSClassSwapper, etc. to facilitate nib loading. -1.27 Noteworthy changes in version ‘0.10.3’ +1.28 Noteworthy changes in version '0.10.3' =========================================== - • Horizontal menus now work - • Better support for tracking active applications. + * Horizontal menus now work + * Better support for tracking active applications. -1.28 Noteworthy changes in version ‘0.10.2’ +1.29 Noteworthy changes in version '0.10.2' =========================================== Mostly bug fixes. -1.29 Noteworthy changes in version ‘0.10.1’ +1.30 Noteworthy changes in version '0.10.1' =========================================== GNUstep now uses v19 of portaudio for the sound daemon. Version v19 -hasn’t been officially released, but it is still used in several +hasn't been officially released, but it is still used in several distributions (SuSE, etc) as v18 is very old. -1.30 Noteworthy changes in version ‘0.10.0’ +1.31 Noteworthy changes in version '0.10.0' =========================================== This release is binary incompatible with previous releases. The @@ -467,161 +475,161 @@ interface version of the library has changed so that apps, tools and libraries that use the base library need to be recompiled to use this new version. - • Model loading supports window auto-positioning - • Keyed encoding is supported in many classes. + * Model loading supports window auto-positioning + * Keyed encoding is supported in many classes. -1.31 Noteworthy changes in version ‘0.9.5’ +1.32 Noteworthy changes in version '0.9.5' ========================================== - • Beginnings of CUPS interface were added. - • Added new control colors and methods from 10.3 version of Cocoa. - • Added new font methods from 10.3 version of Cocoa. - • NSApplication -runModalSession behavior changed. - • You can find the GUI library’s version using the Info.plist + * Beginnings of CUPS interface were added. + * Added new control colors and methods from 10.3 version of Cocoa. + * Added new font methods from 10.3 version of Cocoa. + * NSApplication -runModalSession behavior changed. + * You can find the GUI library's version using the Info.plist -1.32 Noteworthy changes in version ‘0.9.4’ +1.33 Noteworthy changes in version '0.9.4' ========================================== - • The printing classes have been completely reorganized to + * The printing classes have been completely reorganized to accommodate different native printing systems (Thanks to Chad Hardin). - • PPD files have been moved to a separate package. - • NSToolbar now allows rearranging items. - • NSScroller, NSScrollView has a new ivar. - • Some improvement of NSDataLink classes. + * PPD files have been moved to a separate package. + * NSToolbar now allows rearranging items. + * NSScroller, NSScrollView has a new ivar. + * Some improvement of NSDataLink classes. -1.33 Noteworthy changes in version ‘0.9.3’ +1.34 Noteworthy changes in version '0.9.3' ========================================== - • Spell checker reimplemented using libaspell - • New NSComboBox implementation - • NSToolbar much improved - • Binary incompatibilites from ivar additions in NSView and + * Spell checker reimplemented using libaspell + * New NSComboBox implementation + * NSToolbar much improved + * Binary incompatibilites from ivar additions in NSView and subclasses. -1.34 Noteworthy changes in version ‘0.9.2’ +1.35 Noteworthy changes in version '0.9.2' ========================================== - • Working NSToolbar implementation - • New Mac OS X methods in NSView and other classes - • Fixed some sheet handling problems. - • Integrated gif, jpg, and png handling in front-end. - • Added overridable button and frame drawing functions - • Add some keyed decode/encoding to some classes - • NSStringDrawing redesigned. - • Much improved loading of gorm files + * Working NSToolbar implementation + * New Mac OS X methods in NSView and other classes + * Fixed some sheet handling problems. + * Integrated gif, jpg, and png handling in front-end. + * Added overridable button and frame drawing functions + * Add some keyed decode/encoding to some classes + * NSStringDrawing redesigned. + * Much improved loading of gorm files -1.35 Noteworthy changes in version ‘0.9.1’ +1.36 Noteworthy changes in version '0.9.1' ========================================== - • NSWindow - DnD works on whole window and events are propogated up + * NSWindow - DnD works on whole window and events are propogated up to first DnD aware view. - • Absolute paths and DnD works in OpenPanels. + * Absolute paths and DnD works in OpenPanels. -1.36 Noteworthy changes in version ‘0.9.0’ +1.37 Noteworthy changes in version '0.9.0' ========================================== Improvements in various classes, include NSPopUpButton, NSBitmapImageRep, NSMenu, NSToolbar. Added support for thumbnail images in NSWorkspace. -1.37 Noteworthy changes in version ‘0.8.9’ +1.38 Noteworthy changes in version '0.8.9' ========================================== Note that many headers have moved to new locations (both in the package and when installed), so it is possible, although not likely that some applications may not compile because they cannot find the right header. - • New Language Setup documentation. + * New Language Setup documentation. -1.38 Noteworthy changes in version ‘0.8.8’ +1.39 Noteworthy changes in version '0.8.8' ========================================== - • Updated LanguageSetup documentation - • Improved RTF reader (unicode support, etc). + * Updated LanguageSetup documentation + * Improved RTF reader (unicode support, etc). -1.39 Noteworthy changes in version ‘0.8.7’ +1.40 Noteworthy changes in version '0.8.7' ========================================== - • NSBezierPath glyph methods implemented (depends on backend). - • NSDataLink[Panel/Manager] - some implementation - • Added default to load user-defined bundles (GSAppKitUserBundles + * NSBezierPath glyph methods implemented (depends on backend). + * NSDataLink[Panel/Manager] - some implementation + * Added default to load user-defined bundles (GSAppKitUserBundles default). -1.40 Noteworthy changes in version ‘0.8.6’ +1.41 Noteworthy changes in version '0.8.6' ========================================== Updated to install in new locations based on changes in gnustep-make 1.7.0. - • New implementation of RTF producer (from Axel "Mikesch" Katerbau) - • Speed improvements, especially in tracking mouses movements. - • Lots of menu improvements. + * New implementation of RTF producer (from Axel "Mikesch" Katerbau) + * Speed improvements, especially in tracking mouses movements. + * Lots of menu improvements. -1.41 Noteworthy changes in version ‘0.8.5’ +1.42 Noteworthy changes in version '0.8.5' ========================================== Bug fixes. NSStringDrawing now uses text system implementation. -1.42 Noteworthy changes in version ‘0.8.4’ +1.43 Noteworthy changes in version '0.8.4' ========================================== This release features a brand new text and layout system thanks to Alexander Malmberg. Other improvements include: - • Various display optimizations. - • Default border to NSScrollView changed - • Printing fixes. - • NSToolbar partially implemented. + * Various display optimizations. + * Default border to NSScrollView changed + * Printing fixes. + * NSToolbar partially implemented. -1.43 Noteworthy changes in version ‘0.8.3’ +1.44 Noteworthy changes in version '0.8.3' ========================================== - • Additions for Gorm support. - • Alpha support for OpenGL - • Better ruler support - dragging of tab markers. - • Document support, recent files, etc. - • Simple printing to printer and print previewing. - • Window focus fixes - • Key view handling rewritten. + * Additions for Gorm support. + * Alpha support for OpenGL + * Better ruler support - dragging of tab markers. + * Document support, recent files, etc. + * Simple printing to printer and print previewing. + * Window focus fixes + * Key view handling rewritten. -1.44 Noteworthy changes in version ‘0.8.2’ +1.45 Noteworthy changes in version '0.8.2' ========================================== - • Handle fonts that aren’t found better. - • Implement pageUp/Down. - • Some window focusing problems fixed. - • Quartz-like interface partially implemented. - • NSSecureTextField partially rewritten. More secure. - • NSBrowser: implement non-separate columns - • Fix firstResponder status in text fields. + * Handle fonts that aren't found better. + * Implement pageUp/Down. + * Some window focusing problems fixed. + * Quartz-like interface partially implemented. + * NSSecureTextField partially rewritten. More secure. + * NSBrowser: implement non-separate columns + * Fix firstResponder status in text fields. -1.45 Noteworthy changes in version ‘0.8.1’ +1.46 Noteworthy changes in version '0.8.1' ========================================== - • Handle scaled curves correctly. - • Handle alpha channel with images correctly - • NSWindow frame string save without flipping coordinates. - • NSSound implemented. gssnd sound server. - • Spell checker starts correctly now. + * Handle scaled curves correctly. + * Handle alpha channel with images correctly + * NSWindow frame string save without flipping coordinates. + * NSSound implemented. gssnd sound server. + * Spell checker starts correctly now. -1.46 Noteworthy changes in version ‘0.8.0’ +1.47 Noteworthy changes in version '0.8.0' ========================================== -1.47 Noteworthy changes in version ‘0.7.9’ +1.48 Noteworthy changes in version '0.7.9' ========================================== - • NSTableView, NSOutlineView improvements. - • Menus no longer work in modal loop. - • Skeleton implementation of NSToolBar + * NSTableView, NSOutlineView improvements. + * Menus no longer work in modal loop. + * Skeleton implementation of NSToolBar -1.48 Noteworthy changes in version ‘0.7.8’ +1.49 Noteworthy changes in version '0.7.8' ========================================== - • Wheel color picker, standard color picker (bundles) added. - • System colors now use named colors. Easier configuration + * Wheel color picker, standard color picker (bundles) added. + * System colors now use named colors. Easier configuration -1.49 Noteworthy changes in version ‘0.7.7’ +1.50 Noteworthy changes in version '0.7.7' ========================================== The graphics/window interface was completely revamped. Window functions @@ -639,82 +647,82 @@ for improved code sharing. computers, although it is in a very alpha state. Other improvements: - • Mutliple screens are now handled properly (untested) - • Better autolayout with GSTable and subclasses. - • NSOutlineView much improved. + * Mutliple screens are now handled properly (untested) + * Better autolayout with GSTable and subclasses. + * NSOutlineView much improved. -1.50 Noteworthy changes in version ‘0.7.6’ +1.51 Noteworthy changes in version '0.7.6' ========================================== - • NSOutlineView implemented. - • Improvements to NSTableView, NSPopUpButton, NSTextView, NSFontPanel - • Scroll wheel support. - • Fully-functional keybindings, including multi-stroke keybindings. - • Memory panel available from Info Panel. + * NSOutlineView implemented. + * Improvements to NSTableView, NSPopUpButton, NSTextView, NSFontPanel + * Scroll wheel support. + * Fully-functional keybindings, including multi-stroke keybindings. + * Memory panel available from Info Panel. -1.51 Noteworthy changes in version ‘0.7.5’ +1.52 Noteworthy changes in version '0.7.5' ========================================== - • Drag and drop and image sliding much improved. - • Better handling of remote startup/display. - • Some localization. - • Keybinding support. - • Text handling improvements. - • New gopen command (like MacOSX open command). - • Implemented simple pagination and printing of views. - • Support for rulers. - • Spell checking support. - • Blinking insertion point. - • New NSStepper class. - • Implemented NSOutlineView, NSSelection, NSInputManager. - • Near rewrite of Menu handling code. - • Gmodel code compiled as a separate bundle. + * Drag and drop and image sliding much improved. + * Better handling of remote startup/display. + * Some localization. + * Keybinding support. + * Text handling improvements. + * New gopen command (like MacOSX open command). + * Implemented simple pagination and printing of views. + * Support for rulers. + * Spell checking support. + * Blinking insertion point. + * New NSStepper class. + * Implemented NSOutlineView, NSSelection, NSInputManager. + * Near rewrite of Menu handling code. + * Gmodel code compiled as a separate bundle. -1.52 Noteworthy changes in version ‘0.7.0’ +1.53 Noteworthy changes in version '0.7.0' ========================================== - • Much improvement in NSBrowser, NSMatrix, NSPopUpButton, combo + * Much improvement in NSBrowser, NSMatrix, NSPopUpButton, combo boxes. - • NSTextAttachement implemented, many other text improvements. - • Fonts cached in the frontend. - • Changes so that backend can be loaded as a bundle at runtime. - • simpler, faster compilation and installation. - • NSColorWell works. + * NSTextAttachement implemented, many other text improvements. + * Fonts cached in the frontend. + * Changes so that backend can be loaded as a bundle at runtime. + * simpler, faster compilation and installation. + * NSColorWell works. -1.53 Noteworthy changes in version ‘0.6.7’ +1.54 Noteworthy changes in version '0.6.7' ========================================== - • App Icons can support documents dropped using DnD. - • Added color conversions, working color picker and panel. - • Almost complete rewrite of NSBezierPath - • Loads of improvements to Text classes. - • NSImage, NSButton, NSCell, etc, implemented many missing methods. - • ...and even more changes to the Text classes. - • Starting implementation of printing. - • Scrollview fixes. - • Implemented deferred windows. - • NSTableView implemented. - • Implemented object value and formatter support in NSCell - • Support middle mouse button. + * App Icons can support documents dropped using DnD. + * Added color conversions, working color picker and panel. + * Almost complete rewrite of NSBezierPath + * Loads of improvements to Text classes. + * NSImage, NSButton, NSCell, etc, implemented many missing methods. + * ...and even more changes to the Text classes. + * Starting implementation of printing. + * Scrollview fixes. + * Implemented deferred windows. + * NSTableView implemented. + * Implemented object value and formatter support in NSCell + * Support middle mouse button. -1.54 Noteworthy changes in version ‘0.6.6’ +1.55 Noteworthy changes in version '0.6.6' ========================================== - • Window hints for motif and generic window managers. - • Major improvements to the text handling classes (NSText, + * Window hints for motif and generic window managers. + * Major improvements to the text handling classes (NSText, NSTextView, etc) - • Pasting of fonts and rulers. - • Much better RTF handling - • DnD for NSColorWell - • Much improved NSSplitView - • New classes - NSColorPanel, NSTableView - • NSScreen rewritten with full support for all methods and functions. - • Can use image reading routines from WindowMaker if available to + * Pasting of fonts and rulers. + * Much better RTF handling + * DnD for NSColorWell + * Much improved NSSplitView + * New classes - NSColorPanel, NSTableView + * NSScreen rewritten with full support for all methods and functions. + * Can use image reading routines from WindowMaker if available to read a variety of image formats besides TIFF. - • Many fixes to get the AppKit to work better with WindowMaker. - • Much better gmodel support (particularly with nibs translated from + * Many fixes to get the AppKit to work better with WindowMaker. + * Much better gmodel support (particularly with nibs translated from NeXT or OPENSTEP 4.2). - • Muh improved font classes and font support. + * Muh improved font classes and font support. In addition both the xgps and xdps backends have seen some large efficiency improvements. Much better font support. The xdps backend @@ -723,211 +731,211 @@ however, that the xdps backend is still considered experimental and you may have to deal with many problems in order to get it working. We recommend sticking with the xgps backend (the default) for now. -1.55 Noteworthy changes in version ‘0.6.5’ +1.56 Noteworthy changes in version '0.6.5' ========================================== Many of the basic GUI classes have been vastly improved or rewritten, thanks to Nicola Pero and many others. - • New Info Panel support - • New NSBezierPath - • Rewrite of several classes including Cell and Button classes. - • Rewrite of NSBrowser, NSSavePanel, menus, text classes, + * New Info Panel support + * New NSBezierPath + * Rewrite of several classes including Cell and Button classes. + * Rewrite of NSBrowser, NSSavePanel, menus, text classes, NSTableHeader. - • RTF Parser - • Implemented image caching. - • Implemented editing in Forms, Matricies. - • New autolayout classes GSHBox, GSTable, and GSVBox. - • Almost all back-end classes have been removed and code incorporated + * RTF Parser + * Implemented image caching. + * Implemented editing in Forms, Matricies. + * New autolayout classes GSHBox, GSTable, and GSVBox. + * Almost all back-end classes have been removed and code incorporated in a DPS-like graphics context structure. - • Better keyboard handling. - • NSHelpManager, NSComboBox, ProgressIndicator written. + * Better keyboard handling. + * NSHelpManager, NSComboBox, ProgressIndicator written. In addition a preliminary version of an Interface Builder (Gorm) has been written, thanks to Richard Frith-Macdonald -1.56 Noteworthy changes in version ‘0.6.0’ +1.57 Noteworthy changes in version '0.6.0' ========================================== -A Huge amount of progress, although a lot still needs to be done. It’s +A Huge amount of progress, although a lot still needs to be done. It's usable for a large base of moderately simple apps. Several NeXT/OpenStep apps and libraries have been ported with little changes. - • Drag and Drop support fleshed out but not completed. - • NSText and related classes rewritten. Basic functionality but much + * Drag and Drop support fleshed out but not completed. + * NSText and related classes rewritten. Basic functionality but much needs to be done to finish them off. - • nib2gmodel app works with MacOS-X - • Work done in minimizing the backend which allowed a lot of + * nib2gmodel app works with MacOS-X + * Work done in minimizing the backend which allowed a lot of functionality to move to the GNU library. - • Menu code rewritten. - • PopupButtons now work. - • Many new images - • Basic functionality for NSTabView - • Much better lockFocus support in NSView. Flipped views handled. - • Rewrite of NSSavePanel and NSOpenPanel - • Several fixes that at least double the speed of the gui. + * Menu code rewritten. + * PopupButtons now work. + * Many new images + * Basic functionality for NSTabView + * Much better lockFocus support in NSView. Flipped views handled. + * Rewrite of NSSavePanel and NSOpenPanel + * Several fixes that at least double the speed of the gui. -1.57 Noteworthy changes in version ‘0.5.5’ +1.58 Noteworthy changes in version '0.5.5' ========================================== Too extensive to list. - • A lot of rewritting has been done to the classes, with general + * A lot of rewritting has been done to the classes, with general cleanup of coordinate conversion code, etc. -1.58 Noteworthy changes in version ‘0.5.0’ +1.59 Noteworthy changes in version '0.5.0' ========================================== - • NSBrowser and NSBrowserCell have been implemented. There is one + * NSBrowser and NSBrowserCell have been implemented. There is one odd display artifact; lists which are smaller than the browser column area have the list justified to the bottom of the column versus the top of the column. This is actually an issue with NSMatrix and will be remedied when flip views are implemented. - • Two important optimizations that speed up the displaying of views + * Two important optimizations that speed up the displaying of views and flushing of windows have been implemented. Only the views that need display and those that produce visible effects on the screen receive the -drawRect: message. Flushing of windows occurs only in rectangles that get displayed not in the whole window. - • Rotation and scaling of views have been finally implemented. The + * Rotation and scaling of views have been finally implemented. The code requires backend support for changing the state of the graphics context accordingly. - • NSScrollView and NSClipView have been implemented. The current + * NSScrollView and NSClipView have been implemented. The current implemented behavior is to call the document view to display the exposed region. Copying on scroll will be supported soon, at least on Solaris DPS, where it seems the Postscript language has provisions for copying drawn regions of screen. Hopefully DGS will also have this facility by the end of the year. - • NSScroller has been completely reworked to gain speed by using + * NSScroller has been completely reworked to gain speed by using timer events. - • NSSlider has been implemented. Thanks to Frank Knobloch for + * NSSlider has been implemented. Thanks to Frank Knobloch for supporting this and the NSScrollView implementation. - • NSBox has been implemented. + * NSBox has been implemented. - • The library has been ported to work under Solaris with the native - DPS and the NeXT/Apple’s Portable Distributed Objects (PDO) + * The library has been ported to work under Solaris with the native + DPS and the NeXT/Apple's Portable Distributed Objects (PDO) environment. - • The library has been integrated with the makefile package so we now + * The library has been integrated with the makefile package so we now benefit from all of the features the makefile package gives us, especially the possibility to build shared libraries on various systems and having different types (debug and profile) of the library compiled at the same time. - • NSCell is able to continuosly send the action to the target while + * NSCell is able to continuosly send the action to the target while the user is tracking the mouse. - • Several cleanups and as usual, many bug fixes. + * Several cleanups and as usual, many bug fixes. -1.59 Noteworthy changes in version ‘0.3.0’ +1.60 Noteworthy changes in version '0.3.0' ========================================== - • Completely reworked the menu class. The NSMenu class is now + * Completely reworked the menu class. The NSMenu class is now inherited from NSObject and using the new implementation menus have been implemented for the XDPS backend (they have the look and feel of the NeXTStep menus!). - • NSRunLoop has been integrated with NSApplication. Using this + * NSRunLoop has been integrated with NSApplication. Using this capability time events have been implemented to NSEvent class. These events allow several improvements in the interaction between user and the graphic interface. - • NSMatrix has been reworked, it is now conforming to the OpenStep + * NSMatrix has been reworked, it is now conforming to the OpenStep specification and it knows all the selection modes. It uses time events to enhance the drawing speed during mouse drags. - • The initial implementation of NSForm has been made although it has + * The initial implementation of NSForm has been made although it has not been tested yet. - • NSPrinter has been implemented though it was not throughly tested; + * NSPrinter has been implemented though it was not throughly tested; thanks to Simon Frankau. - • Configure script has been changed to detect the underlaying + * Configure script has been changed to detect the underlaying Foundation library. The currently supported libraries are gnustep-base and libFoundation. - • Several cleanups have been made in a lot of classes: the + * Several cleanups have been made in a lot of classes: the retain/release policy has been fixed, the cell classes correctly implement the NSCopying protocol and many others. -1.60 Noteworthy changes in version ‘0.2.0’ +1.61 Noteworthy changes in version '0.2.0' ========================================== - • Additional NSImage and NSImageRep class work. Incorporated common + * Additional NSImage and NSImageRep class work. Incorporated common images for use with controls that were designed by Andrew Lindesay. - • Fill out implementation of NSColorWell class. + * Fill out implementation of NSColorWell class. - • Fill out implementation of NSColorList class. + * Fill out implementation of NSColorList class. - • Cleaned up the header files and added missing headers, methods, + * Cleaned up the header files and added missing headers, methods, categories, and protocols; thanks to Simon Frankau for much of this work. Major reorganization of header files. Types and constants were moved in the files they belong. Each header file includes - only the headers it really needs. Use ‘@class’ to forward class + only the headers it really needs. Use '@class' to forward class definitions instead of including the corresponding class file. - • Completely reworked the NSFont and NSFontManager classes so that + * Completely reworked the NSFont and NSFontManager classes so that NSUserDefaults is used for getting defaults and list of known fonts are maintained. - • Initial implementation of NSCursor class. + * Initial implementation of NSCursor class. - • Almost complete implementation of NSButton and NSButtonCell class. + * Almost complete implementation of NSButton and NSButtonCell class. Buttons can now display images and/or text, handles all of the OpenStep button types and styles. - • Fill out implementation of NSScroller class. + * Fill out implementation of NSScroller class. - • Put in underlying support for optimizing drawing; flushing of + * Put in underlying support for optimizing drawing; flushing of windows, backing store, and only display when needed. - • Many bug fixes and minor enhancements. + * Many bug fixes and minor enhancements. -1.61 Noteworthy changes in version ‘0.1.1’ +1.62 Noteworthy changes in version '0.1.1' ========================================== - • Almost complete implementation of the PXKMenu and PXKMenuCell + * Almost complete implementation of the PXKMenu and PXKMenuCell classes. - • Fill out implementation of NSFont and NSFontManager. + * Fill out implementation of NSFont and NSFontManager. - • Fill out implementation of NSColor including color spaces other + * Fill out implementation of NSColor including color spaces other than RGB. Now maintains the common colors as global variables. - • Integration with the Display Ghostscript System. This is mainly + * Integration with the Display Ghostscript System. This is mainly related to using the header files in the DPSclient library for defining the PostScript operator functions. - • Initial documentation set. + * Initial documentation set. - • Initial implementation of NSImage, NSImageRep, and NSImageRep + * Initial implementation of NSImage, NSImageRep, and NSImageRep subclass classes based upon work by Adam Fedor. - • Now requires the TIFF library for reading, writing, and + * Now requires the TIFF library for reading, writing, and manipulating tiff files and images. -1.62 Noteworthy changes in version ‘0.1.0’ +1.63 Noteworthy changes in version '0.1.0' ========================================== - • Integration of the GNUstep X/DPS GUI Backend. This has finally + * Integration of the GNUstep X/DPS GUI Backend. This has finally produced a set of core code with can display on X/Windows. Much of the X/Windows code has been written by Pascal Forget and integration efforts have been lead by Scott Christley . - • Some major directory reorganization for the new naming guidelines. + * Some major directory reorganization for the new naming guidelines. Headers previously in AppKit and DPSClient directories have been moved to gnustep/gui and gnustep/dps directores and symbol links are created for the AppKit and DPSClient directories. This should allow both GNUstep and other OpenStep implementations to reside on the same machine without conflicts. - Also see the ‘ChangeLog’ file for more detail. + Also see the 'ChangeLog' file for more detail. diff --git a/Version b/Version index 93a50d355..a32fdf4e4 100644 --- a/Version +++ b/Version @@ -11,9 +11,9 @@ GNUSTEP_GUI_LIBTIFF=3.4 # The version number of this release. GNUSTEP_GUI_MAJOR_VERSION=0 GNUSTEP_GUI_MINOR_VERSION=31 -GNUSTEP_GUI_SUBMINOR_VERSION=0 +GNUSTEP_GUI_SUBMINOR_VERSION=1 # numeric value should match above -VERSION_NUMBER=031.0 +VERSION_NUMBER=031.1 GNUSTEP_GUI_VERSION=${GNUSTEP_GUI_MAJOR_VERSION}.${GNUSTEP_GUI_MINOR_VERSION}.${GNUSTEP_GUI_SUBMINOR_VERSION} VERSION=${GNUSTEP_GUI_VERSION} From c9a0e7443716785ec091afff703d46efca6495a8 Mon Sep 17 00:00:00 2001 From: rfm Date: Thu, 6 Jun 2024 12:33:05 +0100 Subject: [PATCH 32/48] Fixup bad testcases with non-portable code --- Tests/gui/GSXib5KeyedUnarchiver/buttonCell.m | 59 +++-- Tests/gui/GSXib5KeyedUnarchiver/menu.m | 67 ++--- Tests/gui/NSBezierPath/bounds.m | 242 +++++++++---------- Tests/gui/NSButtonCell/encoding.m | 2 + 4 files changed, 197 insertions(+), 173 deletions(-) diff --git a/Tests/gui/GSXib5KeyedUnarchiver/buttonCell.m b/Tests/gui/GSXib5KeyedUnarchiver/buttonCell.m index ad8b06870..2ef617daf 100644 --- a/Tests/gui/GSXib5KeyedUnarchiver/buttonCell.m +++ b/Tests/gui/GSXib5KeyedUnarchiver/buttonCell.m @@ -10,49 +10,60 @@ int main() { - START_SET("GSXib5KeyedUnarchiver NSButtonCell tests") + START_SET("GSXib5KeyedUnarchiver NSButtonCell tests") NS_DURING - { - [NSApplication sharedApplication]; - } + { + [NSApplication sharedApplication]; + } NS_HANDLER - { - if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) - SKIP("It looks like GNUstep backend is not yet installed") - } + { + if ([[localException name] + isEqualToString: NSInternalInconsistencyException ]) + { + SKIP("It looks like GNUstep backend is not yet installed") + } + } NS_ENDHANDLER - NSData* data = [NSData dataWithContentsOfFile:@"ButtonCell.xib"]; - GSXibKeyedUnarchiver* unarchiver = [GSXibKeyedUnarchiver unarchiverForReadingWithData:data]; + NSData *data; + GSXibKeyedUnarchiver *unarchiver; + NSArray *rootObjects; + NSEnumerator *enumerator; + NSMatrix *matrix; + id element; - NSArray *rootObjects; + data = [NSData dataWithContentsOfFile: @"ButtonCell.xib"]; + unarchiver = [GSXibKeyedUnarchiver unarchiverForReadingWithData:data]; rootObjects = [unarchiver decodeObjectForKey: @"IBDocument.RootObjects"]; - NSMatrix* matrix; - - for (id element in rootObjects) { - if ([element isKindOfClass:[NSMatrix class]]) { + enumerator = [rootObjects objectEnumerator]; + while ((element = [enumerator nextObject]) != nil) + { + if ([element isKindOfClass: [NSMatrix class]]) + { matrix = (NSMatrix*)element; break; - } - } + } + } - PASS(matrix != nil, "Top-level NSMatrix was found"); + PASS(matrix != nil, "Top-level NSMatrix was found") - NSArray* cells = [matrix cells]; + NSArray *cells = [matrix cells]; // node - PASS_MODIFIER(0, NSShiftKeyMask); + PASS_MODIFIER(0, NSShiftKeyMask) // node - PASS_MODIFIER(1, NSCommandKeyMask); + PASS_MODIFIER(1, NSCommandKeyMask) // - PASS_MODIFIER(2, 0); + PASS_MODIFIER(2, 0) // Unlike NSMenuItem, the default for NSButtonCell is 0 - PASS_MODIFIER(3, 0); + PASS_MODIFIER(3, 0) - END_SET("GSXib5KeyedUnarchiver NSButtonCell tests") + END_SET("GSXib5KeyedUnarchiver NSButtonCell tests") + + return 0; } diff --git a/Tests/gui/GSXib5KeyedUnarchiver/menu.m b/Tests/gui/GSXib5KeyedUnarchiver/menu.m index e095468d2..aee3a910d 100644 --- a/Tests/gui/GSXib5KeyedUnarchiver/menu.m +++ b/Tests/gui/GSXib5KeyedUnarchiver/menu.m @@ -9,56 +9,67 @@ int main() { - START_SET("GSXib5KeyedUnarchiver NSMenu tests") + START_SET("GSXib5KeyedUnarchiver NSMenu tests") NS_DURING - { - [NSApplication sharedApplication]; - } + { + [NSApplication sharedApplication]; + } NS_HANDLER - { - if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) - SKIP("It looks like GNUstep backend is not yet installed") - } + { + if ([[localException name] + isEqualToString: NSInternalInconsistencyException ]) + { + SKIP("It looks like GNUstep backend is not yet installed") + } + } NS_ENDHANDLER - NSData* data = [NSData dataWithContentsOfFile:@"Menu.xib"]; - GSXibKeyedUnarchiver* unarchiver = [GSXibKeyedUnarchiver unarchiverForReadingWithData:data]; + NSData *data + GSXibKeyedUnarchiver *unarchiver; + NSArray *rootObjects; + NSEnumerator *enumerator; + id element; + NSMenu *menu; - NSArray *rootObjects; + data = [NSData dataWithContentsOfFile:@"Menu.xib"]; + unarchiver = [GSXibKeyedUnarchiver unarchiverForReadingWithData:data]; rootObjects = [unarchiver decodeObjectForKey: @"IBDocument.RootObjects"]; + enumerator = [rootObjects objectenumerator]; - NSMenu* menu; - - for (id element in rootObjects) { - if ([element isKindOfClass:[NSMenu class]]) { + while ((element = [enumerator nextObject]) != nil) + { + if ([element isKindOfClass: [NSMenu class]]) + { menu = (NSMenu*)element; break; - } - } + } + } - PASS(menu != nil, "Top-level NSMenu was found"); + PASS(menu != nil, "Top-level NSMenu was found") // Empty node - PASS_MODIFIER(0, 0); + PASS_MODIFIER(0, 0) // - PASS_MODIFIER(1, NSShiftKeyMask); + PASS_MODIFIER(1, NSShiftKeyMask) // - PASS_MODIFIER(2, NSCommandKeyMask); + PASS_MODIFIER(2, NSCommandKeyMask) // - PASS_MODIFIER(3, NSAlternateKeyMask); + PASS_MODIFIER(3, NSAlternateKeyMask) // No modifierMask element - PASS_MODIFIER(4, NSCommandKeyMask); + PASS_MODIFIER(4, NSCommandKeyMask) // No modifierMask element and no keyEquivalent attribute - PASS_MODIFIER(5, NSCommandKeyMask); + PASS_MODIFIER(5, NSCommandKeyMask) // no modfierMask - PASS_MODIFIER(6, NSCommandKeyMask); + PASS_MODIFIER(6, NSCommandKeyMask) // empty modifierMask - PASS_MODIFIER(7, 0); + PASS_MODIFIER(7, 0) // explicit modifier mask - PASS_MODIFIER(8, NSCommandKeyMask); + PASS_MODIFIER(8, NSCommandKeyMask) - END_SET("GSXib5KeyedUnarchiver NSMenu tests") + END_SET("GSXib5KeyedUnarchiver NSMenu tests") + + return 0; } diff --git a/Tests/gui/NSBezierPath/bounds.m b/Tests/gui/NSBezierPath/bounds.m index d14ced39a..1f48829cc 100644 --- a/Tests/gui/NSBezierPath/bounds.m +++ b/Tests/gui/NSBezierPath/bounds.m @@ -11,159 +11,159 @@ copyright 2004 Alexander Malmberg int main(int argc, char **argv) { - CREATE_AUTORELEASE_POOL(arp); - NSBezierPath *p=[[NSBezierPath alloc] init]; - NSRect r; + CREATE_AUTORELEASE_POOL(arp); + NSBezierPath *p=[[NSBezierPath alloc] init]; + NSRect r; - pass(NSIsEmptyRect([p bounds]),"empty path gives empty bounds"); + pass(NSIsEmptyRect([p bounds]),"empty path gives empty bounds"); - [p moveToPoint: NSMakePoint(100,100)]; - [p lineToPoint: NSMakePoint(150,150)]; + [p moveToPoint: NSMakePoint(100,100)]; + [p lineToPoint: NSMakePoint(150,150)]; - pass(NSEqualRects([p bounds],NSMakeRect(100,100,50,50)),"bounds accuracy (1)"); - pass(NSEqualRects([p controlPointBounds],NSMakeRect(100,100,50,50)),"control-point bounds accuracy (1)"); + pass(NSEqualRects([p bounds],NSMakeRect(100,100,50,50)),"bounds accuracy (1)"); + pass(NSEqualRects([p controlPointBounds],NSMakeRect(100,100,50,50)),"control-point bounds accuracy (1)"); - [p removeAllPoints]; - pass(NSIsEmptyRect([p bounds]),"empty path gives empty bounds (2)"); + [p removeAllPoints]; + pass(NSIsEmptyRect([p bounds]),"empty path gives empty bounds (2)"); - [p moveToPoint: NSMakePoint(100,100)]; - [p curveToPoint: NSMakePoint(200,100) - controlPoint1: NSMakePoint(125,50) - controlPoint2: NSMakePoint(175,150)]; + [p moveToPoint: NSMakePoint(100,100)]; + [p curveToPoint: NSMakePoint(200,100) + controlPoint1: NSMakePoint(125,50) + controlPoint2: NSMakePoint(175,150)]; - /* Basic checking Y. */ - r=[p bounds]; - if (fabs(r.origin.x - 100.0000) > 0.001 || - fabs(r.origin.y - 85.5662) > 0.001 || - fabs(r.size.width - 100.0000) > 0.001 || - fabs(r.size.height - 28.8678) > 0.001) - { - pass(0,"bounds accuracy (2)"); - printf("expected %s, got %s\n", - [NSStringFromRect(NSMakeRect(100.0000, 85.5662, 100.0000, 28.8678)) lossyCString], - [NSStringFromRect(r) lossyCString]); - } - else - pass(1,"bounds accuracy (2)"); + /* Basic checking Y. */ + r=[p bounds]; + if (fabs(r.origin.x - 100.0000) > 0.001 || + fabs(r.origin.y - 85.5662) > 0.001 || + fabs(r.size.width - 100.0000) > 0.001 || + fabs(r.size.height - 28.8678) > 0.001) + { + pass(0,"bounds accuracy (2)"); + printf("expected %s, got %s\n", + [NSStringFromRect(NSMakeRect(100.0000, 85.5662, 100.0000, 28.8678)) lossyCString], + [NSStringFromRect(r) lossyCString]); + } + else + pass(1,"bounds accuracy (2)"); - pass(NSEqualRects([p controlPointBounds],NSMakeRect(100,50,100,100)),"control-point bounds accuracy (2)"); + pass(NSEqualRects([p controlPointBounds],NSMakeRect(100,50,100,100)),"control-point bounds accuracy (2)"); - /* Basic checking X. */ - [p removeAllPoints]; - [p moveToPoint: NSMakePoint(100,100)]; - [p curveToPoint: NSMakePoint(100,200) - controlPoint1: NSMakePoint(50,125) - controlPoint2: NSMakePoint(150,175)]; + /* Basic checking X. */ + [p removeAllPoints]; + [p moveToPoint: NSMakePoint(100,100)]; + [p curveToPoint: NSMakePoint(100,200) + controlPoint1: NSMakePoint(50,125) + controlPoint2: NSMakePoint(150,175)]; - r=[p bounds]; - if (fabs(r.origin.y - 100.0000) > 0.001 || - fabs(r.origin.x - 85.5662) > 0.001 || - fabs(r.size.height - 100.0000) > 0.001 || - fabs(r.size.width - 28.8678) > 0.001) - { - pass(0,"bounds accuracy (3)"); - printf("expected %s, got %s\n", - [NSStringFromRect(NSMakeRect(85.5662, 100.0000, 28.8678, 100.0000)) lossyCString], - [NSStringFromRect(r) lossyCString]); - } - else - pass(1,"bounds accuracy (3)"); + r=[p bounds]; + if (fabs(r.origin.y - 100.0000) > 0.001 || + fabs(r.origin.x - 85.5662) > 0.001 || + fabs(r.size.height - 100.0000) > 0.001 || + fabs(r.size.width - 28.8678) > 0.001) + { + pass(0,"bounds accuracy (3)"); + printf("expected %s, got %s\n", + [NSStringFromRect(NSMakeRect(85.5662, 100.0000, 28.8678, 100.0000)) lossyCString], + [NSStringFromRect(r) lossyCString]); + } + else + pass(1,"bounds accuracy (3)"); - /* A bit of both, and extreme values beyond the initial points. */ - [p removeAllPoints]; - [p moveToPoint: NSMakePoint(-100,0)]; - [p curveToPoint: NSMakePoint(100,0) - controlPoint1: NSMakePoint(-118.2, 10.393) - controlPoint2: NSMakePoint( 118.2,-10.393)]; + /* A bit of both, and extreme values beyond the initial points. */ + [p removeAllPoints]; + [p moveToPoint: NSMakePoint(-100,0)]; + [p curveToPoint: NSMakePoint(100,0) + controlPoint1: NSMakePoint(-118.2, 10.393) + controlPoint2: NSMakePoint( 118.2,-10.393)]; - r=[p bounds]; - if (fabs(r.origin.x + 101.0) > 0.001 || - fabs(r.origin.y + 3.0) > 0.001 || - fabs(r.size.width - 202.0) > 0.001 || - fabs(r.size.height - 6.0) > 0.001) - { - pass(0,"bounds accuracy (4)"); - printf("expected %s, got %s\n", - [NSStringFromRect(NSMakeRect(-101.0, -3.0, 202.0, 6.0)) lossyCString], - [NSStringFromRect(r) lossyCString]); - } - else - pass(1,"bounds accuracy (4)"); + r=[p bounds]; + if (fabs(r.origin.x + 101.0) > 0.001 || + fabs(r.origin.y + 3.0) > 0.001 || + fabs(r.size.width - 202.0) > 0.001 || + fabs(r.size.height - 6.0) > 0.001) + { + pass(0,"bounds accuracy (4)"); + printf("expected %s, got %s\n", + [NSStringFromRect(NSMakeRect(-101.0, -3.0, 202.0, 6.0)) lossyCString], + [NSStringFromRect(r) lossyCString]); + } + else + pass(1,"bounds accuracy (4)"); - /* Check the control-point bounding box. */ - r=[p controlPointBounds]; - if (fabs(r.origin.x + 118.2 ) > 0.001 || - fabs(r.origin.y + 10.393) > 0.001 || - fabs(r.size.width - 236.4 ) > 0.001 || - fabs(r.size.height - 20.786) > 0.001) - { - pass(0,"control-point bounds accuracy (3)"); - printf("expected %s, got %s\n", - [NSStringFromRect(NSMakeRect(-118.2, -10.393, 236.4, 20.786)) lossyCString], - [NSStringFromRect(r) lossyCString]); - } - else - pass(1,"control-point bounds accuracy (3)"); + /* Check the control-point bounding box. */ + r=[p controlPointBounds]; + if (fabs(r.origin.x + 118.2 ) > 0.001 || + fabs(r.origin.y + 10.393) > 0.001 || + fabs(r.size.width - 236.4 ) > 0.001 || + fabs(r.size.height - 20.786) > 0.001) + { + pass(0,"control-point bounds accuracy (3)"); + printf("expected %s, got %s\n", + [NSStringFromRect(NSMakeRect(-118.2, -10.393, 236.4, 20.786)) lossyCString], + [NSStringFromRect(r) lossyCString]); + } + else + pass(1,"control-point bounds accuracy (3)"); - /* + /* - p=(1-t)^3*a + 3*(1-t)^2*t*b + 3*(1-t)*t^2*c + t^3*d + p=(1-t)^3*a + 3*(1-t)^2*t*b + 3*(1-t)*t^2*c + t^3*d - c-2b+a +- sqrt(a(d-c)+b(-d-c)+c^2+b^2) - t= -------------------------------------- - -d+3c-3b+a + c-2b+a +- sqrt(a(d-c)+b(-d-c)+c^2+b^2) + t= -------------------------------------- + -d+3c-3b+a - */ + */ - if (0) - { - NSPoint a,b,c,d; - double t1,t2; - double t,ti; - NSPoint p; + if (0) + { + NSPoint a,b,c,d; + double t1,t2; + double t,ti; + NSPoint p; - a=NSMakePoint(-100,0); - b=NSMakePoint(-118.2,10.39); - c=NSMakePoint(118.2,-10.39); - d=NSMakePoint(100,0); + a=NSMakePoint(-100,0); + b=NSMakePoint(-118.2,10.39); + c=NSMakePoint(118.2,-10.39); + d=NSMakePoint(100,0); #define D \ - ti=1.0-t; \ - p.x=ti*ti*ti*a.x + 3*ti*ti*t*b.x + 3*ti*t*t*c.x + t*t*t*d.x; \ - p.y=ti*ti*ti*a.y + 3*ti*ti*t*b.y + 3*ti*t*t*c.y + t*t*t*d.y; \ - printf(" t=%15.7f (%15.7f %15.7f)\n",t,p.x,p.y); + ti=1.0-t; \ + p.x=ti*ti*ti*a.x + 3*ti*ti*t*b.x + 3*ti*t*t*c.x + t*t*t*d.x; \ + p.y=ti*ti*ti*a.y + 3*ti*ti*t*b.y + 3*ti*t*t*c.y + t*t*t*d.y; \ + printf(" t=%15.7f (%15.7f %15.7f)\n",t,p.x,p.y); - t=0; D - t=1; D - t=0.5; D + t=0; D + t=1; D + t=0.5; D - t1=(c.x-2*b.x+a.x + sqrt(a.x*(d.x-c.x)+b.x*(-d.x-c.x)+c.x*c.x+b.x*b.x)) / (-d.x+3*c.x-3*b.x+a.x); - t2=(c.x-2*b.x+a.x - sqrt(a.x*(d.x-c.x)+b.x*(-d.x-c.x)+c.x*c.x+b.x*b.x)) / (-d.x+3*c.x-3*b.x+a.x); - printf("x:\n"); + t1=(c.x-2*b.x+a.x + sqrt(a.x*(d.x-c.x)+b.x*(-d.x-c.x)+c.x*c.x+b.x*b.x)) / (-d.x+3*c.x-3*b.x+a.x); + t2=(c.x-2*b.x+a.x - sqrt(a.x*(d.x-c.x)+b.x*(-d.x-c.x)+c.x*c.x+b.x*b.x)) / (-d.x+3*c.x-3*b.x+a.x); + printf("x:\n"); - t=t1; - D - t=t2; - D + t=t1; + D + t=t2; + D - t1=(c.y-2*b.y+a.y + sqrt(a.y*(d.y-c.y)+b.y*(-d.y-c.y)+c.y*c.y+b.y*b.y)) / (-d.y+3*c.y-3*b.y+a.y); - t2=(c.y-2*b.y+a.y - sqrt(a.y*(d.y-c.y)+b.y*(-d.y-c.y)+c.y*c.y+b.y*b.y)) / (-d.y+3*c.y-3*b.y+a.y); - printf("y:\n"); - t=t1; - D - t=t2; - D - } + t1=(c.y-2*b.y+a.y + sqrt(a.y*(d.y-c.y)+b.y*(-d.y-c.y)+c.y*c.y+b.y*b.y)) / (-d.y+3*c.y-3*b.y+a.y); + t2=(c.y-2*b.y+a.y - sqrt(a.y*(d.y-c.y)+b.y*(-d.y-c.y)+c.y*c.y+b.y*b.y)) / (-d.y+3*c.y-3*b.y+a.y); + printf("y:\n"); + t=t1; + D + t=t2; + D + } // printf("bounds=%@\n",NSStringFromRect([p bounds])); - DESTROY(arp); + DESTROY(arp); - return 0; + return 0; } diff --git a/Tests/gui/NSButtonCell/encoding.m b/Tests/gui/NSButtonCell/encoding.m index 9cbdb51f8..d950a1525 100644 --- a/Tests/gui/NSButtonCell/encoding.m +++ b/Tests/gui/NSButtonCell/encoding.m @@ -82,4 +82,6 @@ int main() found, expect); END_SET("NSButtonCell encoding tests") + + return 0; } From c93ee13f571f44394af5c3247a3f70402e4059bf Mon Sep 17 00:00:00 2001 From: rfm Date: Thu, 6 Jun 2024 16:25:43 +0100 Subject: [PATCH 33/48] Fix missing return (suggested by Yavor Doganov) --- Tests/gui/NSMenuItem/encoding.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tests/gui/NSMenuItem/encoding.m b/Tests/gui/NSMenuItem/encoding.m index 8b4862a75..9ea44fd7c 100644 --- a/Tests/gui/NSMenuItem/encoding.m +++ b/Tests/gui/NSMenuItem/encoding.m @@ -62,4 +62,6 @@ int main() [encodedKeyMask intValue], NSShiftKeyMask) END_SET("NSMenuItem key equivalent mask") + + return 0; } From 1d6a850081c13bd522cbad947857046b18c82372 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sun, 16 Jun 2024 07:12:32 -0400 Subject: [PATCH 34/48] Make correctiongs as suggested by @fredkiefer --- Source/NSTableView.m | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Source/NSTableView.m b/Source/NSTableView.m index ed87441a1..4234c9200 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -6969,7 +6969,6 @@ For a more detailed explanation, -setSortDescriptors:. */ if (_viewBased == YES) { - // NSLog(@"_rowViews = %@", _rowViews); if (row < [_rowViews count]) { rv = [_rowViews objectAtIndex: row]; @@ -6983,11 +6982,10 @@ For a more detailed explanation, -setSortDescriptors:. */ { rv = [_delegate tableView: self rowViewForRow: row]; } - } - - if (rv == nil) - { - rv = [[NSTableRowView alloc] init]; + if (rv == nil) + { + rv = [[NSTableRowView alloc] init]; + } } [_rowViews addObject: rv]; @@ -7023,7 +7021,6 @@ For a more detailed explanation, -setSortDescriptors:. */ } } - // [view setPostsFrameChangedNotifications: NO]; [view setFrame: drawingRect]; [self _setRenderedView: view forPath: path]; From a815ad5bb851755751cfb9b09d8e2a72f7b1f4c7 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sun, 16 Jun 2024 07:25:44 -0400 Subject: [PATCH 35/48] Edits suggested by @fredkiefer during review --- ChangeLog | 2 +- Source/GSThemeDrawing.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 20e7237ff..1456e25db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,7 +37,7 @@ 2024-05-26 Fred Kiefer - * ChangeLog: Update for new release + * ChangeLog: Update for new release * ANNOUNCE: * NEWS: * Documentation/news.texi: Update of release notes for 0.31.0. diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index 97f0e430a..ff7d1a735 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -3667,8 +3667,8 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; makeIfNecessary: YES]; // If the view is already part of the table, don't re-add it... - if ([[tableView subviews] containsObject: rowView] == NO - && rowView != nil) + if (rowView != nil + && [[tableView subviews] containsObject: rowView] == NO) { NSRect cellFrame = [tableView frameOfCellAtColumn: 0 row: rowIndex]; From b4c98b329b1ee1345091968a26919028a92f2e41 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sun, 16 Jun 2024 08:38:12 -0400 Subject: [PATCH 36/48] Move method that renders the outline icon per discussion with @fredkiefer, also includes some whitespace fixes --- Headers/Additions/GNUstepGUI/GSTheme.h | 6 - Source/GSThemeDrawing.m | 81 +-- Source/NSOutlineView.m | 827 +++++++++++++------------ 3 files changed, 456 insertions(+), 458 deletions(-) diff --git a/Headers/Additions/GNUstepGUI/GSTheme.h b/Headers/Additions/GNUstepGUI/GSTheme.h index db81e124b..37328722d 100644 --- a/Headers/Additions/GNUstepGUI/GSTheme.h +++ b/Headers/Additions/GNUstepGUI/GSTheme.h @@ -1342,12 +1342,6 @@ APPKIT_EXPORT_CLASS clipRect: (NSRect)clipRect inView: (NSTableView *)view; -- (NSRect) drawOutlineTableColumn: (NSTableColumn *)tb - outlineView: (NSOutlineView *)outlineView - item: (id)item - drawingRect: (NSRect)inputRect - rowIndex: (NSInteger)rowIndex; - - (void) drawCellViewRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect inView: (NSTableView *)v; diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index ff7d1a735..a415fdc45 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -84,6 +84,13 @@ row: (NSInteger)index; @end +@interface NSOutlineView (Private) +- (NSRect) _drawOutlineCell: (NSTableColumn *)tb + item: (id)item + drawingRect: (NSRect)inputRect + rowIndex: (NSInteger)rowIndex; +@end + @interface NSCell (Private) - (void) _setInEditing: (BOOL)flag; - (BOOL) _inEditing; @@ -3549,11 +3556,10 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; if (tb == outlineTableColumn) { - drawingRect = [self drawOutlineTableColumn: tb - outlineView: outlineView - item: item - drawingRect: drawingRect - rowIndex: rowIndex]; + drawingRect = [outlineView _drawOutlineCell: tb + item: item + drawingRect: drawingRect + rowIndex: rowIndex]; } [cell drawWithFrame: drawingRect inView: outlineView]; @@ -3565,71 +3571,6 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; } } -- (NSRect) drawOutlineTableColumn: (NSTableColumn *)tb - outlineView: (NSOutlineView *)outlineView - item: (id)item - drawingRect: (NSRect)inputRect - rowIndex: (NSInteger)rowIndex -{ - NSRect drawingRect = inputRect; - NSImage *image = nil; - NSInteger level = 0; - CGFloat indentationFactor = 0.0; - CGFloat indentationPerLevel = [outlineView indentationPerLevel]; - NSCell *imageCell = nil; - NSRect imageRect; - id delegate = [outlineView delegate]; - - // display the correct arrow... - if ([outlineView isItemExpanded: item]) - { - image = [NSImage imageNamed: @"common_ArrowDownH"]; - } - else - { - image = [NSImage imageNamed: @"common_ArrowRightH"]; - } - - if (![outlineView isExpandable: item]) - { - image = AUTORELEASE([[NSImage alloc] initWithSize: NSMakeSize(14.0,14.0)]); - } - - level = [outlineView levelForItem: item]; - indentationFactor = indentationPerLevel * level; - imageCell = [[NSCell alloc] initImageCell: image]; - imageRect = [outlineView frameOfOutlineCellAtRow: rowIndex]; - - if ([delegate respondsToSelector: @selector(outlineView:willDisplayOutlineCell:forTableColumn:item:)]) - { - [delegate outlineView: outlineView - willDisplayOutlineCell: imageCell - forTableColumn: tb - item: item]; - } - - /* Do not indent if the delegate set the image to nil. */ - if ([imageCell image]) - { - imageRect.size.width = [image size].width; - imageRect.size.height = [image size].height + 5; - [imageCell drawWithFrame: imageRect inView: outlineView]; - drawingRect.origin.x - += indentationFactor + imageRect.size.width + 5; - drawingRect.size.width - -= indentationFactor + imageRect.size.width + 5; - } - else - { - drawingRect.origin.x += indentationFactor; - drawingRect.size.width -= indentationFactor; - } - - RELEASE(imageCell); - - return drawingRect; -} - - (void) drawCellViewRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect inView: (NSTableView *)tableView diff --git a/Source/NSOutlineView.m b/Source/NSOutlineView.m index 794d309b9..e3e78a715 100644 --- a/Source/NSOutlineView.m +++ b/Source/NSOutlineView.m @@ -94,25 +94,25 @@ static NSImage *unexpandable = nil; - (void) _postSelectionIsChangingNotification; - (void) _postSelectionDidChangeNotification; - (void) _postColumnDidMoveNotificationWithOldIndex: (NSInteger) oldIndex - newIndex: (NSInteger) newIndex; + newIndex: (NSInteger) newIndex; // FIXME: There is a method with a similar name.but this is never called //- (void) _postColumnDidResizeNotification; - (BOOL) _shouldSelectTableColumn: (NSTableColumn *)tableColumn; - (BOOL) _shouldSelectRow: (NSInteger)rowIndex; - (BOOL) _shouldSelectionChange; - (BOOL) _shouldEditTableColumn: (NSTableColumn *)tableColumn - row: (NSInteger) rowIndex; + row: (NSInteger) rowIndex; - (void) _willDisplayCell: (NSCell*)cell - forTableColumn: (NSTableColumn *)tb - row: (NSInteger)index; + forTableColumn: (NSTableColumn *)tb + row: (NSInteger)index; - (BOOL) _writeRows: (NSIndexSet *)rows toPasteboard: (NSPasteboard *)pboard; - (BOOL) _isDraggingSource; - (id) _objectValueForTableColumn: (NSTableColumn *)tb - row: (NSInteger)index; + row: (NSInteger)index; - (void) _setObjectValue: (id)value - forTableColumn: (NSTableColumn *)tb - row: (NSInteger) index; + forTableColumn: (NSTableColumn *)tb + row: (NSInteger) index; - (NSInteger) _numRows; @end @@ -122,9 +122,9 @@ static NSImage *unexpandable = nil; - (void) _autosaveExpandedItems; - (void) _autoloadExpandedItems; - (void) _collectItemsStartingWith: (id)startitem - into: (NSMutableArray *)allChildren; + into: (NSMutableArray *)allChildren; - (void) _loadDictionaryStartingWith: (id) startitem - atLevel: (NSInteger) level; + atLevel: (NSInteger) level; - (void) _openItem: (id)item; - (void) _closeItem: (id)item; - (void) _removeChildren: (id)startitem; @@ -203,13 +203,13 @@ static NSImage *unexpandable = nil; { // notify when an item expands... [nc removeObserver: self - name: NSOutlineViewItemDidExpandNotification - object: self]; + name: NSOutlineViewItemDidExpandNotification + object: self]; // notify when an item collapses... [nc removeObserver: self - name: NSOutlineViewItemDidCollapseNotification - object: self]; + name: NSOutlineViewItemDidCollapseNotification + object: self]; } [super dealloc]; @@ -266,32 +266,32 @@ static NSImage *unexpandable = nil; // Send out the notification to let observers know that this is about // to occur. [nc postNotificationName: NSOutlineViewItemWillCollapseNotification - object: self - userInfo: infoDict]; + object: self + userInfo: infoDict]; // recursively find all children and call this method to close them. // Note: The children must be collapsed before their parent item so // that the selected row indexes are properly updated (and in particular // are valid when we post our notifications). if (collapseChildren) // collapse all - { - int index, numChildren; - NSMutableArray *allChildren; - id sitem = (item == nil) ? (id)[NSNull null] : (id)item; + { + int index, numChildren; + NSMutableArray *allChildren; + id sitem = (item == nil) ? (id)[NSNull null] : (id)item; - allChildren = NSMapGet(_itemDict, sitem); - numChildren = [allChildren count]; + allChildren = NSMapGet(_itemDict, sitem); + numChildren = [allChildren count]; - for (index = 0; index < numChildren; index++) - { - id child = [allChildren objectAtIndex: index]; + for (index = 0; index < numChildren; index++) + { + id child = [allChildren objectAtIndex: index]; - if ([self isExpandable: child]) - { - [self collapseItem: child collapseChildren: collapseChildren]; - } - } - } + if ([self isExpandable: child]) + { + [self collapseItem: child collapseChildren: collapseChildren]; + } + } + } // collapse... [self _closeItem: item]; @@ -299,12 +299,12 @@ static NSImage *unexpandable = nil; // Send out the notification to let observers know that this has // occurred. [nc postNotificationName: NSOutlineViewItemDidCollapseNotification - object: self - userInfo: infoDict]; + object: self + userInfo: infoDict]; // Should only mark the rect below the closed item for redraw [self setNeedsDisplay: YES]; - + // If it is view based, then refresh the outline view... if (_viewBased) { @@ -342,48 +342,48 @@ static NSImage *unexpandable = nil; { // if it is not already expanded and it can be expanded, then expand if (![self isItemExpanded: item] && canExpand) - { - NSMutableDictionary *infoDict = [NSMutableDictionary dictionary]; + { + NSMutableDictionary *infoDict = [NSMutableDictionary dictionary]; - [infoDict setObject: item forKey: @"NSObject"]; + [infoDict setObject: item forKey: @"NSObject"]; - // Send out the notification to let observers know that this is about - // to occur. - [nc postNotificationName: NSOutlineViewItemWillExpandNotification - object: self - userInfo: infoDict]; + // Send out the notification to let observers know that this is about + // to occur. + [nc postNotificationName: NSOutlineViewItemWillExpandNotification + object: self + userInfo: infoDict]; - // insert the root element, if necessary otherwise insert the - // actual object. - [self _openItem: item]; + // insert the root element, if necessary otherwise insert the + // actual object. + [self _openItem: item]; - // Send out the notification to let observers know that this has - // occurred. - [nc postNotificationName: NSOutlineViewItemDidExpandNotification - object: self - userInfo: infoDict]; - } + // Send out the notification to let observers know that this has + // occurred. + [nc postNotificationName: NSOutlineViewItemDidExpandNotification + object: self + userInfo: infoDict]; + } // recursively find all children and call this method to open them. if (expandChildren) // expand all - { - int index, numChildren; - NSMutableArray *allChildren; - id sitem = (item == nil) ? (id)[NSNull null] : (id)item; + { + int index, numChildren; + NSMutableArray *allChildren; + id sitem = (item == nil) ? (id)[NSNull null] : (id)item; - allChildren = NSMapGet(_itemDict, sitem); - numChildren = [allChildren count]; + allChildren = NSMapGet(_itemDict, sitem); + numChildren = [allChildren count]; - for (index = 0; index < numChildren; index++) - { - id child = [allChildren objectAtIndex: index]; + for (index = 0; index < numChildren; index++) + { + id child = [allChildren objectAtIndex: index]; - if ([self isExpandable: child]) - { - [self expandItem: child expandChildren: expandChildren]; - } - } - } + if ([self isExpandable: child]) + { + [self expandItem: child expandChildren: expandChildren]; + } + } + } // Should only mark the rect below the expanded item for redraw [self setNeedsDisplay: YES]; @@ -404,8 +404,8 @@ static NSImage *unexpandable = nil; return NSZeroRect; frameRect = [self frameOfCellAtColumn: 0 - row: row]; - + row: row]; + if (_indentationMarkerFollowsCell) { frameRect.origin.x += _indentationPerLevel * [self levelForRow: row]; @@ -523,9 +523,9 @@ static NSImage *unexpandable = nil; NSMutableArray *childArray = NSMapGet(_itemDict, parent); if ((index = [childArray indexOfObjectIdenticalTo: item]) != NSNotFound) - { - return (parent == [NSNull null]) ? (id)nil : (id)parent; - } + { + return (parent == [NSNull null]) ? (id)nil : (id)parent; + } } return nil; @@ -563,32 +563,32 @@ static NSImage *unexpandable = nil; NSMutableArray *childArray = NSMapGet(_itemDict, parent); if ((index = [childArray indexOfObjectIdenticalTo: object]) != NSNotFound) - { - parent = (parent == [NSNull null]) ? (id)nil : (id)parent; - dsobj = [_dataSource outlineView: self - child: index - ofItem: parent]; + { + parent = (parent == [NSNull null]) ? (id)nil : (id)parent; + dsobj = [_dataSource outlineView: self + child: index + ofItem: parent]; - if (dsobj != item) - { - [childArray replaceObjectAtIndex: index withObject: dsobj]; - // FIXME We need to correct _items, _itemDict, _levelOfItems, - // _expandedItems and _selectedItems - } - break; - } + if (dsobj != item) + { + [childArray replaceObjectAtIndex: index withObject: dsobj]; + // FIXME We need to correct _items, _itemDict, _levelOfItems, + // _expandedItems and _selectedItems + } + break; + } } if (reloadChildren) { [self _removeChildren: dsobj]; [self _loadDictionaryStartingWith: dsobj - atLevel: [self levelForItem: dsobj]]; + atLevel: [self levelForItem: dsobj]]; if (expanded) - { - [self _openItem: dsobj]; - } + { + [self _openItem: dsobj]; + } } [self setNeedsDisplay: YES]; } @@ -635,27 +635,27 @@ static NSImage *unexpandable = nil; [self _autoloadExpandedItems]; // notify when an item expands... [nc addObserver: self - selector: @selector(_autosaveExpandedItems) - name: NSOutlineViewItemDidExpandNotification - object: self]; + selector: @selector(_autosaveExpandedItems) + name: NSOutlineViewItemDidExpandNotification + object: self]; // notify when an item collapses... [nc addObserver: self - selector: @selector(_autosaveExpandedItems) - name: NSOutlineViewItemDidCollapseNotification - object: self]; + selector: @selector(_autosaveExpandedItems) + name: NSOutlineViewItemDidCollapseNotification + object: self]; } else { // notify when an item expands... [nc removeObserver: self - name: NSOutlineViewItemDidExpandNotification - object: self]; + name: NSOutlineViewItemDidExpandNotification + object: self]; // notify when an item collapses... [nc removeObserver: self - name: NSOutlineViewItemDidCollapseNotification - object: self]; + name: NSOutlineViewItemDidCollapseNotification + object: self]; } } @@ -702,12 +702,12 @@ static NSImage *unexpandable = nil; #define CHECK_REQUIRED_METHOD(selector_name) \ if (anObject && ![anObject respondsToSelector: @selector(selector_name)]) \ [NSException raise: NSInternalInconsistencyException \ - format: @"data source does not respond to %@", @#selector_name] + format: @"data source does not respond to %@", @#selector_name] CHECK_REQUIRED_METHOD(outlineView:child:ofItem:); CHECK_REQUIRED_METHOD(outlineView:isItemExpandable:); CHECK_REQUIRED_METHOD(outlineView:numberOfChildrenOfItem:); - + // This method is @optional in NSOutlineViewDataSource as of macOS10.0 // CHECK_REQUIRED_METHOD(outlineView:objectValueForTableColumn:byItem:); @@ -737,7 +737,7 @@ static NSImage *unexpandable = nil; [v removeFromSuperview]; } } - + // release the old array if (_items != nil) { @@ -757,11 +757,11 @@ static NSImage *unexpandable = nil; // create a new empty one _items = [[NSMutableArray alloc] init]; _itemDict = NSCreateMapTable(keyCallBacks, - NSObjectMapValueCallBacks, - 64); + NSObjectMapValueCallBacks, + 64); _levelOfItems = NSCreateMapTable(keyCallBacks, - NSObjectMapValueCallBacks, - 64); + NSObjectMapValueCallBacks, + 64); // reload all the open items... [self _openItem: nil]; @@ -804,13 +804,13 @@ static NSImage *unexpandable = nil; { float indentation = _indentationPerLevel; [aCoder encodeValueOfObjCType: @encode(BOOL) - at: &_autoResizesOutlineColumn]; + at: &_autoResizesOutlineColumn]; [aCoder encodeValueOfObjCType: @encode(BOOL) - at: &_indentationMarkerFollowsCell]; + at: &_indentationMarkerFollowsCell]; [aCoder encodeValueOfObjCType: @encode(BOOL) - at: &_autosaveExpandedItems]; + at: &_autosaveExpandedItems]; [aCoder encodeValueOfObjCType: @encode(float) - at: &indentation]; + at: &indentation]; [aCoder encodeConditionalObject: _outlineTableColumn]; } } @@ -828,22 +828,22 @@ static NSImage *unexpandable = nil; { // init the table column... (this can't be chosen on IB either)... if ([_tableColumns count] > 0) - { - _outlineTableColumn = [_tableColumns objectAtIndex: 0]; - } + { + _outlineTableColumn = [_tableColumns objectAtIndex: 0]; + } } else { float indentation; // overrides outline defaults with archived values [aDecoder decodeValueOfObjCType: @encode(BOOL) - at: &_autoResizesOutlineColumn]; + at: &_autoResizesOutlineColumn]; [aDecoder decodeValueOfObjCType: @encode(BOOL) - at: &_indentationMarkerFollowsCell]; + at: &_indentationMarkerFollowsCell]; [aDecoder decodeValueOfObjCType: @encode(BOOL) - at: &_autosaveExpandedItems]; + at: &_autosaveExpandedItems]; [aDecoder decodeValueOfObjCType: @encode(float) - at: &indentation]; + at: &indentation]; _indentationPerLevel = indentation; _outlineTableColumn = [aDecoder decodeObject]; } @@ -868,37 +868,37 @@ static NSImage *unexpandable = nil; NSInteger position = 0; if ([self isItemExpanded: item]) - { - image = expanded; - } + { + image = expanded; + } else - { - image = collapsed; - } + { + image = collapsed; + } if (_indentationMarkerFollowsCell) - { - position = _indentationPerLevel * level; - } + { + position = _indentationPerLevel * level; + } position += _columnOrigins[_clickedColumn]; if ([self isExpandable:item] && location.x >= position - 5 && location.x <= position + [image size].width + 10) - { - BOOL withChildren = + { + BOOL withChildren = ([theEvent modifierFlags] & NSAlternateKeyMask) ? YES : NO; - if (![self isItemExpanded: item]) - { - [self expandItem: item expandChildren: withChildren]; - } - else - { - [self collapseItem: item collapseChildren: withChildren]; - } - return; - } + if (![self isItemExpanded: item]) + { + [self expandItem: item expandChildren: withChildren]; + } + else + { + [self collapseItem: item collapseChildren: withChildren]; + } + return; + } } [super mouseDown: theEvent]; @@ -946,7 +946,7 @@ static NSImage *unexpandable = nil; } } } - + [super keyDown: event]; } @@ -977,14 +977,14 @@ static NSImage *unexpandable = nil; { CGFloat widest = 0; for (index = 0; index < _numberOfRows; index++) - { - CGFloat offset = [self levelForRow: index] * - [self indentationPerLevel]; - NSRect drawingRect = [self frameOfCellAtColumn: 0 - row: index]; - CGFloat length = drawingRect.size.width + offset; - if (widest < length) widest = length; - } + { + CGFloat offset = [self levelForRow: index] * + [self indentationPerLevel]; + NSRect drawingRect = [self frameOfCellAtColumn: 0 + row: index]; + CGFloat length = drawingRect.size.width + offset; + if (widest < length) widest = length; + } // [_outlineTableColumn setWidth: widest]; } @@ -1032,9 +1032,9 @@ static NSImage *unexpandable = nil; } // TODO: Move the part that starts at 'Compute the indicator rect area' to GSTheme -- (void) drawDropAboveIndicatorWithDropItem: (id)currentDropItem - atRow: (NSInteger)row - childDropIndex: (NSInteger)currentDropIndex +- (void) drawDropAboveIndicatorWithDropItem: (id)currentDropItem + atRow: (NSInteger)row + childDropIndex: (NSInteger)currentDropIndex { NSInteger level = 0; NSBezierPath *path = nil; @@ -1044,23 +1044,23 @@ static NSImage *unexpandable = nil; if (currentDropItem == nil && currentDropIndex == 0) { newRect = NSMakeRect([self visibleRect].origin.x, - 0, - [self visibleRect].size.width, - 2); + 0, + [self visibleRect].size.width, + 2); } else if (row == _numberOfRows) { newRect = NSMakeRect([self visibleRect].origin.x, - row * _rowHeight - 2, - [self visibleRect].size.width, - 2); + row * _rowHeight - 2, + [self visibleRect].size.width, + 2); } else { newRect = NSMakeRect([self visibleRect].origin.x, - row * _rowHeight - 1, - [self visibleRect].size.width, - 2); + row * _rowHeight - 1, + [self visibleRect].size.width, + 2); } level = [self levelForItem: currentDropItem] + 1; newRect.origin.x += level * _indentationPerLevel; @@ -1119,7 +1119,7 @@ static NSImage *unexpandable = nil; NSInteger row = [_items indexOfObjectIdenticalTo: currentDropItem]; NSInteger level = [self levelForItem: currentDropItem]; NSRect newRect = [self frameOfCellAtColumn: 0 - row: row]; + row: row]; newRect.origin.x = _bounds.origin.x; newRect.size.width = _bounds.size.width + 2; @@ -1130,7 +1130,7 @@ static NSImage *unexpandable = nil; oldDraggingRect = newRect; oldDraggingRect.origin.y -= 1; oldDraggingRect.size.height += 2; - + newRect.size.height -= 1; newRect.origin.x += 3; newRect.size.width -= 3; @@ -1142,7 +1142,7 @@ static NSImage *unexpandable = nil; //newRect.size.width -= 2; newRect.size.height += 1; } - + newRect.origin.x += level * _indentationPerLevel; newRect.size.width -= level * _indentationPerLevel; @@ -1150,11 +1150,11 @@ static NSImage *unexpandable = nil; NSFrameRectWithWidth(newRect, 2.0); } -/* Returns the row whose item is the parent that owns the child at the given row. +/* Returns the row whose item is the parent that owns the child at the given row. Also returns the child index relative to this parent. */ -- (NSInteger) _parentRowForRow: (NSInteger)row - atLevel: (NSInteger)level - andReturnChildIndex: (NSInteger *)childIndex +- (NSInteger) _parentRowForRow: (NSInteger)row + atLevel: (NSInteger)level + andReturnChildIndex: (NSInteger *)childIndex { NSInteger i; NSInteger lvl; @@ -1173,11 +1173,11 @@ Also returns the child index relative to this parent. */ if (foundParent) { - break; + break; } else if (foundSibling) { - (*childIndex)++; + (*childIndex)++; } } @@ -1188,15 +1188,15 @@ Also returns the child index relative to this parent. */ { NSPoint p = [self convertPoint: [sender draggingLocation] fromView: nil]; /* The insertion row. - * The insertion row is identical to the hovered row, except when p is in + * The insertion row is identical to the hovered row, except when p is in * the hovered row bottom part (the last quarter). */ NSInteger row; /* A row can be divided into 4 vertically stacked portions. - * We call each portion a quarter. - * verticalQuarterPosition is the number of quarters that exists between the - * top left origin (NSOutlineView is flipped) and the hovered row (precisely - * up to the quarter occupied by the pointer in this row). + * We call each portion a quarter. + * verticalQuarterPosition is the number of quarters that exists between the + * top left origin (NSOutlineView is flipped) and the hovered row (precisely + * up to the quarter occupied by the pointer in this row). */ NSInteger verticalQuarterPosition; /* An indentation unit can be divided into 2 portions (left and right). @@ -1210,7 +1210,7 @@ Also returns the child index relative to this parent. */ NSInteger levelBefore; /* The next row level (the row after the insertion row) */ NSInteger levelAfter; - /* The insertion level that may vary with the horizontal pointer position, + /* The insertion level that may vary with the horizontal pointer position, * when the pointer is between two rows and the bottom row is a parent. */ NSInteger level; @@ -1271,39 +1271,39 @@ Also returns the child index relative to this parent. */ lastVerticalQuarterPosition = verticalQuarterPosition; lastHorizontalHalfPosition = horizontalHalfPosition; - /* When the row before is an empty parent, we allow to insert the dragged - * item as its child. + /* When the row before is an empty parent, we allow to insert the dragged + * item as its child. */ if ([self isExpandable: [self itemAtRow: (row - 1)]]) - { - maxInsertionLevel++; - } + { + maxInsertionLevel++; + } /* Find the insertion level to be used with a drop above * - * In the outline below, when the pointer moves horizontally on - * the dashed line, it can insert at three levels: x level, C level or + * In the outline below, when the pointer moves horizontally on + * the dashed line, it can insert at three levels: x level, C level or * B/D level but not at A level. - * + * * + A * + B * + C * - x * --- pointer --- - * + D + * + D */ if (pointerInsertionLevel < minInsertionLevel) - { - level = minInsertionLevel; - } + { + level = minInsertionLevel; + } else if (pointerInsertionLevel > maxInsertionLevel) - { - level = maxInsertionLevel; - } + { + level = maxInsertionLevel; + } else - { - level = pointerInsertionLevel; - } + { + level = pointerInsertionLevel; + } //NSLog(@"min insert level = %d", minInsertionLevel); //NSLog(@"max insert level = %d", maxInsertionLevel); @@ -1320,45 +1320,45 @@ Also returns the child index relative to this parent. */ } else /* Drop above */ { - NSInteger childIndex = 0; - NSInteger parentRow = [self _parentRowForRow: row - atLevel: level - andReturnChildIndex: &childIndex]; + NSInteger childIndex = 0; + NSInteger parentRow = [self _parentRowForRow: row + atLevel: level + andReturnChildIndex: &childIndex]; //NSLog(@"found %d (proposed childIndex = %d)", parentRow, childIndex); currentDropItem = (parentRow == -1 ? nil : [self itemAtRow: parentRow]); - currentDropIndex = childIndex; + currentDropIndex = childIndex; } if ([_dataSource respondsToSelector: @selector(outlineView:validateDrop:proposedItem:proposedChildIndex:)]) - { - dragOperation = [_dataSource outlineView: self - validateDrop: sender - proposedItem: currentDropItem + { + dragOperation = [_dataSource outlineView: self + validateDrop: sender + proposedItem: currentDropItem proposedChildIndex: currentDropIndex]; - } + } //NSLog(@"Drop on %@ %d", currentDropItem, currentDropIndex); if ((currentDropItem != oldDropItem) || (currentDropIndex != oldDropIndex)) - { - oldDropItem = currentDropItem; - oldDropIndex = currentDropIndex; + { + oldDropItem = currentDropItem; + oldDropIndex = currentDropIndex; ASSIGN(lastDragChange, lastDragUpdate); - [self lockFocus]; + [self lockFocus]; - [self setNeedsDisplayInRect: oldDraggingRect]; - [self displayIfNeeded]; + [self setNeedsDisplayInRect: oldDraggingRect]; + [self displayIfNeeded]; if (dragOperation != NSDragOperationNone) { if (currentDropIndex != NSOutlineViewDropOnItemIndex && currentDropItem != nil) { - [self drawDropAboveIndicatorWithDropItem: currentDropItem + [self drawDropAboveIndicatorWithDropItem: currentDropItem atRow: row childDropIndex: currentDropIndex]; } @@ -1372,10 +1372,10 @@ Also returns the child index relative to this parent. */ } } - [_window flushWindow]; - [self unlockFocus]; + [_window flushWindow]; + [self unlockFocus]; - } + } } else if (row != _numberOfRows) { @@ -1408,8 +1408,8 @@ Also returns the child index relative to this parent. */ BOOL result = NO; if ([_dataSource - respondsToSelector: - @selector(outlineView:acceptDrop:item:childIndex:)]) + respondsToSelector: + @selector(outlineView:acceptDrop:item:childIndex:)]) { result = [_dataSource outlineView: self acceptDrop: sender @@ -1433,21 +1433,21 @@ Also returns the child index relative to this parent. */ - (NSArray*) namesOfPromisedFilesDroppedAtDestination: (NSURL *)dropDestination { if ([_dataSource respondsToSelector: - @selector(outlineView:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:)]) + @selector(outlineView:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:)]) { NSUInteger count = [_selectedRows count]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity: count]; NSUInteger index = [_selectedRows firstIndex]; - + while (index != NSNotFound) - { - [itemArray addObject: [self itemAtRow: index]]; - index = [_selectedRows indexGreaterThanIndex: index]; - } + { + [itemArray addObject: [self itemAtRow: index]]; + index = [_selectedRows indexGreaterThanIndex: index]; + } return [_dataSource outlineView: self - namesOfPromisedFilesDroppedAtDestination: dropDestination - forDraggedItems: itemArray]; + namesOfPromisedFilesDroppedAtDestination: dropDestination + forDraggedItems: itemArray]; } else { @@ -1463,9 +1463,9 @@ Also returns the child index relative to this parent. */ } - (void) editColumn: (NSInteger) columnIndex - row: (NSInteger) rowIndex - withEvent: (NSEvent *) theEvent - select: (BOOL) flag + row: (NSInteger) rowIndex + withEvent: (NSEvent *) theEvent + select: (BOOL) flag { NSText *t; NSTableColumn *tb; @@ -1489,7 +1489,7 @@ Also returns the child index relative to this parent. */ || columnIndex < 0 || columnIndex >= _numberOfColumns) { [NSException raise: NSInvalidArgumentException - format: @"Row/column out of index in edit"]; + format: @"Row/column out of index in edit"]; } [self scrollRowToVisible: rowIndex]; @@ -1508,9 +1508,9 @@ Also returns the child index relative to this parent. */ if ([t superview] != nil) { if ([t resignFirstResponder] == NO) - { - return; - } + { + return; + } } _editedRow = rowIndex; @@ -1523,12 +1523,12 @@ Also returns the child index relative to this parent. */ [_editedCell setEditable: _dataSource_editable]; tb = [_tableColumns objectAtIndex: columnIndex]; [_editedCell setObjectValue: [self _objectValueForTableColumn: tb - row: rowIndex]]; + row: rowIndex]]; // But of course the delegate can mess it up if it wants [self _willDisplayCell: _editedCell - forTableColumn: tb - row: rowIndex]; + forTableColumn: tb + row: rowIndex]; /* Please note the important point - calling stringValue normally causes the _editedCell to call the validateEditing method of its @@ -1564,18 +1564,18 @@ Also returns the child index relative to this parent. */ item = [self itemAtRow: rowIndex]; // determine which image to use... if ([self isItemExpanded: item]) - { - image = expanded; - } + { + image = expanded; + } else - { - image = collapsed; - } + { + image = collapsed; + } if (![self isExpandable: item]) - { - image = unexpandable; - } + { + image = unexpandable; + } level = [self levelForItem: item]; indentationFactor = _indentationPerLevel * level; @@ -1584,36 +1584,36 @@ Also returns the child index relative to this parent. */ imageRect = [self frameOfOutlineCellAtRow: rowIndex]; if ([_delegate respondsToSelector: @selector(outlineView:willDisplayOutlineCell:forTableColumn:item:)]) - { - [_delegate outlineView: self - willDisplayOutlineCell: imageCell - forTableColumn: tb - item: item]; - } + { + [_delegate outlineView: self + willDisplayOutlineCell: imageCell + forTableColumn: tb + item: item]; + } if ([imageCell image]) - { + { - imageRect.size.width = [image size].width; - imageRect.size.height = [image size].height; - - // draw... - [self lockFocus]; - [imageCell drawWithFrame: imageRect inView: self]; - [self unlockFocus]; - - // move the drawing rect over like in the drawRow routine... - drawingRect.origin.x += indentationFactor + 5 + imageRect.size.width; - drawingRect.size.width - -= indentationFactor + 5 + imageRect.size.width; - } + imageRect.size.width = [image size].width; + imageRect.size.height = [image size].height; + + // draw... + [self lockFocus]; + [imageCell drawWithFrame: imageRect inView: self]; + [self unlockFocus]; + + // move the drawing rect over like in the drawRow routine... + drawingRect.origin.x += indentationFactor + 5 + imageRect.size.width; + drawingRect.size.width + -= indentationFactor + 5 + imageRect.size.width; + } else - { - // move the drawing rect over like in the drawRow routine... - drawingRect.origin.x += indentationFactor; - drawingRect.size.width -= indentationFactor; - } + { + // move the drawing rect over like in the drawRow routine... + drawingRect.origin.x += indentationFactor; + drawingRect.size.width -= indentationFactor; + } RELEASE(imageCell); } @@ -1621,19 +1621,19 @@ Also returns the child index relative to this parent. */ if (flag) { [_editedCell selectWithFrame: drawingRect - inView: self - editor: _textObject - delegate: self - start: 0 - length: length]; + inView: self + editor: _textObject + delegate: self + start: 0 + length: length]; } else { [_editedCell editWithFrame: drawingRect - inView: self - editor: _textObject - delegate: self - event: theEvent]; + inView: self + editor: _textObject + delegate: self + event: theEvent]; } return; @@ -1648,40 +1648,40 @@ Also returns the child index relative to this parent. */ - (void) _postSelectionIsChangingNotification { [nc postNotificationName: - NSOutlineViewSelectionIsChangingNotification + NSOutlineViewSelectionIsChangingNotification object: self]; } - (void) _postSelectionDidChangeNotification { [nc postNotificationName: - NSOutlineViewSelectionDidChangeNotification + NSOutlineViewSelectionDidChangeNotification object: self]; } - (void) _postColumnDidMoveNotificationWithOldIndex: (NSInteger) oldIndex - newIndex: (NSInteger) newIndex + newIndex: (NSInteger) newIndex { [nc postNotificationName: - NSOutlineViewColumnDidMoveNotification + NSOutlineViewColumnDidMoveNotification object: self userInfo: [NSDictionary - dictionaryWithObjectsAndKeys: - [NSNumber numberWithInteger: newIndex], - @"NSNewColumn", - [NSNumber numberWithInteger: oldIndex], - @"NSOldColumn", - nil]]; + dictionaryWithObjectsAndKeys: + [NSNumber numberWithInteger: newIndex], + @"NSNewColumn", + [NSNumber numberWithInteger: oldIndex], + @"NSOldColumn", + nil]]; } - (void) _postColumnDidResizeNotificationWithOldWidth: (float) oldWidth { [nc postNotificationName: - NSOutlineViewColumnDidResizeNotification + NSOutlineViewColumnDidResizeNotification object: self userInfo: [NSDictionary - dictionaryWithObjectsAndKeys: - [NSNumber numberWithFloat: oldWidth], - @"NSOldWidth", - nil]]; + dictionaryWithObjectsAndKeys: + [NSNumber numberWithFloat: oldWidth], + @"NSOldWidth", + nil]]; } - (BOOL) _shouldSelectTableColumn: (NSTableColumn *)tableColumn @@ -1690,10 +1690,10 @@ Also returns the child index relative to this parent. */ @selector (outlineView:shouldSelectTableColumn:)] == YES) { if ([_delegate outlineView: self shouldSelectTableColumn: tableColumn] - == NO) - { - return NO; - } + == NO) + { + return NO; + } } return YES; @@ -1707,9 +1707,9 @@ Also returns the child index relative to this parent. */ @selector (outlineView:shouldSelectItem:)] == YES) { if ([_delegate outlineView: self shouldSelectItem: item] == NO) - { - return NO; - } + { + return NO; + } } return YES; @@ -1721,9 +1721,9 @@ Also returns the child index relative to this parent. */ @selector (selectionShouldChangeInOutlineView:)] == YES) { if ([_delegate selectionShouldChangeInOutlineView: self] == NO) - { - return NO; - } + { + return NO; + } } return YES; @@ -1731,7 +1731,7 @@ Also returns the child index relative to this parent. */ - (void) _didChangeSortDescriptors: (NSArray *)oldSortDescriptors { - if ([_dataSource + if ([_dataSource respondsToSelector: @selector(outlineView:sortDescriptorsDidChange:)]) { [_dataSource outlineView: self @@ -1741,7 +1741,7 @@ Also returns the child index relative to this parent. */ - (void) _didClickTableColumn: (NSTableColumn *)tc { - if ([_delegate + if ([_delegate respondsToSelector: @selector(outlineView:didClickTableColumn:)]) { [_delegate outlineView: self didClickTableColumn: tc]; @@ -1749,7 +1749,7 @@ Also returns the child index relative to this parent. */ } - (BOOL) _shouldEditTableColumn: (NSTableColumn *)tableColumn - row: (NSInteger) rowIndex + row: (NSInteger) rowIndex { if ([_delegate respondsToSelector: @selector(outlineView:shouldEditTableColumn:item:)]) @@ -1757,27 +1757,27 @@ Also returns the child index relative to this parent. */ id item = [self itemAtRow: rowIndex]; if ([_delegate outlineView: self shouldEditTableColumn: tableColumn - item: item] == NO) - { - return NO; - } + item: item] == NO) + { + return NO; + } } return YES; } - (void) _willDisplayCell: (NSCell*)cell - forTableColumn: (NSTableColumn *)tb - row: (NSInteger)index + forTableColumn: (NSTableColumn *)tb + row: (NSInteger)index { if (_del_responds) { id item = [self itemAtRow: index]; [_delegate outlineView: self - willDisplayCell: cell - forTableColumn: tb - item: item]; + willDisplayCell: cell + forTableColumn: tb + item: item]; } } @@ -1795,11 +1795,11 @@ Also returns the child index relative to this parent. */ } if ([_dataSource respondsToSelector: - @selector(outlineView:writeItems:toPasteboard:)] == YES) + @selector(outlineView:writeItems:toPasteboard:)] == YES) { return [_dataSource outlineView: self - writeItems: itemArray - toPasteboard: pboard]; + writeItems: itemArray + toPasteboard: pboard]; } return NO; } @@ -1807,11 +1807,11 @@ Also returns the child index relative to this parent. */ - (BOOL) _isDraggingSource { return [_dataSource respondsToSelector: - @selector(outlineView:writeItems:toPasteboard:)]; + @selector(outlineView:writeItems:toPasteboard:)]; } - (id) _objectValueForTableColumn: (NSTableColumn *)tb - row: (NSInteger) index + row: (NSInteger) index { id result = nil; @@ -1821,16 +1821,16 @@ Also returns the child index relative to this parent. */ id item = [self itemAtRow: index]; result = [_dataSource outlineView: self - objectValueForTableColumn: tb - byItem: item]; + objectValueForTableColumn: tb + byItem: item]; } return result; } - (void) _setObjectValue: (id)value - forTableColumn: (NSTableColumn *)tb - row: (NSInteger) index + forTableColumn: (NSTableColumn *)tb + row: (NSInteger) index { if ([_dataSource respondsToSelector: @selector(outlineView:setObjectValue:forTableColumn:byItem:)]) @@ -1838,9 +1838,9 @@ Also returns the child index relative to this parent. */ id item = [self itemAtRow: index]; [_dataSource outlineView: self - setObjectValue: value - forTableColumn: tb - byItem: item]; + setObjectValue: value + forTableColumn: tb + byItem: item]; } } @@ -1856,13 +1856,13 @@ Also returns the child index relative to this parent. */ - (void) _initOutlineDefaults { _itemDict = NSCreateMapTable(keyCallBacks, - NSObjectMapValueCallBacks, - 64); + NSObjectMapValueCallBacks, + 64); _items = [[NSMutableArray alloc] init]; _expandedItems = [[NSMutableArray alloc] init]; _levelOfItems = NSCreateMapTable(keyCallBacks, - NSObjectMapValueCallBacks, - 64); + NSObjectMapValueCallBacks, + 64); _indentationMarkerFollowsCell = YES; _autoResizesOutlineColumn = NO; @@ -1879,7 +1879,7 @@ Also returns the child index relative to this parent. */ defaults = [NSUserDefaults standardUserDefaults]; tableKey = [NSString stringWithFormat: @"NSOutlineView Expanded Items %@", - _autosaveName]; + _autosaveName]; [defaults setObject: _expandedItems forKey: tableKey]; [defaults synchronize]; } @@ -1895,24 +1895,24 @@ Also returns the child index relative to this parent. */ defaults = [NSUserDefaults standardUserDefaults]; tableKey = [NSString stringWithFormat: @"NSOutlineView Expanded Items %@", - _autosaveName]; + _autosaveName]; config = [defaults objectForKey: tableKey]; if (config != nil) - { - NSEnumerator *en = [config objectEnumerator]; - id item = nil; + { + NSEnumerator *en = [config objectEnumerator]; + id item = nil; - while ((item = [en nextObject]) != nil) - { - [self expandItem: item]; - } - } + while ((item = [en nextObject]) != nil) + { + [self expandItem: item]; + } + } } } // Collect all of the items under a given element. - (void)_collectItemsStartingWith: (id)startitem - into: (NSMutableArray *)allChildren + into: (NSMutableArray *)allChildren { NSUInteger num; NSUInteger i; @@ -1927,12 +1927,12 @@ Also returns the child index relative to this parent. */ // Only collect the children if the item is expanded if ([self isItemExpanded: startitem]) - { - [allChildren addObject: anitem]; - } + { + [allChildren addObject: anitem]; + } [self _collectItemsStartingWith: anitem - into: allChildren]; + into: allChildren]; } } @@ -1941,28 +1941,28 @@ Also returns the child index relative to this parent. */ id sitem = (item == nil) ? (id)[NSNull null] : (id)item; id object = NSMapGet(_itemDict, sitem); - // NOTE: We could store the loaded items in a map to ensure we only load + // NOTE: We could store the loaded items in a map to ensure we only load // the children of item when it gets expanded for the first time. This would // allow to write: return (NSMapGet(_loadedItemDict, sitem) != nil); - // The last line isn't truly correct because it implies an item without - // children will get incorrectly reloaded automatically on each + // The last line isn't truly correct because it implies an item without + // children will get incorrectly reloaded automatically on each // expand/collapse. return ([object count] != 0); } - (void) _loadDictionaryStartingWith: (id) startitem - atLevel: (NSInteger) level + atLevel: (NSInteger) level { NSInteger num = 0; NSInteger i = 0; id sitem = (startitem == nil) ? (id)[NSNull null] : (id)startitem; NSMutableArray *anarray = nil; - /* Check to see if item is expandable and expanded before getting the number + /* Check to see if item is expandable and expanded before getting the number * of items. For macos compatibility the topmost item (startitem==nil) * is always considered expandable and must not be checked. - * We must load the item only if expanded, otherwise an outline view is not - * usable with a big tree structure. For example, an outline view to browse + * We must load the item only if expanded, otherwise an outline view is not + * usable with a big tree structure. For example, an outline view to browse * file system would try to traverse every file/directory on -reloadData. */ if ((startitem == nil @@ -1984,12 +1984,12 @@ Also returns the child index relative to this parent. */ for (i = 0; i < num; i++) { id anitem = [_dataSource outlineView: self - child: i - ofItem: startitem]; + child: i + ofItem: startitem]; [anarray addObject: anitem]; [self _loadDictionaryStartingWith: anitem - atLevel: level + 1]; + atLevel: level + 1]; } } @@ -2034,7 +2034,7 @@ Also returns the child index relative to this parent. */ if ([self _isItemLoaded: item] == NO) { [self _loadDictionaryStartingWith: item - atLevel: [self levelForItem: item]]; + atLevel: [self levelForItem: item]]; } object = NSMapGet(_itemDict, sitem); @@ -2057,20 +2057,20 @@ Also returns the child index relative to this parent. */ // Add all of the children... if ([self isItemExpanded: child]) - { - NSUInteger numItems; - NSInteger j; - NSMutableArray *insertAll = [NSMutableArray array]; + { + NSUInteger numItems; + NSInteger j; + NSMutableArray *insertAll = [NSMutableArray array]; - [self _collectItemsStartingWith: child into: insertAll]; - numItems = [insertAll count]; - numDescendants += numItems; - for (j = numItems-1; j >= 0; j--) - { - [_items insertObject: [insertAll objectAtIndex: j] - atIndex: insertionPoint]; - } - } + [self _collectItemsStartingWith: child into: insertAll]; + numItems = [insertAll count]; + numDescendants += numItems; + for (j = numItems-1; j >= 0; j--) + { + [_items insertObject: [insertAll objectAtIndex: j] + atIndex: insertionPoint]; + } + } // Add the parent [_items insertObject: child atIndex: insertionPoint]; @@ -2127,7 +2127,7 @@ Also returns the child index relative to this parent. */ } } else - { + { numItems = -numItems; [_selectedRows shiftIndexesStartingAtIndex: rowIndex + numItems by: -numItems]; @@ -2140,11 +2140,11 @@ Also returns the child index relative to this parent. */ /* If the selection becomes empty after removing items and the * receiver does not allow empty selections, select the root item. */ - if ([_selectedRows firstIndex] == NSNotFound && - [self allowsEmptySelection] == NO) - { - [_selectedRows addIndex: 0]; - } + if ([_selectedRows firstIndex] == NSNotFound && + [self allowsEmptySelection] == NO) + { + [_selectedRows addIndex: 0]; + } if (_selectedRow >= rowIndex + numItems) { @@ -2174,7 +2174,7 @@ Also returns the child index relative to this parent. */ _selectedRow = -1; } } - } + } } [self noteNumberOfRowsChanged]; @@ -2191,7 +2191,7 @@ Also returns the child index relative to this parent. */ if (_viewBased == NO) { NSTableColumn *tb = [_tableColumns objectAtIndex: columnIndex]; - + if ([_delegate respondsToSelector: @selector(outlineView:dataCellForTableColumn:item:)]) { @@ -2204,10 +2204,74 @@ Also returns the child index relative to this parent. */ cell = [tb dataCellForRow: rowIndex]; } } - + return cell; } +- (NSRect) _drawOutlineCell: (NSTableColumn *)tb + item: (id)item + drawingRect: (NSRect)inputRect + rowIndex: (NSInteger)rowIndex +{ + NSRect drawingRect = inputRect; + NSImage *image = nil; + NSInteger level = 0; + CGFloat indentationFactor = 0.0; + CGFloat indentationPerLevel = [self indentationPerLevel]; + NSCell *imageCell = nil; + NSRect imageRect; + id delegate = [self delegate]; + + // display the correct arrow... + if ([self isItemExpanded: item]) + { + image = [NSImage imageNamed: @"common_ArrowDownH"]; + } + else + { + image = [NSImage imageNamed: @"common_ArrowRightH"]; + } + + if (![self isExpandable: item]) + { + image = AUTORELEASE([[NSImage alloc] initWithSize: NSMakeSize(14.0,14.0)]); + } + + level = [self levelForItem: item]; + indentationFactor = indentationPerLevel * level; + imageCell = [[NSCell alloc] initImageCell: image]; + imageRect = [self frameOfOutlineCellAtRow: rowIndex]; + + if ([delegate respondsToSelector: @selector(outlineView:willDisplayOutlineCell:forTableColumn:item:)]) + { + [delegate outlineView: self + willDisplayOutlineCell: imageCell + forTableColumn: tb + item: item]; + } + + /* Do not indent if the delegate set the image to nil. */ + if ([imageCell image]) + { + imageRect.size.width = [image size].width; + imageRect.size.height = [image size].height + 5; + [imageCell drawWithFrame: imageRect inView: self]; + drawingRect.origin.x + += indentationFactor + imageRect.size.width + 5; + drawingRect.size.width + -= indentationFactor + imageRect.size.width + 5; + } + else + { + drawingRect.origin.x += indentationFactor; + drawingRect.size.width -= indentationFactor; + } + + RELEASE(imageCell); + + return drawingRect; +} + - (NSView *) viewAtColumn: (NSInteger)column row: (NSInteger)row makeIfNecessary: (BOOL)flag { NSTableColumn *tb = [_tableColumns objectAtIndex: column]; @@ -2217,16 +2281,15 @@ Also returns the child index relative to this parent. */ NSRect drawingRect = [self frameOfCellAtColumn: column row: row]; id item = [self itemAtRow: row]; - + if (tb == _outlineTableColumn) { - drawingRect = [[GSTheme theme] drawOutlineTableColumn: tb - outlineView: self - item: item - drawingRect: drawingRect - rowIndex: row]; + drawingRect = [self _drawOutlineCell: tb + item: item + drawingRect: drawingRect + rowIndex: row]; } - + if (view == nil && flag == YES) { @@ -2244,7 +2307,7 @@ Also returns the child index relative to this parent. */ [view setFrame: drawingRect]; [self _setRenderedView: view forPath: path]; - + return view; } From f8fca4e1626186d9afc1b919a0f7eaa64ac88611 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sun, 16 Jun 2024 08:46:48 -0400 Subject: [PATCH 37/48] Update changelog date --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1456e25db..38b0ee624 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2024-05-03 Gregory John Casamento +2024-06-07 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSTheme.h: Add new methods for rendering view-based outline/table views. From 77bf2f823b8ec2dbeaa60241fcf07235102b06c8 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sun, 16 Jun 2024 16:25:00 -0400 Subject: [PATCH 38/48] Move method back, eliminate possible duplicate call to render outline cell, changes suggested by review with @fredkiefer --- Headers/Additions/GNUstepGUI/GSTheme.h | 6 ++ Source/GSThemeDrawing.m | 81 +++++++++++++++++++++----- Source/NSOutlineView.m | 76 ++---------------------- 3 files changed, 77 insertions(+), 86 deletions(-) diff --git a/Headers/Additions/GNUstepGUI/GSTheme.h b/Headers/Additions/GNUstepGUI/GSTheme.h index 37328722d..56d943073 100644 --- a/Headers/Additions/GNUstepGUI/GSTheme.h +++ b/Headers/Additions/GNUstepGUI/GSTheme.h @@ -1346,6 +1346,12 @@ APPKIT_EXPORT_CLASS clipRect: (NSRect)clipRect inView: (NSTableView *)v; +- (NSRect) drawOutlineCell: (NSTableColumn *)tb + outlineView: (NSOutlineView *)outlineView + item: (id)item + drawingRect: (NSRect)inputRect + rowIndex: (NSInteger)rowIndex; + - (void) drawOutlineViewRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect inView: (NSOutlineView *)view; diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index a415fdc45..defc70a49 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -84,13 +84,6 @@ row: (NSInteger)index; @end -@interface NSOutlineView (Private) -- (NSRect) _drawOutlineCell: (NSTableColumn *)tb - item: (id)item - drawingRect: (NSRect)inputRect - rowIndex: (NSInteger)rowIndex; -@end - @interface NSCell (Private) - (void) _setInEditing: (BOOL)flag; - (BOOL) _inEditing; @@ -3496,6 +3489,71 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; } } +- (NSRect) drawOutlineCell: (NSTableColumn *)tb + outlineView: (NSOutlineView *)outlineView + item: (id)item + drawingRect: (NSRect)inputRect + rowIndex: (NSInteger)rowIndex +{ + NSRect drawingRect = inputRect; + NSImage *image = nil; + NSInteger level = 0; + CGFloat indentationFactor = 0.0; + CGFloat indentationPerLevel = [outlineView indentationPerLevel]; + NSCell *imageCell = nil; + NSRect imageRect; + id delegate = [outlineView delegate]; + + // display the correct arrow... + if ([outlineView isItemExpanded: item]) + { + image = [NSImage imageNamed: @"common_ArrowDownH"]; + } + else + { + image = [NSImage imageNamed: @"common_ArrowRightH"]; + } + + if (![outlineView isExpandable: item]) + { + image = AUTORELEASE([[NSImage alloc] initWithSize: NSMakeSize(14.0,14.0)]); + } + + level = [outlineView levelForItem: item]; + indentationFactor = indentationPerLevel * level; + imageCell = [[NSCell alloc] initImageCell: image]; + imageRect = [outlineView frameOfOutlineCellAtRow: rowIndex]; + + if ([delegate respondsToSelector: @selector(outlineView:willDisplayOutlineCell:forTableColumn:item:)]) + { + [delegate outlineView: outlineView + willDisplayOutlineCell: imageCell + forTableColumn: tb + item: item]; + } + + /* Do not indent if the delegate set the image to nil. */ + if ([imageCell image]) + { + imageRect.size.width = [image size].width; + imageRect.size.height = [image size].height + 5; + [imageCell drawWithFrame: imageRect inView: outlineView]; + drawingRect.origin.x + += indentationFactor + imageRect.size.width + 5; + drawingRect.size.width + -= indentationFactor + imageRect.size.width + 5; + } + else + { + drawingRect.origin.x += indentationFactor; + drawingRect.size.width -= indentationFactor; + } + + RELEASE(imageCell); + + return drawingRect; +} + - (void) drawOutlineViewRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect inView: (NSOutlineView *)outlineView @@ -3509,7 +3567,6 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; NSRect drawingRect; NSInteger i; id dataSource = [outlineView dataSource]; - NSTableColumn *outlineTableColumn = [outlineView outlineTableColumn]; if (dataSource == nil) { @@ -3554,14 +3611,6 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; drawingRect = [outlineView frameOfCellAtColumn: i row: rowIndex]; - if (tb == outlineTableColumn) - { - drawingRect = [outlineView _drawOutlineCell: tb - item: item - drawingRect: drawingRect - rowIndex: rowIndex]; - } - [cell drawWithFrame: drawingRect inView: outlineView]; if (i == editedColumn && rowIndex == editedRow) { diff --git a/Source/NSOutlineView.m b/Source/NSOutlineView.m index e3e78a715..c3e6a59e7 100644 --- a/Source/NSOutlineView.m +++ b/Source/NSOutlineView.m @@ -185,7 +185,6 @@ static NSImage *unexpandable = nil; if (self != nil) { [self _initOutlineDefaults]; - //_outlineTableColumn = nil; } return self; @@ -2208,70 +2207,6 @@ Also returns the child index relative to this parent. */ return cell; } -- (NSRect) _drawOutlineCell: (NSTableColumn *)tb - item: (id)item - drawingRect: (NSRect)inputRect - rowIndex: (NSInteger)rowIndex -{ - NSRect drawingRect = inputRect; - NSImage *image = nil; - NSInteger level = 0; - CGFloat indentationFactor = 0.0; - CGFloat indentationPerLevel = [self indentationPerLevel]; - NSCell *imageCell = nil; - NSRect imageRect; - id delegate = [self delegate]; - - // display the correct arrow... - if ([self isItemExpanded: item]) - { - image = [NSImage imageNamed: @"common_ArrowDownH"]; - } - else - { - image = [NSImage imageNamed: @"common_ArrowRightH"]; - } - - if (![self isExpandable: item]) - { - image = AUTORELEASE([[NSImage alloc] initWithSize: NSMakeSize(14.0,14.0)]); - } - - level = [self levelForItem: item]; - indentationFactor = indentationPerLevel * level; - imageCell = [[NSCell alloc] initImageCell: image]; - imageRect = [self frameOfOutlineCellAtRow: rowIndex]; - - if ([delegate respondsToSelector: @selector(outlineView:willDisplayOutlineCell:forTableColumn:item:)]) - { - [delegate outlineView: self - willDisplayOutlineCell: imageCell - forTableColumn: tb - item: item]; - } - - /* Do not indent if the delegate set the image to nil. */ - if ([imageCell image]) - { - imageRect.size.width = [image size].width; - imageRect.size.height = [image size].height + 5; - [imageCell drawWithFrame: imageRect inView: self]; - drawingRect.origin.x - += indentationFactor + imageRect.size.width + 5; - drawingRect.size.width - -= indentationFactor + imageRect.size.width + 5; - } - else - { - drawingRect.origin.x += indentationFactor; - drawingRect.size.width -= indentationFactor; - } - - RELEASE(imageCell); - - return drawingRect; -} - - (NSView *) viewAtColumn: (NSInteger)column row: (NSInteger)row makeIfNecessary: (BOOL)flag { NSTableColumn *tb = [_tableColumns objectAtIndex: column]; @@ -2284,12 +2219,13 @@ Also returns the child index relative to this parent. */ if (tb == _outlineTableColumn) { - drawingRect = [self _drawOutlineCell: tb - item: item - drawingRect: drawingRect - rowIndex: row]; + drawingRect = [[GSTheme theme] drawOutlineCell: tb + outlineView: self + item: item + drawingRect: drawingRect + rowIndex: row]; } - + if (view == nil && flag == YES) { From f9b89c41e689b45e1c6c53924be783d9367bc80e Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sun, 16 Jun 2024 17:36:15 -0400 Subject: [PATCH 39/48] Correct minor theme drawing issues, fix issue pointed out by @fredkiefer to address out of order row fetching --- Headers/AppKit/NSTableView.h | 2 +- Source/GSThemeDrawing.m | 4 ++-- Source/NSTableView.m | 13 ++++++------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Headers/AppKit/NSTableView.h b/Headers/AppKit/NSTableView.h index cd56b5bbc..0271e4770 100644 --- a/Headers/AppKit/NSTableView.h +++ b/Headers/AppKit/NSTableView.h @@ -206,7 +206,7 @@ APPKIT_EXPORT_CLASS NSMutableDictionary *_registeredViews; /* NSTableRowView support */ - NSMutableArray *_rowViews; + NSMutableDictionary *_rowViews; } /* Data Source */ diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index defc70a49..3b1b81dfd 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -3677,8 +3677,8 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; } // Create the view if needed... - if ([[rowView subviews] containsObject: view] == NO - && view != nil) + if (view != nil && + [[rowView subviews] containsObject: view] == NO) { // Add the view to the row... [rowView addSubview: view]; diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 4234c9200..3963fb398 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -2057,7 +2057,7 @@ static void computeNewSelection _pathsToViews = RETAIN([NSMapTable weakToStrongObjectsMapTable]); _registeredNibs = [[NSMutableDictionary alloc] init]; _registeredViews = [[NSMutableDictionary alloc] init]; - _rowViews = [[NSMutableArray alloc] init]; + _rowViews = [[NSMutableDictionary alloc] init]; } - (id) initWithFrame: (NSRect)frameRect @@ -6969,11 +6969,9 @@ For a more detailed explanation, -setSortDescriptors:. */ if (_viewBased == YES) { - if (row < [_rowViews count]) - { - rv = [_rowViews objectAtIndex: row]; - } + NSNumber *aRow = [NSNumber numberWithInteger: row]; + rv = [_rowViews objectForKey: aRow]; if (rv == nil) { if (flag == YES) @@ -6984,11 +6982,12 @@ For a more detailed explanation, -setSortDescriptors:. */ } if (rv == nil) { - rv = [[NSTableRowView alloc] init]; + rv = AUTORELEASE([[NSTableRowView alloc] init]); } } - [_rowViews addObject: rv]; + [_rowViews setObject: rv + forKey: aRow]; } } From cf7b9ebd3941c0cb3381dd2d37a1ce9fd533f738 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sun, 16 Jun 2024 20:52:06 -0400 Subject: [PATCH 40/48] Final changes suggested by @fredkiefer and some small fixes before merge --- Headers/Additions/GNUstepGUI/GSTheme.h | 4 - Source/GSThemeDrawing.m | 139 ++++--------------------- Source/NSOutlineView.m | 7 +- Source/NSTableView.m | 111 +++++++++++++++++++- 4 files changed, 132 insertions(+), 129 deletions(-) diff --git a/Headers/Additions/GNUstepGUI/GSTheme.h b/Headers/Additions/GNUstepGUI/GSTheme.h index 56d943073..a37b6a4f6 100644 --- a/Headers/Additions/GNUstepGUI/GSTheme.h +++ b/Headers/Additions/GNUstepGUI/GSTheme.h @@ -1342,10 +1342,6 @@ APPKIT_EXPORT_CLASS clipRect: (NSRect)clipRect inView: (NSTableView *)view; -- (void) drawCellViewRow: (NSInteger)rowIndex - clipRect: (NSRect)clipRect - inView: (NSTableView *)v; - - (NSRect) drawOutlineCell: (NSTableColumn *)tb outlineView: (NSOutlineView *)outlineView item: (id)item diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index 3b1b81dfd..8c817a21a 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -82,6 +82,9 @@ row: (NSInteger)index; - (id)_objectValueForTableColumn: (NSTableColumn *)tb row: (NSInteger)index; +- (void) _calculatedStartingColumn: (NSInteger *)startingColumn + endingColumn: (NSInteger *)endingColumn + inClipRect: (NSRect)clipRect; @end @interface NSCell (Private) @@ -3378,45 +3381,6 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; } } -- (void) _calculatedStartingColumn: (NSInteger *)startingColumn - endingColumn: (NSInteger *)endingColumn - withTableView: (NSTableView *)tableView - inClipRect: (NSRect)clipRect - -{ - CGFloat x_pos = 0.0; - NSInteger i = 0; - NSInteger numberOfColumns = [tableView numberOfColumns]; - CGFloat *columnOrigins = [tableView _columnOrigins]; - - /* Using columnAtPoint: here would make it called twice per row per drawn - rect - so we avoid it and do it natively */ - - /* Determine starting column as fast as possible */ - x_pos = NSMinX (clipRect); - i = 0; - while ((i < numberOfColumns) && (x_pos > columnOrigins[i])) - { - i++; - } - *startingColumn = (i - 1); - - if (*startingColumn == -1) - *startingColumn = 0; - - /* Determine ending column as fast as possible */ - x_pos = NSMaxX (clipRect); - // Nota Bene: we do *not* reset i - while ((i < numberOfColumns) && (x_pos > columnOrigins[i])) - { - i++; - } - *endingColumn = (i - 1); - - if (*endingColumn == -1) - *endingColumn = numberOfColumns - 1; -} - - (void) drawTableViewRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect inView: (NSTableView *)tableView @@ -3435,10 +3399,9 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; NSColor *selectedTextColor = [self colorNamed: @"highlightedTableRowTextColor" state: GSThemeNormalState]; - [self _calculatedStartingColumn: &startingColumn - endingColumn: &endingColumn - withTableView: tableView - inClipRect: clipRect]; + [tableView _calculatedStartingColumn: &startingColumn + endingColumn: &endingColumn + inClipRect: clipRect]; /* Draw the row between startingColumn and endingColumn */ for (i = startingColumn; i <= endingColumn; i++) @@ -3567,7 +3530,8 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; NSRect drawingRect; NSInteger i; id dataSource = [outlineView dataSource]; - + NSTableColumn *outlineTableColumn = [outlineView outlineTableColumn]; + if (dataSource == nil) { return; @@ -3581,10 +3545,9 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; return; } - [self _calculatedStartingColumn: &startingColumn - endingColumn: &endingColumn - withTableView: outlineView - inClipRect: clipRect]; + [outlineView _calculatedStartingColumn: &startingColumn + endingColumn: &endingColumn + inClipRect: clipRect]; /* Draw the row between startingColumn and endingColumn */ for (i = startingColumn; i <= endingColumn; i++) @@ -3611,6 +3574,15 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; drawingRect = [outlineView frameOfCellAtColumn: i row: rowIndex]; + if (tb == outlineTableColumn) + { + drawingRect = [self drawOutlineCell: tb + outlineView: outlineView + item: item + drawingRect: drawingRect + rowIndex: rowIndex]; + } + [cell drawWithFrame: drawingRect inView: outlineView]; if (i == editedColumn && rowIndex == editedRow) { @@ -3620,77 +3592,6 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; } } -- (void) drawCellViewRow: (NSInteger)rowIndex - clipRect: (NSRect)clipRect - inView: (NSTableView *)tableView -{ - NSInteger numberOfRows = [tableView numberOfRows]; - NSInteger startingColumn; - NSInteger endingColumn; - NSInteger columnIndex; - id dataSource = [tableView dataSource]; - - // If we have no data source, there is nothing to do... - if (dataSource == nil) - { - return; - } - - // If the rowIndex is greater than the numberOfRows, done... - if (rowIndex >= numberOfRows) - { - return; - } - - [self _calculatedStartingColumn: &startingColumn - endingColumn: &endingColumn - withTableView: tableView - inClipRect: clipRect]; - - /* Draw the row between startingColumn and endingColumn */ - for (columnIndex = startingColumn; columnIndex <= endingColumn; columnIndex++) - { - id rowView = [tableView rowViewAtRow: rowIndex - makeIfNecessary: YES]; - NSView *view = [tableView viewAtColumn: columnIndex - row: rowIndex - makeIfNecessary: YES]; - - // If the view is already part of the table, don't re-add it... - if (rowView != nil - && [[tableView subviews] containsObject: rowView] == NO) - { - NSRect cellFrame = [tableView frameOfCellAtColumn: 0 - row: rowIndex]; - CGFloat x = 0.0; - CGFloat y = cellFrame.origin.y; - CGFloat w = [tableView frame].size.width; - CGFloat h = [tableView rowHeight]; - - NSRect rvFrame = NSMakeRect(x, y, w, h); - NSAutoresizingMaskOptions options = NSViewWidthSizable - | NSViewMinYMargin; - - [tableView addSubview: rowView]; - [rowView setAutoresizingMask: options]; - [rowView setFrame: rvFrame]; - } - - // Create the view if needed... - if (view != nil && - [[rowView subviews] containsObject: view] == NO) - { - // Add the view to the row... - [rowView addSubview: view]; - - // Place the view... - NSRect newRect = [view frame]; - newRect.origin.y = 0.0; - [view setFrame: newRect]; - } - } -} - - (BOOL) isBoxOpaque: (NSBox *)box { if ([box boxType] == NSBoxCustom) diff --git a/Source/NSOutlineView.m b/Source/NSOutlineView.m index c3e6a59e7..ad4596e64 100644 --- a/Source/NSOutlineView.m +++ b/Source/NSOutlineView.m @@ -139,6 +139,8 @@ static NSImage *unexpandable = nil; - (NSView *) _renderedViewForPath: (NSIndexPath *)path; - (void) _setRenderedView: (NSView *)view forPath: (NSIndexPath *)path; - (id) _prototypeCellViewFromTableColumn: (NSTableColumn *)tb; +- (void) _drawCellViewRow: (NSInteger)rowIndex + clipRect: (NSRect)clipRect; @end @implementation NSOutlineView @@ -956,9 +958,8 @@ static NSImage *unexpandable = nil; { if (_viewBased) { - [[GSTheme theme] drawCellViewRow: rowIndex - clipRect: aRect - inView: self]; + [self _drawCellViewRow: rowIndex + clipRect: aRect]; } else { diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 3963fb398..23256fa3f 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -5060,14 +5060,119 @@ This method is deprecated, use -columnIndexesInRect:. */ /* * Drawing */ +- (void) _calculatedStartingColumn: (NSInteger *)startingColumn + endingColumn: (NSInteger *)endingColumn + inClipRect: (NSRect)clipRect + +{ + CGFloat x_pos = 0.0; + NSInteger i = 0; + NSInteger numberOfColumns = [self numberOfColumns]; + CGFloat *columnOrigins = [self _columnOrigins]; + + /* Using columnAtPoint: here would make it called twice per row per drawn + rect - so we avoid it and do it natively */ + + /* Determine starting column as fast as possible */ + x_pos = NSMinX (clipRect); + i = 0; + while ((i < numberOfColumns) && (x_pos > columnOrigins[i])) + { + i++; + } + *startingColumn = (i - 1); + + if (*startingColumn == -1) + *startingColumn = 0; + + /* Determine ending column as fast as possible */ + x_pos = NSMaxX (clipRect); + // Nota Bene: we do *not* reset i + while ((i < numberOfColumns) && (x_pos > columnOrigins[i])) + { + i++; + } + *endingColumn = (i - 1); + + if (*endingColumn == -1) + *endingColumn = numberOfColumns - 1; +} + +- (void) _drawCellViewRow: (NSInteger)rowIndex + clipRect: (NSRect)clipRect +{ + NSInteger numberOfRows = [self numberOfRows]; + NSInteger startingColumn; + NSInteger endingColumn; + NSInteger columnIndex; + id dataSource = [self dataSource]; + + // If we have no data source, there is nothing to do... + if (dataSource == nil) + { + return; + } + + // If the rowIndex is greater than the numberOfRows, done... + if (rowIndex >= numberOfRows) + { + return; + } + + [self _calculatedStartingColumn: &startingColumn + endingColumn: &endingColumn + inClipRect: clipRect]; + + /* Draw the row between startingColumn and endingColumn */ + for (columnIndex = startingColumn; columnIndex <= endingColumn; columnIndex++) + { + id rowView = [self rowViewAtRow: rowIndex + makeIfNecessary: YES]; + NSView *view = [self viewAtColumn: columnIndex + row: rowIndex + makeIfNecessary: YES]; + + // If the view is already part of the table, don't re-add it... + if (rowView != nil + && [[self subviews] containsObject: rowView] == NO) + { + NSRect cellFrame = [self frameOfCellAtColumn: 0 + row: rowIndex]; + CGFloat x = 0.0; + CGFloat y = cellFrame.origin.y; + CGFloat w = [self frame].size.width; + CGFloat h = [self rowHeight]; + + NSRect rvFrame = NSMakeRect(x, y, w, h); + NSAutoresizingMaskOptions options = NSViewWidthSizable + | NSViewMinYMargin; + + [self addSubview: rowView]; + [rowView setAutoresizingMask: options]; + [rowView setFrame: rvFrame]; + } + + // Create the view if needed... + if (view != nil && + [[rowView subviews] containsObject: view] == NO) + { + // Add the view to the row... + [rowView addSubview: view]; + + // Place the view... + NSRect newRect = [view frame]; + newRect.origin.y = 0.0; + [view setFrame: newRect]; + } + } +} - (void) drawRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect { if (_viewBased) { - [[GSTheme theme] drawCellViewRow: rowIndex - clipRect: clipRect - inView: self]; + [self _drawCellViewRow: rowIndex + clipRect: clipRect]; } else { From baca2ae98af1758cab804d12536964a460ba8577 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sun, 16 Jun 2024 21:01:41 -0400 Subject: [PATCH 41/48] Minor cleanup, move storage of view code to conditional where it is created, suggested by @fredkiefer --- Source/NSOutlineView.m | 3 ++- Source/NSTableView.m | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/NSOutlineView.m b/Source/NSOutlineView.m index ad4596e64..2bf286070 100644 --- a/Source/NSOutlineView.m +++ b/Source/NSOutlineView.m @@ -2240,10 +2240,11 @@ Also returns the child index relative to this parent. */ { view = [self _prototypeCellViewFromTableColumn: tb]; } + + [self _setRenderedView: view forPath: path]; } [view setFrame: drawingRect]; - [self _setRenderedView: view forPath: path]; return view; } diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 23256fa3f..abf8c4f1d 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -7123,10 +7123,11 @@ For a more detailed explanation, -setSortDescriptors:. */ { view = [self _prototypeCellViewFromTableColumn: tb]; } + + [self _setRenderedView: view forPath: path]; } [view setFrame: drawingRect]; - [self _setRenderedView: view forPath: path]; return view; } From ab2de84a9022717f544d7be900be1b9088e8d81e Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Fri, 28 Jun 2024 19:39:10 -0400 Subject: [PATCH 42/48] Remove unneeded method, per discussion with @fredkiefer --- Source/NSMenuToolbarItem.m | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Source/NSMenuToolbarItem.m b/Source/NSMenuToolbarItem.m index 53fdea0b1..ac7278b18 100644 --- a/Source/NSMenuToolbarItem.m +++ b/Source/NSMenuToolbarItem.m @@ -28,10 +28,6 @@ #import "GNUstepGUI/GSTheme.h" -@interface NSToolbarItem (Private) -- (NSView *) _backView; -@end - @implementation NSMenuToolbarItem - (instancetype) initWithItemIdentifier: (NSString *)identifier From efe925cf384be0b5ac7924d2024bc688d794b885 Mon Sep 17 00:00:00 2001 From: Gregory Casamento Date: Sat, 29 Jun 2024 03:24:42 -0400 Subject: [PATCH 43/48] Update ChangeLog Minor update... fix date in ChangeLog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3e4475b30..ae6603ce0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2024-05-04 Gregory John Casamento +2024-06-28 Gregory John Casamento * Headers/AppKit/AppKit.h: Add NSMenuToolbarItem.h * Headers/AppKit/NSMenuToolbarItem.h: Declarations From 5c9ffa3929ea751d90696f9bc670dae965012c2c Mon Sep 17 00:00:00 2001 From: Gregory Casamento Date: Tue, 2 Jul 2024 03:12:00 -0400 Subject: [PATCH 44/48] Update gnustep-gui.spec.in Updating description. --- gnustep-gui.spec.in | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gnustep-gui.spec.in b/gnustep-gui.spec.in index b96e32066..e8009fb55 100644 --- a/gnustep-gui.spec.in +++ b/gnustep-gui.spec.in @@ -10,11 +10,12 @@ URL: http://www.gnustep.org/ %description The GNUstep gui Library is a powerful library of graphical user interface -classes written completely in the Objective-C language; the classes are -based upon the OpenStep specification, and provide the user with a -traditional nextstep-like look and feel. The classes include graphical -objects such as windows, menus, buttons, text fields, popup lists, browsers, -scrollviews, splitviews, fonts, colors, images, events, pasteboards,... This -package includes development headers too. You need the corresponding -backend library package (gnustep-back) to use this package. +classes written completely in the Objective-C language; the classes are based +on Cocoa (formerly OPENSTEP), and provide the user with a themable environment. +While the default look and feel resembles NeXTSTEP, this can be changed. +The classes include graphical objects such as windows, menus, buttons, +text fields, popup lists, browsers, scrollviews, splitviews, fonts, colors, +images, events, pasteboards,... This package includes development headers too. +You need the corresponding backend library package (gnustep-back) to use +this package. From 1d46aae92064b19d93570e20ebff5258146e88c0 Mon Sep 17 00:00:00 2001 From: Gregory Casamento Date: Sat, 6 Jul 2024 01:53:33 -0400 Subject: [PATCH 45/48] Update README.md update date --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ff517cb2..081ab80f8 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Please log bug reports on the [GitHub issues page][2]. Happy hacking! -Copyright (C) 2005 Free Software Foundation +Copyright (C) 2005, 2924 Free Software Foundation Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright From 6b238f504c48b5a1bd8e71fcf640dcbb00c32ca9 Mon Sep 17 00:00:00 2001 From: Gregory Casamento Date: Sat, 6 Jul 2024 01:54:10 -0400 Subject: [PATCH 46/48] Update README.md Fix date. :/ --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 081ab80f8..ac193359d 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Please log bug reports on the [GitHub issues page][2]. Happy hacking! -Copyright (C) 2005, 2924 Free Software Foundation +Copyright (C) 2005, 2024 Free Software Foundation Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright From da2803481b19f1809e48eb023cffcb979ea1f817 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Thu, 18 Jul 2024 13:17:06 +0200 Subject: [PATCH 47/48] Pietas, Enrico passed way, remove email --- Headers/AppKit/NSBezierPath.h | 2 +- Headers/AppKit/NSSound.h | 4 ++-- Source/GSSlideView.h | 2 +- Source/GSSlideView.m | 2 +- Source/NSBezierPath.m | 2 +- Source/NSSound.m | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Headers/AppKit/NSBezierPath.h b/Headers/AppKit/NSBezierPath.h index b57c69729..5fcfa65d1 100644 --- a/Headers/AppKit/NSBezierPath.h +++ b/Headers/AppKit/NSBezierPath.h @@ -3,7 +3,7 @@ Copyright (C) 1999, 2005 Free Software Foundation, Inc. - Author: Enrico Sersale + Author: Enrico Sersale Date: Dec 1999 This file is part of the GNUstep GUI Library. diff --git a/Headers/AppKit/NSSound.h b/Headers/AppKit/NSSound.h index c28019f55..400d56cb0 100644 --- a/Headers/AppKit/NSSound.h +++ b/Headers/AppKit/NSSound.h @@ -5,8 +5,8 @@ Copyright (C) 2002, 2009 Free Software Foundation, Inc. - Written by: Enrico Sersale , - Stefan Bidigaray + Written by: Enrico Sersale + Stefan Bidigaray Date: Jul 2002, Jun 2009 This file is part of the GNUstep GUI Library. diff --git a/Source/GSSlideView.h b/Source/GSSlideView.h index 4239bf6c0..d08a8efac 100644 --- a/Source/GSSlideView.h +++ b/Source/GSSlideView.h @@ -5,7 +5,7 @@ Copyright (C) 2002 Free Software Foundation, Inc. - Written By: enrico@imago.ro + Written By: Enrico Sersale Date: Jan 2002 This file is part of the GNU Objective C User Interface library. diff --git a/Source/GSSlideView.m b/Source/GSSlideView.m index 3ac4a7d19..51ae65c51 100644 --- a/Source/GSSlideView.m +++ b/Source/GSSlideView.m @@ -2,7 +2,7 @@ Copyright (C) 2002, 2003 Free Software Foundation, Inc. - Created by: Enrico Sersale + Created by: Enrico Sersale Date: Jan 2002 Author: Fred Kiefer Date: Jan 2003 diff --git a/Source/NSBezierPath.m b/Source/NSBezierPath.m index d49fb0ba5..5065928c7 100644 --- a/Source/NSBezierPath.m +++ b/Source/NSBezierPath.m @@ -4,7 +4,7 @@ Copyright (C) 1999, 2005 Free Software Foundation, Inc. - Author: Enrico Sersale + Author: Enrico Sersale Date: Dec 1999 Modified: Fred Kiefer Date: January 2001 diff --git a/Source/NSSound.m b/Source/NSSound.m index 393055b89..92ce12956 100644 --- a/Source/NSSound.m +++ b/Source/NSSound.m @@ -4,8 +4,8 @@ Copyright (C) 2002, 2009 Free Software Foundation, Inc. - Author: Enrico Sersale , - Stefan Bidigaray + Author: Enrico Sersale + Stefan Bidigaray Date: Jul 2002, Jul 2009 This file is part of the GNUstep GUI Library. From 4f9889bbe446db23657e6f9d6d7efe507c2dbf4b Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Fri, 26 Jul 2024 23:31:46 -0400 Subject: [PATCH 48/48] Fix selector issue: quick fix --- Tests/gui/GSXib5KeyedUnarchiver/menu.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/gui/GSXib5KeyedUnarchiver/menu.m b/Tests/gui/GSXib5KeyedUnarchiver/menu.m index aee3a910d..683ffdb30 100644 --- a/Tests/gui/GSXib5KeyedUnarchiver/menu.m +++ b/Tests/gui/GSXib5KeyedUnarchiver/menu.m @@ -23,9 +23,9 @@ int main() SKIP("It looks like GNUstep backend is not yet installed") } } - NS_ENDHANDLER - - NSData *data + NS_ENDHANDLER; + + NSData *data; GSXibKeyedUnarchiver *unarchiver; NSArray *rootObjects; NSEnumerator *enumerator; @@ -35,7 +35,7 @@ int main() data = [NSData dataWithContentsOfFile:@"Menu.xib"]; unarchiver = [GSXibKeyedUnarchiver unarchiverForReadingWithData:data]; rootObjects = [unarchiver decodeObjectForKey: @"IBDocument.RootObjects"]; - enumerator = [rootObjects objectenumerator]; + enumerator = [rootObjects objectEnumerator]; while ((element = [enumerator nextObject]) != nil) {