Merge branch 'master' into NSStoryboard_refactor

This commit is contained in:
Gregory John Casamento 2024-07-27 08:47:04 -04:00
commit 33604e7469
41 changed files with 1679 additions and 986 deletions

View file

@ -1,7 +1,7 @@
1 Announcement 1 Announcement
************** **************
This is version 0.29.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? 1.1 What is the GNUstep GUI Library?
==================================== ====================================
@ -32,51 +32,25 @@ Group's libjpeg library, and a back-end component from the GNUstep
libraries. For example, to build the Cairo backend in the GNUstep Back libraries. For example, to build the Cairo backend in the GNUstep Back
library, you will need to install Cairo. library, you will need to install Cairo.
1.2 Noteworthy changes in version '0.29.0' 1.2 Noteworthy changes in version '0.31.1'
========================================== ==========================================
This version adds support for storyboard files and many new classes. This is a bugfix release
Plus the usual bunch of bug fixes.
* Support loading of storyboard files. * Fix bug decoding menu items (breaking archive)
* Add classes NSSwitch, NSFontAssetRequest, * Remove use of deprecated lock from base library
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.
1.3 Where can you get it? How can you compile it? 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.1.tar.gz distribution file has been placed at
<ftp://ftp.gnustep.org/pub/gnustep/core>. <ftp://ftp.gnustep.org/pub/gnustep/core>.
It is accompanied by gnustep-gui-0.29.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 which you can validate by putting both files in the same directory and
using: using:
gpg --verify gnustep-gui-0.29.0.tar.gz.sig gpg --verify gnustep-gui-0.31.1.tar.gz.sig
Signature has been created using the key with the following Signature has been created using the key with the following
fingerprint: fingerprint:

View file

@ -1,3 +1,60 @@
2024-06-28 Gregory John Casamento <greg.casamento@gmail.com>
* 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-06-07 Gregory John Casamento <greg.casamento@gmail.com>
* 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-06-05 Richard Frith-Macdonald <rfm@gnu.org>
* 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 <rfm@gnu.org>
* Source/NSMenuitem.m:
Fix bug in decoding of archived menu item modifier mask.
2024-05-30 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSDisplayServer.m:
* Source/NSGraphicsContext.m:
* Source/NSWorkspace.m:
Avoid using old gnustep_global_lock (removed from base)
2024-05-26 Fred Kiefer <FredKiefer@gmx.de>
* 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 <adam.fox@keysight.com> 2024-05-13 Adam Fox <adam.fox@keysight.com>
* Source/NSParagraphStyle.m (-init): Apply the old default * Source/NSParagraphStyle.m (-init): Apply the old default

View file

@ -9,6 +9,57 @@
The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}. The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}.
@end ifclear @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.
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
@section Noteworthy changes in version @samp{0.30.0} @section Noteworthy changes in version @samp{0.30.0}
This version adds parsing support for layout constraints, compilation with MSVC This version adds parsing support for layout constraints, compilation with MSVC
@ -48,11 +99,8 @@ and many new classes. Plus the usual bunch of bug fixes.
@item Support ImageMagick version >= 7. @item Support ImageMagick version >= 7.
@item Add github workflow. @item Add github workflow.
@item Add icon for speech synthesizer. @item Add icon for speech synthesizer.
@item
@item
@end itemize @end itemize
@ifclear ANNOUNCE-ONLY
@section Noteworthy changes in version @samp{0.29.0} @section Noteworthy changes in version @samp{0.29.0}

View file

@ -253,6 +253,7 @@
@class NSPopUpButtonCell; @class NSPopUpButtonCell;
@class NSMenuView; @class NSMenuView;
@class NSProgressIndicator; @class NSProgressIndicator;
@class NSTableColumn;
@class NSTableHeaderCell; @class NSTableHeaderCell;
@class NSTableView; @class NSTableView;
@class NSTabViewItem; @class NSTabViewItem;
@ -1341,9 +1342,11 @@ APPKIT_EXPORT_CLASS
clipRect: (NSRect)clipRect clipRect: (NSRect)clipRect
inView: (NSTableView *)view; inView: (NSTableView *)view;
- (void) drawCellViewRow: (NSInteger)rowIndex - (NSRect) drawOutlineCell: (NSTableColumn *)tb
clipRect: (NSRect)clipRect outlineView: (NSOutlineView *)outlineView
inView: (NSTableView *)v; item: (id)item
drawingRect: (NSRect)inputRect
rowIndex: (NSInteger)rowIndex;
- (void) drawOutlineViewRow: (NSInteger)rowIndex - (void) drawOutlineViewRow: (NSInteger)rowIndex
clipRect: (NSRect)clipRect clipRect: (NSRect)clipRect

View file

@ -101,6 +101,7 @@
#import <AppKit/NSMenu.h> #import <AppKit/NSMenu.h>
#import <AppKit/NSMenuItem.h> #import <AppKit/NSMenuItem.h>
#import <AppKit/NSMenuItemCell.h> #import <AppKit/NSMenuItemCell.h>
#import <AppKit/NSMenuToolbarItem.h>
#import <AppKit/NSMenuView.h> #import <AppKit/NSMenuView.h>
#import <AppKit/NSNibLoading.h> #import <AppKit/NSNibLoading.h>
#import <AppKit/NSOpenPanel.h> #import <AppKit/NSOpenPanel.h>

View file

@ -3,7 +3,7 @@
Copyright (C) 1999, 2005 Free Software Foundation, Inc. Copyright (C) 1999, 2005 Free Software Foundation, Inc.
Author: Enrico Sersale <enrico@imago.ro> Author: Enrico Sersale
Date: Dec 1999 Date: Dec 1999
This file is part of the GNUstep GUI Library. This file is part of the GNUstep GUI Library.

View file

@ -0,0 +1,60 @@
/* 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 <AppKit/NSToolbarItem.h>
#import <AppKit/AppKitDefines.h>
#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;
}
- (BOOL) showsIndicator;
- (void) setShowsIndicator: (BOOL)flag;
- (NSMenu *) menu;
- (void) setMenu: (NSMenu *)menu;
@end
#if defined(__cplusplus)
}
#endif
#endif /* GS_API_MACOSX */
#endif /* _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE */

View file

@ -5,8 +5,8 @@
Copyright (C) 2002, 2009 Free Software Foundation, Inc. Copyright (C) 2002, 2009 Free Software Foundation, Inc.
Written by: Enrico Sersale <enrico@imago.ro>, Written by: Enrico Sersale
Stefan Bidigaray <stefanbidi@gmail.com> Stefan Bidigaray <stefanbidi@gmail.com>
Date: Jul 2002, Jun 2009 Date: Jul 2002, Jun 2009
This file is part of the GNUstep GUI Library. This file is part of the GNUstep GUI Library.

View file

@ -1,21 +1,21 @@
/* Definition of class NSTableRowView /* Definition of class NSTableRowView
Copyright (C) 2022 Free Software Foundation, Inc. Copyright (C) 2022 Free Software Foundation, Inc.
By: Gregory John Casamento <greg.casamento@gmail.com> By: Gregory John Casamento <greg.casamento@gmail.com>
Date: 03-09-2022 Date: 03-09-2022
This file is part of the GNUstep Library. This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
@ -25,7 +25,8 @@
#ifndef _NSTableRowView_h_GNUSTEP_GUI_INCLUDE #ifndef _NSTableRowView_h_GNUSTEP_GUI_INCLUDE
#define _NSTableRowView_h_GNUSTEP_GUI_INCLUDE #define _NSTableRowView_h_GNUSTEP_GUI_INCLUDE
#import <AppKit/NSView.h> #import <AppKit/NSTableView.h>
#import <AppKit/NSCell.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST) #if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
@ -34,6 +35,78 @@ extern "C" {
#endif #endif
@interface NSTableRowView : NSView @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 _nextRowSelected;
BOOL _previousRowSelected;
}
- (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;
- (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 @end

View file

@ -102,6 +102,15 @@ typedef enum _NSTableViewRowSizeStyle
} NSTableViewRowSizeStyle; } NSTableViewRowSizeStyle;
#endif #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 APPKIT_EXPORT_CLASS
@interface NSTableView : NSControl <NSUserInterfaceValidations> @interface NSTableView : NSControl <NSUserInterfaceValidations>
@ -195,6 +204,9 @@ APPKIT_EXPORT_CLASS
NSMapTable *_pathsToViews; NSMapTable *_pathsToViews;
NSMutableDictionary *_registeredNibs; NSMutableDictionary *_registeredNibs;
NSMutableDictionary *_registeredViews; NSMutableDictionary *_registeredViews;
/* NSTableRowView support */
NSMutableDictionary *_rowViews;
} }
/* Data Source */ /* Data Source */
@ -402,6 +414,8 @@ APPKIT_EXPORT_CLASS
- (void) removeRowsAtIndexes: (NSIndexSet*)indexes withAnimation: (NSTableViewAnimationOptions)animationOptions; - (void) removeRowsAtIndexes: (NSIndexSet*)indexes withAnimation: (NSTableViewAnimationOptions)animationOptions;
- (NSInteger) rowForView: (NSView*)view; - (NSInteger) rowForView: (NSView*)view;
- (NSView *) makeViewWithIdentifier: (NSUserInterfaceItemIdentifier)identifier owner: (id)owner; - (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 #endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_8, GS_API_LATEST) #if OS_API_VERSION(MAC_OS_X_VERSION_10_8, GS_API_LATEST)

View file

@ -90,6 +90,7 @@ Images_RESOURCE_FILES = \
common_Info.tiff\ common_Info.tiff\
common_LeftTabStop.tiff \ common_LeftTabStop.tiff \
common_LibraryFolder.tiff \ common_LibraryFolder.tiff \
common_MenuToolbarItem.tiff \
common_MiniWindowTile.tiff \ common_MiniWindowTile.tiff \
common_Miniaturize.tiff \ common_Miniaturize.tiff \
common_MiniaturizeH.tiff \ common_MiniaturizeH.tiff \

Binary file not shown.

View file

@ -45,7 +45,8 @@ common_ToolbarShowColorsItem = NSToolbarShowColors;
common_ToolbarShowFontsItem = NSToolbarShowFonts; common_ToolbarShowFontsItem = NSToolbarShowFonts;
common_RecyclerEmpty = NSImageTrashEmpty; common_RecyclerEmpty = NSImageTrashEmpty;
common_RecyclerFull = NSImageTrashFull; common_RecyclerFull = NSImageTrashFull;
common_MenuToolbarItem = NSMenuToolbarItem;
/* Misc. */ /* Misc. */
common_MultipleSelection = NSImageNameMultipleDocuments; common_MultipleSelection = NSImageNameMultipleDocuments;

View file

@ -7,7 +7,6 @@ MISSING HEADERS ( * = difficult, - = quick, + = placeholder, x = won't do )
> NSFilePromiseProvider.h - > NSFilePromiseProvider.h -
> NSFilePromiseReceiver.h - > NSFilePromiseReceiver.h -
> NSItemProvider.h + > NSItemProvider.h +
> NSMenuToolbarItem.h -
> NSOpenGLLayer.h + > NSOpenGLLayer.h +
> NSTypesetter.h + > NSTypesetter.h +
> NSUserActivity.h - > NSUserActivity.h -

219
NEWS
View file

@ -1,9 +1,100 @@
1 NEWS 1 NEWS
****** ******
The currently released version of the library is '0.29.0'. The currently released version of the library is '0.31.1'.
1.1 Noteworthy changes in version '0.29.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
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 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.4 Noteworthy changes in version '0.29.0'
========================================== ==========================================
This version adds support for storyboard files and many new classes. This version adds support for storyboard files and many new classes.
@ -37,7 +128,7 @@ Plus the usual bunch of bug fixes.
returned by a slow window manager. returned by a slow window manager.
* Fix NSTableView/NSTableColumn bindings. * Fix NSTableView/NSTableColumn bindings.
1.2 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. This version adds support for modern XIB files and many new classes.
@ -75,7 +166,7 @@ Plus the usual bunch of bug fixes.
* Lowered NSFloatingWindowLevel by one to distinguish floating panels * Lowered NSFloatingWindowLevel by one to distinguish floating panels
from menus. from menus.
1.3 Noteworthy changes in version '0.27.0' 1.6 Noteworthy changes in version '0.27.0'
========================================== ==========================================
This version includes numerous bugfixes, compatibility improvements and This version includes numerous bugfixes, compatibility improvements and
@ -98,7 +189,7 @@ be done on integrating NSViews with a Core Animation renderer.
* Japanese translations. * Japanese translations.
* Lots of bug fixes. * Lots of bug fixes.
1.4 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. This version is a small, but important bugfix release.
@ -106,7 +197,7 @@ This version is a small, but important bugfix release.
* printing: Fix allocation of the CUPS printing classes. * printing: Fix allocation of the CUPS printing classes.
* installation: Fix the configure script. * installation: Fix the configure script.
1.5 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 This version is released to conincide with version 1.25.1 of
@ -133,7 +224,7 @@ for more information.
* graphics context: Workaround for Clang+libobjc2+nonfragile ABI * graphics context: Workaround for Clang+libobjc2+nonfragile ABI
issue. issue.
1.6 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 This version was bumped due to previous binary incompatibilities between
@ -164,8 +255,8 @@ system.
and methods to improve source-level compatibility. and methods to improve source-level compatibility.
* other bugfixes * other bugfixes
1.7 Noteworthy changes in version '0.25.1' 1.10 Noteworthy changes in version '0.25.1'
========================================== ===========================================
* JPEG (saving) alpha channel fixes and size with resolution != 72 * JPEG (saving) alpha channel fixes and size with resolution != 72
* JPEG resolution read support * JPEG resolution read support
@ -175,8 +266,8 @@ system.
* Corrected layout of empty strings * Corrected layout of empty strings
* Only update visible menus * Only update visible menus
1.8 Noteworthy changes in version '0.25.0' 1.11 Noteworthy changes in version '0.25.0'
========================================== ===========================================
* Fixes for new GIF library versions * Fixes for new GIF library versions
* Theming of named images for specific applications by the use of the * Theming of named images for specific applications by the use of the
@ -190,14 +281,14 @@ system.
* Numerous theme tweaks * Numerous theme tweaks
* Spanish locale * Spanish locale
1.9 Noteworthy changes in version '0.24.1' 1.12 Noteworthy changes in version '0.24.1'
========================================== ===========================================
From a look through ChangeLog, we can see a lot of bugfixes for this 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 release, with the main focus on avoiding display glitches and improving
OSX compatibility. OSX compatibility.
1.10 Noteworthy changes in version '0.24.0' 1.13 Noteworthy changes in version '0.24.0'
=========================================== ===========================================
New features include: New features include:
@ -209,13 +300,13 @@ New features include:
Many bugfixes. Many bugfixes.
1.11 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 This is a bugfix release, primarily to deal with coding/archiving
issues. issues.
1.12 Noteworthy changes in version '0.22.0' 1.15 Noteworthy changes in version '0.22.0'
=========================================== ===========================================
New features include: New features include:
@ -231,19 +322,19 @@ New features include:
selection of image reps, better support for icons). Many bugfixes, selection of image reps, better support for icons). Many bugfixes,
including in Xib loading, printing, and NSView geometry. including in Xib loading, printing, and NSView geometry.
1.13 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 A new stable release. Many improvments with Nib loading, documents and
document controllers. Fixed many drawing issues, particularly ones document controllers. Fixed many drawing issues, particularly ones
related to flipping. Much improved theming. related to flipping. Much improved theming.
1.14 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 This is an (unstable) copy of the 0.18.0 release
1.15 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 A new stable release that has had many improvements. Many new Mac OS X
@ -252,20 +343,20 @@ 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 also better compatibility with Mac OS X in terms of usage of NSInteger
and other definitions. and other definitions.
1.16 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 * New Mac OS X 10.5 methods in NSFont
* Add live resize in NSSplitView * Add live resize in NSSplitView
1.17 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 * New Mac OS X 10.5 methods in many classes
* Toolbars have been completely rewritten and improved. * Toolbars have been completely rewritten and improved.
* Several improvements for Garbage Collection * Several improvements for Garbage Collection
1.18 Noteworthy changes in version '0.16.0' 1.21 Noteworthy changes in version '0.16.0'
=========================================== ===========================================
* Nib loading refractored and improved. * Nib loading refractored and improved.
@ -273,7 +364,7 @@ and other definitions.
* NSWindowController made a subclass of NSResponder * NSWindowController made a subclass of NSResponder
* NSTokenField and netokenFiledCell classes added. * NSTokenField and netokenFiledCell classes added.
1.19 Noteworthy changes in version '0.14.0' 1.22 Noteworthy changes in version '0.14.0'
=========================================== ===========================================
* New class NSGlyphGenerator for glyph generation * New class NSGlyphGenerator for glyph generation
@ -281,7 +372,7 @@ and other definitions.
* NSOpenGLView added some Mac OS X 10.3 methods * NSOpenGLView added some Mac OS X 10.3 methods
* Manu bug fixes. * Manu bug fixes.
1.20 Noteworthy changes in version '0.13.2' 1.23 Noteworthy changes in version '0.13.2'
=========================================== ===========================================
* Printing works a little better now. * Printing works a little better now.
@ -292,7 +383,7 @@ and other definitions.
* New class NSSegmentedCell. * New class NSSegmentedCell.
* NSDrawer was implemented. * NSDrawer was implemented.
1.21 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. * NSMenu - Added more MacOS X methods and an ivar.
@ -302,7 +393,7 @@ and other definitions.
* Added some MacOS X 10.4 methods to NSTableView. * Added some MacOS X 10.4 methods to NSTableView.
* Changed the NSCursor hot point to 0,0 for MacOS X compatibility. * Changed the NSCursor hot point to 0,0 for MacOS X compatibility.
1.22 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 This is an unstable release. There may be backward compatibility issues
@ -329,7 +420,7 @@ with previous releases of the gui library.
* Implementation of special connectors for Key-Value binding. * Implementation of special connectors for Key-Value binding.
* Base library version 1.15.1 is required for this release * Base library version 1.15.1 is required for this release
1.23 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 It has been a long time since the last release and many things have been
@ -349,7 +440,7 @@ added and changed, including new classes, new ivars, and new methods.
* NSSpellServer and NSAffineTransform was moved to GNUstep base for * NSSpellServer and NSAffineTransform was moved to GNUstep base for
Mac OS X compatibility. Mac OS X compatibility.
1.24 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 support for keyed encoding in all gui classes.
@ -358,25 +449,25 @@ added and changed, including new classes, new ivars, and new methods.
* 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. NSIBObjectData, NSClassSwapper, etc. to facilitate nib loading.
1.25 Noteworthy changes in version '0.10.3' 1.28 Noteworthy changes in version '0.10.3'
=========================================== ===========================================
* Horizontal menus now work * Horizontal menus now work
* Better support for tracking active applications. * Better support for tracking active applications.
1.26 Noteworthy changes in version '0.10.2' 1.29 Noteworthy changes in version '0.10.2'
=========================================== ===========================================
Mostly bug fixes. Mostly bug fixes.
1.27 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 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. distributions (SuSE, etc) as v18 is very old.
1.28 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 This release is binary incompatible with previous releases. The
@ -387,7 +478,7 @@ new version.
* Model loading supports window auto-positioning * Model loading supports window auto-positioning
* Keyed encoding is supported in many classes. * Keyed encoding is supported in many classes.
1.29 Noteworthy changes in version '0.9.5' 1.32 Noteworthy changes in version '0.9.5'
========================================== ==========================================
* Beginnings of CUPS interface were added. * Beginnings of CUPS interface were added.
@ -396,7 +487,7 @@ new version.
* NSApplication -runModalSession behavior changed. * NSApplication -runModalSession behavior changed.
* You can find the GUI library's version using the Info.plist * You can find the GUI library's version using the Info.plist
1.30 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
@ -407,7 +498,7 @@ new version.
* NSScroller, NSScrollView has a new ivar. * NSScroller, NSScrollView has a new ivar.
* Some improvement of NSDataLink classes. * Some improvement of NSDataLink classes.
1.31 Noteworthy changes in version '0.9.3' 1.34 Noteworthy changes in version '0.9.3'
========================================== ==========================================
* Spell checker reimplemented using libaspell * Spell checker reimplemented using libaspell
@ -416,7 +507,7 @@ new version.
* Binary incompatibilites from ivar additions in NSView and * Binary incompatibilites from ivar additions in NSView and
subclasses. subclasses.
1.32 Noteworthy changes in version '0.9.2' 1.35 Noteworthy changes in version '0.9.2'
========================================== ==========================================
* Working NSToolbar implementation * Working NSToolbar implementation
@ -428,21 +519,21 @@ new version.
* NSStringDrawing redesigned. * NSStringDrawing redesigned.
* Much improved loading of gorm files * Much improved loading of gorm files
1.33 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. 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.37 Noteworthy changes in version '0.9.0'
========================================== ==========================================
Improvements in various classes, include NSPopUpButton, Improvements in various classes, include NSPopUpButton,
NSBitmapImageRep, NSMenu, NSToolbar. Added support for thumbnail images NSBitmapImageRep, NSMenu, NSToolbar. Added support for thumbnail images
in NSWorkspace. in NSWorkspace.
1.35 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 Note that many headers have moved to new locations (both in the package
@ -451,13 +542,13 @@ 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.39 Noteworthy changes in version '0.8.8'
========================================== ==========================================
* Updated LanguageSetup documentation * Updated LanguageSetup documentation
* Improved RTF reader (unicode support, etc). * Improved RTF reader (unicode support, etc).
1.37 Noteworthy changes in version '0.8.7' 1.40 Noteworthy changes in version '0.8.7'
========================================== ==========================================
* NSBezierPath glyph methods implemented (depends on backend). * NSBezierPath glyph methods implemented (depends on backend).
@ -465,7 +556,7 @@ applications may not compile because they cannot find the right header.
* Added default to load user-defined bundles (GSAppKitUserBundles * Added default to load user-defined bundles (GSAppKitUserBundles
default). default).
1.38 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 Updated to install in new locations based on changes in gnustep-make
@ -475,12 +566,12 @@ Updated to install in new locations based on changes in gnustep-make
* Speed improvements, especially in tracking mouses movements. * Speed improvements, especially in tracking mouses movements.
* Lots of menu improvements. * Lots of menu improvements.
1.39 Noteworthy changes in version '0.8.5' 1.42 Noteworthy changes in version '0.8.5'
========================================== ==========================================
Bug fixes. NSStringDrawing now uses text system implementation. Bug fixes. NSStringDrawing now uses text system implementation.
1.40 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 This release features a brand new text and layout system thanks to
@ -491,7 +582,7 @@ Alexander Malmberg. Other improvements include:
* Printing fixes. * Printing fixes.
* NSToolbar partially implemented. * NSToolbar partially implemented.
1.41 Noteworthy changes in version '0.8.3' 1.44 Noteworthy changes in version '0.8.3'
========================================== ==========================================
* Additions for Gorm support. * Additions for Gorm support.
@ -502,7 +593,7 @@ Alexander Malmberg. Other improvements include:
* Window focus fixes * Window focus fixes
* Key view handling rewritten. * Key view handling rewritten.
1.42 Noteworthy changes in version '0.8.2' 1.45 Noteworthy changes in version '0.8.2'
========================================== ==========================================
* Handle fonts that aren't found better. * Handle fonts that aren't found better.
@ -513,7 +604,7 @@ Alexander Malmberg. Other improvements include:
* NSBrowser: implement non-separate columns * NSBrowser: implement non-separate columns
* Fix firstResponder status in text fields. * Fix firstResponder status in text fields.
1.43 Noteworthy changes in version '0.8.1' 1.46 Noteworthy changes in version '0.8.1'
========================================== ==========================================
* Handle scaled curves correctly. * Handle scaled curves correctly.
@ -522,23 +613,23 @@ Alexander Malmberg. Other improvements include:
* NSSound implemented. gssnd sound server. * NSSound implemented. gssnd sound server.
* Spell checker starts correctly now. * Spell checker starts correctly now.
1.44 Noteworthy changes in version '0.8.0' 1.47 Noteworthy changes in version '0.8.0'
========================================== ==========================================
1.45 Noteworthy changes in version '0.7.9' 1.48 Noteworthy changes in version '0.7.9'
========================================== ==========================================
* NSTableView, NSOutlineView improvements. * NSTableView, NSOutlineView improvements.
* Menus no longer work in modal loop. * Menus no longer work in modal loop.
* Skeleton implementation of NSToolBar * Skeleton implementation of NSToolBar
1.46 Noteworthy changes in version '0.7.8' 1.49 Noteworthy changes in version '0.7.8'
========================================== ==========================================
* Wheel color picker, standard color picker (bundles) added. * Wheel color picker, standard color picker (bundles) added.
* System colors now use named colors. Easier configuration * System colors now use named colors. Easier configuration
1.47 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 The graphics/window interface was completely revamped. Window functions
@ -560,7 +651,7 @@ computers, although it is in a very alpha state.
* Better autolayout with GSTable and subclasses. * Better autolayout with GSTable and subclasses.
* NSOutlineView much improved. * NSOutlineView much improved.
1.48 Noteworthy changes in version '0.7.6' 1.51 Noteworthy changes in version '0.7.6'
========================================== ==========================================
* NSOutlineView implemented. * NSOutlineView implemented.
@ -569,7 +660,7 @@ computers, although it is in a very alpha state.
* Fully-functional keybindings, including multi-stroke keybindings. * Fully-functional keybindings, including multi-stroke keybindings.
* Memory panel available from Info Panel. * Memory panel available from Info Panel.
1.49 Noteworthy changes in version '0.7.5' 1.52 Noteworthy changes in version '0.7.5'
========================================== ==========================================
* Drag and drop and image sliding much improved. * Drag and drop and image sliding much improved.
@ -587,7 +678,7 @@ computers, although it is in a very alpha state.
* Near rewrite of Menu handling code. * Near rewrite of Menu handling code.
* Gmodel code compiled as a separate bundle. * Gmodel code compiled as a separate bundle.
1.50 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
@ -598,7 +689,7 @@ computers, although it is in a very alpha state.
* simpler, faster compilation and installation. * simpler, faster compilation and installation.
* NSColorWell works. * NSColorWell works.
1.51 Noteworthy changes in version '0.6.7' 1.54 Noteworthy changes in version '0.6.7'
========================================== ==========================================
* App Icons can support documents dropped using DnD. * App Icons can support documents dropped using DnD.
@ -614,7 +705,7 @@ computers, although it is in a very alpha state.
* Implemented object value and formatter support in NSCell * Implemented object value and formatter support in NSCell
* Support middle mouse button. * Support middle mouse button.
1.52 Noteworthy changes in version '0.6.6' 1.55 Noteworthy changes in version '0.6.6'
========================================== ==========================================
* Window hints for motif and generic window managers. * Window hints for motif and generic window managers.
@ -640,7 +731,7 @@ 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 may have to deal with many problems in order to get it working. We
recommend sticking with the xgps backend (the default) for now. recommend sticking with the xgps backend (the default) for now.
1.53 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, Many of the basic GUI classes have been vastly improved or rewritten,
@ -664,7 +755,7 @@ thanks to Nicola Pero <n.pero@mi.flashnet.it> and many others.
been written, thanks to Richard Frith-Macdonald been written, thanks to Richard Frith-Macdonald
<richard@brainstorm.co.uk> <richard@brainstorm.co.uk>
1.54 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
@ -685,7 +776,7 @@ NeXT/OpenStep apps and libraries have been ported with little changes.
* Rewrite of NSSavePanel and NSOpenPanel * Rewrite of NSSavePanel and NSOpenPanel
* Several fixes that at least double the speed of the gui. * Several fixes that at least double the speed of the gui.
1.55 Noteworthy changes in version '0.5.5' 1.58 Noteworthy changes in version '0.5.5'
========================================== ==========================================
Too extensive to list. Too extensive to list.
@ -693,7 +784,7 @@ 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. cleanup of coordinate conversion code, etc.
1.56 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
@ -742,7 +833,7 @@ Too extensive to list.
* 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.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
@ -773,7 +864,7 @@ Too extensive to list.
retain/release policy has been fixed, the cell classes correctly retain/release policy has been fixed, the cell classes correctly
implement the NSCopying protocol and many others. implement the NSCopying protocol and many others.
1.58 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
@ -807,7 +898,7 @@ Too extensive to list.
* Many bug fixes and minor enhancements. * Many bug fixes and minor enhancements.
1.59 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
@ -830,7 +921,7 @@ Too extensive to list.
* Now requires the TIFF library for reading, writing, and * Now requires the TIFF library for reading, writing, and
manipulating tiff files and images. manipulating tiff files and images.
1.60 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

View file

@ -51,7 +51,7 @@ Please log bug reports on the [GitHub issues page][2].
Happy hacking! Happy hacking!
Copyright (C) 2005 Free Software Foundation Copyright (C) 2005, 2024 Free Software Foundation
Copying and distribution of this file, with or without modification, Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright are permitted in any medium without royalty provided the copyright

View file

@ -180,6 +180,7 @@ NSStoryboardSegue.m \
NSMagnificationGestureRecognizer.m \ NSMagnificationGestureRecognizer.m \
NSMatrix.m \ NSMatrix.m \
NSMenu.m \ NSMenu.m \
NSMenuToolbarItem.m \
NSMenuView.m \ NSMenuView.m \
NSMenuItem.m \ NSMenuItem.m \
NSMenuItemCell.m \ NSMenuItemCell.m \
@ -499,6 +500,7 @@ NSMediaLibraryBrowserController.h \
NSMenu.h \ NSMenu.h \
NSMenuItem.h \ NSMenuItem.h \
NSMenuItemCell.h \ NSMenuItemCell.h \
NSMenuToolbarItem.h \
NSMenuView.h \ NSMenuView.h \
NSMovie.h \ NSMovie.h \
NSMovieView.h \ NSMovieView.h \

View file

@ -123,7 +123,6 @@ GSCurrentServer(void)
{ {
if (serverLock == nil) if (serverLock == nil)
{ {
[gnustep_global_lock lock];
if (serverLock == nil) if (serverLock == nil)
{ {
serverLock = [NSRecursiveLock new]; serverLock = [NSRecursiveLock new];
@ -132,7 +131,6 @@ GSCurrentServer(void)
windowmaps = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, windowmaps = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
NSNonOwnedPointerMapValueCallBacks, 20); NSNonOwnedPointerMapValueCallBacks, 20);
} }
[gnustep_global_lock unlock];
} }
} }

View file

@ -2,9 +2,11 @@
<abstract>ImageMagick image representation.</abstract> <abstract>ImageMagick image representation.</abstract>
Copyright (C) 2011 Free Software Foundation, Inc. Copyright (C) 2011-2024 Free Software Foundation, Inc.
Author: Eric Wasylishen <ewasylishen@gmail.com> Author: Eric Wasylishen <ewasylishen@gmail.com>
Riccardo Mottola
Date: June 2011 Date: June 2011
This file is part of the GNUstep Application Kit Library. This file is part of the GNUstep Application Kit Library.
@ -123,13 +125,17 @@
return bmp; return bmp;
} }
#define SIGNATURE_LENGTH 18
+ (NSArray*) imageRepsWithData: (NSData *)data allImages: (BOOL)allImages + (NSArray*) imageRepsWithData: (NSData *)data allImages: (BOOL)allImages
{ {
NSMutableArray *reps = [NSMutableArray array]; NSMutableArray *reps = [NSMutableArray array];
ExceptionInfo *exception = AcquireExceptionInfo(); ExceptionInfo *exception = AcquireExceptionInfo();
ImageInfo *imageinfo = CloneImageInfo(NULL); ImageInfo *imageinfo = CloneImageInfo(NULL);
Image *images, *image; Image *images;
Image *image;
char signature[SIGNATURE_LENGTH];
// Set the background color to transparent // Set the background color to transparent
// (otherwise SVG's are rendered against a white background by default) // (otherwise SVG's are rendered against a white background by default)
@ -139,6 +145,14 @@
QueryColorDatabase("none", &imageinfo->background_color, exception); QueryColorDatabase("none", &imageinfo->background_color, exception);
#endif #endif
memset(signature, 0, SIGNATURE_LENGTH);
[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); images = BlobToImage(imageinfo, [data bytes], [data length], exception);
if (exception->severity != UndefinedException) if (exception->severity != UndefinedException)

View file

@ -5,7 +5,7 @@
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002 Free Software Foundation, Inc.
Written By: <author name="Enrico Sersale"><email>enrico@imago.ro</email></author> Written By: Enrico Sersale
Date: Jan 2002 Date: Jan 2002
This file is part of the GNU Objective C User Interface library. This file is part of the GNU Objective C User Interface library.

View file

@ -2,7 +2,7 @@
Copyright (C) 2002, 2003 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Created by: Enrico Sersale <enrico@imago.ro> Created by: Enrico Sersale
Date: Jan 2002 Date: Jan 2002
Author: Fred Kiefer <fredkiefer@gmx.de> Author: Fred Kiefer <fredkiefer@gmx.de>
Date: Jan 2003 Date: Jan 2003

View file

@ -82,12 +82,9 @@
row: (NSInteger)index; row: (NSInteger)index;
- (id)_objectValueForTableColumn: (NSTableColumn *)tb - (id)_objectValueForTableColumn: (NSTableColumn *)tb
row: (NSInteger)index; row: (NSInteger)index;
- (NSView *) _renderedViewForPath: (NSIndexPath *)path; - (void) _calculatedStartingColumn: (NSInteger *)startingColumn
- (void) _setRenderedView: (NSView *)view forPath: (NSIndexPath *)path; endingColumn: (NSInteger *)endingColumn
@end inClipRect: (NSRect)clipRect;
@interface NSTableColumn (Private)
- (NSArray *) _prototypeCellViews;
@end @end
@interface NSCell (Private) @interface NSCell (Private)
@ -3384,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 - (void) drawTableViewRow: (NSInteger)rowIndex
clipRect: (NSRect)clipRect clipRect: (NSRect)clipRect
inView: (NSTableView *)tableView inView: (NSTableView *)tableView
@ -3441,10 +3399,9 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
NSColor *selectedTextColor = [self colorNamed: @"highlightedTableRowTextColor" NSColor *selectedTextColor = [self colorNamed: @"highlightedTableRowTextColor"
state: GSThemeNormalState]; state: GSThemeNormalState];
[self _calculatedStartingColumn: &startingColumn [tableView _calculatedStartingColumn: &startingColumn
endingColumn: &endingColumn endingColumn: &endingColumn
withTableView: tableView inClipRect: clipRect];
inClipRect: clipRect];
/* Draw the row between startingColumn and endingColumn */ /* Draw the row between startingColumn and endingColumn */
for (i = startingColumn; i <= endingColumn; i++) for (i = startingColumn; i <= endingColumn; i++)
@ -3495,11 +3452,11 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
} }
} }
- (NSRect) _drawOutlineTableColumn: (NSTableColumn *)tb - (NSRect) drawOutlineCell: (NSTableColumn *)tb
outlineView: (NSOutlineView *)outlineView outlineView: (NSOutlineView *)outlineView
item: (id)item item: (id)item
drawingRect: (NSRect)inputRect drawingRect: (NSRect)inputRect
rowIndex: (NSInteger)rowIndex rowIndex: (NSInteger)rowIndex
{ {
NSRect drawingRect = inputRect; NSRect drawingRect = inputRect;
NSImage *image = nil; NSImage *image = nil;
@ -3519,17 +3476,17 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
{ {
image = [NSImage imageNamed: @"common_ArrowRightH"]; image = [NSImage imageNamed: @"common_ArrowRightH"];
} }
if (![outlineView isExpandable: item]) if (![outlineView isExpandable: item])
{ {
image = AUTORELEASE([[NSImage alloc] initWithSize: NSMakeSize(14.0,14.0)]); image = AUTORELEASE([[NSImage alloc] initWithSize: NSMakeSize(14.0,14.0)]);
} }
level = [outlineView levelForItem: item]; level = [outlineView levelForItem: item];
indentationFactor = indentationPerLevel * level; indentationFactor = indentationPerLevel * level;
imageCell = [[NSCell alloc] initImageCell: image]; imageCell = [[NSCell alloc] initImageCell: image];
imageRect = [outlineView frameOfOutlineCellAtRow: rowIndex]; imageRect = [outlineView frameOfOutlineCellAtRow: rowIndex];
if ([delegate respondsToSelector: @selector(outlineView:willDisplayOutlineCell:forTableColumn:item:)]) if ([delegate respondsToSelector: @selector(outlineView:willDisplayOutlineCell:forTableColumn:item:)])
{ {
[delegate outlineView: outlineView [delegate outlineView: outlineView
@ -3537,7 +3494,7 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
forTableColumn: tb forTableColumn: tb
item: item]; item: item];
} }
/* Do not indent if the delegate set the image to nil. */ /* Do not indent if the delegate set the image to nil. */
if ([imageCell image]) if ([imageCell image])
{ {
@ -3554,7 +3511,7 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
drawingRect.origin.x += indentationFactor; drawingRect.origin.x += indentationFactor;
drawingRect.size.width -= indentationFactor; drawingRect.size.width -= indentationFactor;
} }
RELEASE(imageCell); RELEASE(imageCell);
return drawingRect; return drawingRect;
@ -3574,7 +3531,7 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
NSInteger i; NSInteger i;
id dataSource = [outlineView dataSource]; id dataSource = [outlineView dataSource];
NSTableColumn *outlineTableColumn = [outlineView outlineTableColumn]; NSTableColumn *outlineTableColumn = [outlineView outlineTableColumn];
if (dataSource == nil) if (dataSource == nil)
{ {
return; return;
@ -3588,10 +3545,9 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
return; return;
} }
[self _calculatedStartingColumn: &startingColumn [outlineView _calculatedStartingColumn: &startingColumn
endingColumn: &endingColumn endingColumn: &endingColumn
withTableView: outlineView inClipRect: clipRect];
inClipRect: clipRect];
/* Draw the row between startingColumn and endingColumn */ /* Draw the row between startingColumn and endingColumn */
for (i = startingColumn; i <= endingColumn; i++) for (i = startingColumn; i <= endingColumn; i++)
@ -3620,13 +3576,13 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
if (tb == outlineTableColumn) if (tb == outlineTableColumn)
{ {
drawingRect = [self _drawOutlineTableColumn: tb drawingRect = [self drawOutlineCell: tb
outlineView: outlineView outlineView: outlineView
item: item item: item
drawingRect: drawingRect drawingRect: drawingRect
rowIndex: rowIndex]; rowIndex: rowIndex];
} }
[cell drawWithFrame: drawingRect inView: outlineView]; [cell drawWithFrame: drawingRect inView: outlineView];
if (i == editedColumn && rowIndex == editedRow) if (i == editedColumn && rowIndex == editedRow)
{ {
@ -3636,130 +3592,6 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
} }
} }
- (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;
}
- (void) drawCellViewRow: (NSInteger)rowIndex
clipRect: (NSRect)clipRect
inView: (NSTableView *)v
{
NSArray *tableColumns = [v tableColumns];
NSInteger numberOfRows = [v numberOfRows];
NSInteger startingColumn;
NSInteger endingColumn;
NSInteger i;
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)
{
return;
}
// If the rowIndex is greater than the numberOfRows, done...
if (rowIndex >= numberOfRows)
{
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++)
{
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];
}
}
}
// Store the object...
[v _setRenderedView: view forPath: path];
[v addSubview: view];
// Place the view...
[view setFrame: drawingRect];
}
}
- (BOOL) isBoxOpaque: (NSBox *)box - (BOOL) isBoxOpaque: (NSBox *)box
{ {
if ([box boxType] == NSBoxCustom) if ([box boxType] == NSBoxCustom)

View file

@ -35,7 +35,7 @@
#import <Foundation/NSRunLoop.h> #import <Foundation/NSRunLoop.h>
#import <Foundation/NSThread.h> #import <Foundation/NSThread.h>
#import <Foundation/NSValue.h> #import <Foundation/NSValue.h>
#import <GNUstepBase/GSLock.h> #import <Foundation/NSLock.h>
#import "AppKit/NSAnimation.h" #import "AppKit/NSAnimation.h"
#import "AppKit/NSApplication.h" #import "AppKit/NSApplication.h"
@ -418,7 +418,7 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se
(BOOL (*)(id,SEL,NSAnimation*)) NULL; (BOOL (*)(id,SEL,NSAnimation*)) NULL;
_isThreaded = NO; _isThreaded = NO;
_isAnimatingLock = [GSLazyRecursiveLock new]; _isAnimatingLock = [NSRecursiveLock new];
} }
return self; return self;
} }
@ -430,7 +430,7 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se
c->_progressMarks = GSIArrayCopyWithZone(_progressMarks, zone); c->_progressMarks = GSIArrayCopyWithZone(_progressMarks, zone);
c->_animator = nil; c->_animator = nil;
c->_isANewAnimatorNeeded = YES; c->_isANewAnimatorNeeded = YES;
c->_isAnimatingLock = [GSLazyRecursiveLock new]; c->_isAnimatingLock = [NSRecursiveLock new];
return c; return c;
} }

View file

@ -4,7 +4,7 @@
Copyright (C) 1999, 2005 Free Software Foundation, Inc. Copyright (C) 1999, 2005 Free Software Foundation, Inc.
Author: Enrico Sersale <enrico@imago.ro> Author: Enrico Sersale
Date: Dec 1999 Date: Dec 1999
Modified: Fred Kiefer <FredKiefer@gmx.de> Modified: Fred Kiefer <FredKiefer@gmx.de>
Date: January 2001 Date: January 2001

View file

@ -138,7 +138,6 @@ NSGraphicsContext *GSCurrentContext(void)
{ {
if (contextLock == nil) if (contextLock == nil)
{ {
[gnustep_global_lock lock];
if (contextLock == nil) if (contextLock == nil)
{ {
contextLock = [NSRecursiveLock new]; contextLock = [NSRecursiveLock new];
@ -147,7 +146,6 @@ NSGraphicsContext *GSCurrentContext(void)
classMethodTable = classMethodTable =
[[NSMutableDictionary allocWithZone: _globalGSZone] init]; [[NSMutableDictionary allocWithZone: _globalGSZone] init];
} }
[gnustep_global_lock unlock];
} }
} }

View file

@ -40,7 +40,7 @@
#import <Foundation/NSMapTable.h> #import <Foundation/NSMapTable.h>
#import <Foundation/NSValue.h> #import <Foundation/NSValue.h>
#import <Foundation/NSValueTransformer.h> #import <Foundation/NSValueTransformer.h>
#import <GNUstepBase/GSLock.h> #import <Foundation/NSLock.h>
#import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSKeyValueBinding.h"
#import "GSBindingHelpers.h" #import "GSBindingHelpers.h"
@ -145,7 +145,7 @@ void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey,
{ {
if (self == [GSKeyValueBinding class]) if (self == [GSKeyValueBinding class])
{ {
bindingLock = [GSLazyRecursiveLock new]; bindingLock = [NSRecursiveLock new];
classTable = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, classTable = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
NSObjectMapValueCallBacks, 128); NSObjectMapValueCallBacks, 128);
objectTable = NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks, objectTable = NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks,

View file

@ -650,7 +650,6 @@ static Class imageClass;
NSString *action; NSString *action;
NSString *key; NSString *key;
BOOL isSeparator = NO; BOOL isSeparator = NO;
NSNumber *keyMask;
if ([aDecoder containsValueForKey: @"NSIsSeparator"]) if ([aDecoder containsValueForKey: @"NSIsSeparator"])
{ {
@ -703,13 +702,13 @@ static Class imageClass;
[self setSubmenu: submenu]; [self setSubmenu: submenu];
} }
// Set the key mask when it is present; or default to NSCommandKeyMask /* Set the key mask when it is present; or default to NSCommandKeyMask
// when not specified * when not specified
keyMask = (NSNumber*)[aDecoder decodeObjectForKey: @"NSKeyEquivModMask"]; */
if ([aDecoder containsValueForKey: @"NSKeyEquivModMask"])
if (keyMask != nil) {
{ [self setKeyEquivalentModifierMask:
[self setKeyEquivalentModifierMask: [keyMask intValue]]; [aDecoder decodeIntegerForKey: @"NSKeyEquivModMask"]];
} }
else else
{ {

View file

@ -0,0 +1,86 @@
/* 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"
#import "AppKit/NSImage.h"
#import "GNUstepGUI/GSTheme.h"
@implementation NSMenuToolbarItem
- (instancetype) initWithItemIdentifier: (NSString *)identifier
{
self = [super initWithItemIdentifier: identifier];
if (self != nil)
{
[self setImage: [NSImage imageNamed: @"NSMenuToolbarItem"]];
[self setTarget: self];
[self setAction: @selector(_showMenu:)];
}
return self;
}
- (void) dealloc
{
RELEASE(_menu);
[super dealloc];
}
- (BOOL) showsIndicator
{
return _showsIndicator;
}
- (void) setShowsIndicator: (BOOL)flag
{
_showsIndicator = flag;
if (_showsIndicator == YES)
{
[self setImage: [NSImage imageNamed: @"NSMenuToolbarItem"]];
}
else
{
[self setImage: nil];
}
}
- (NSMenu *) menu
{
return _menu;
}
- (void) setMenu: (NSMenu *)menu
{
ASSIGN(_menu, menu);
}
- (void) _showMenu: (id)sender
{
[[GSTheme theme] rightMouseDisplay: _menu
forEvent: nil];
}
@end

File diff suppressed because it is too large Load diff

View file

@ -4,8 +4,8 @@
Copyright (C) 2002, 2009 Free Software Foundation, Inc. Copyright (C) 2002, 2009 Free Software Foundation, Inc.
Author: Enrico Sersale <enrico@imago.ro>, Author: Enrico Sersale
Stefan Bidigaray <stefanbidi@gmail.com> Stefan Bidigaray <stefanbidi@gmail.com>
Date: Jul 2002, Jul 2009 Date: Jul 2002, Jul 2009
This file is part of the GNUstep GUI Library. This file is part of the GNUstep GUI Library.

View file

@ -1,21 +1,21 @@
/* Implementation of class NSTableRowView /* Implementation of class NSTableRowView
Copyright (C) 2022 Free Software Foundation, Inc. Copyright (C) 2022 Free Software Foundation, Inc.
By: Gregory John Casamento By: Gregory John Casamento
Date: 03-09-2022 Date: 03-09-2022
This file is part of the GNUstep Library. This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
@ -26,5 +26,145 @@
@implementation NSTableRowView @implementation NSTableRowView
@end - (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);
}
- (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 _nextRowSelected;
}
- (void) setNextRowSelected: (BOOL)flag
{
_nextRowSelected = flag;
}
- (BOOL) isPreviousRowSelected
{
return _previousRowSelected;
}
- (void) setPreviousRowSelected: (BOOL)flag
{
_previousRowSelected = flag;
}
@end

View file

@ -60,6 +60,7 @@
#import "AppKit/NSScrollView.h" #import "AppKit/NSScrollView.h"
#import "AppKit/NSTableColumn.h" #import "AppKit/NSTableColumn.h"
#import "AppKit/NSTableHeaderView.h" #import "AppKit/NSTableHeaderView.h"
#import "AppKit/NSTableRowView.h"
#import "AppKit/NSText.h" #import "AppKit/NSText.h"
#import "AppKit/NSTextFieldCell.h" #import "AppKit/NSTextFieldCell.h"
#import "AppKit/NSWindow.h" #import "AppKit/NSWindow.h"
@ -179,6 +180,10 @@ typedef struct _tableViewFlags
- (BOOL) _startDragOperationWithEvent:(NSEvent *)theEvent; - (BOOL) _startDragOperationWithEvent:(NSEvent *)theEvent;
@end @end
@interface NSTableColumn (Private)
- (NSArray *) _prototypeCellViews;
@end
/* /*
* A specific struct and its associated quick sort function * A specific struct and its associated quick sort function
* This is used by the -sizeToFit method * This is used by the -sizeToFit method
@ -2052,6 +2057,7 @@ static void computeNewSelection
_pathsToViews = RETAIN([NSMapTable weakToStrongObjectsMapTable]); _pathsToViews = RETAIN([NSMapTable weakToStrongObjectsMapTable]);
_registeredNibs = [[NSMutableDictionary alloc] init]; _registeredNibs = [[NSMutableDictionary alloc] init];
_registeredViews = [[NSMutableDictionary alloc] init]; _registeredViews = [[NSMutableDictionary alloc] init];
_rowViews = [[NSMutableDictionary alloc] init];
} }
- (id) initWithFrame: (NSRect)frameRect - (id) initWithFrame: (NSRect)frameRect
@ -2087,6 +2093,7 @@ static void computeNewSelection
RELEASE (_pathsToViews); RELEASE (_pathsToViews);
RELEASE (_registeredNibs); RELEASE (_registeredNibs);
RELEASE (_registeredViews); RELEASE (_registeredViews);
RELEASE (_rowViews);
TEST_RELEASE (_headerView); TEST_RELEASE (_headerView);
TEST_RELEASE (_cornerView); TEST_RELEASE (_cornerView);
if (_autosaveTableColumns == YES) if (_autosaveTableColumns == YES)
@ -2371,6 +2378,7 @@ static void computeNewSelection
{ {
[_renderedViewPaths removeAllObjects]; [_renderedViewPaths removeAllObjects];
[_pathsToViews removeAllObjects]; [_pathsToViews removeAllObjects];
[_rowViews removeAllObjects];
} }
[self noteNumberOfRowsChanged]; [self noteNumberOfRowsChanged];
@ -5052,14 +5060,119 @@ This method is deprecated, use -columnIndexesInRect:. */
/* /*
* Drawing * 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 - (void) drawRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect
{ {
if (_viewBased) if (_viewBased)
{ {
[[GSTheme theme] drawCellViewRow: rowIndex [self _drawCellViewRow: rowIndex
clipRect: clipRect clipRect: clipRect];
inView: self];
} }
else else
{ {
@ -6919,13 +7032,13 @@ For a more detailed explanation, -setSortDescriptors:. */
if (loaded) if (loaded)
{ {
NSEnumerator *en = [tlo objectEnumerator]; 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; break;
} }
} }
@ -6940,6 +7053,85 @@ For a more detailed explanation, -setSortDescriptors:. */
return view; 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;
}
- (NSTableRowView *) rowViewAtRow: (NSInteger)row makeIfNecessary: (BOOL)flag
{
NSTableRowView *rv = nil;
if (_viewBased == YES)
{
NSNumber *aRow = [NSNumber numberWithInteger: row];
rv = [_rowViews objectForKey: aRow];
if (rv == nil)
{
if (flag == YES)
{
if ([_delegate respondsToSelector: @selector(tableView:rowViewForRow:)])
{
rv = [_delegate tableView: self rowViewForRow: row];
}
if (rv == nil)
{
rv = AUTORELEASE([[NSTableRowView alloc] init]);
}
}
[_rowViews setObject: rv
forKey: aRow];
}
}
return rv;
}
- (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];
// 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];
}
[self _setRenderedView: view forPath: path];
}
[view setFrame: drawingRect];
return view;
}
- (void) registerNib: (NSNib *)nib - (void) registerNib: (NSNib *)nib
forIdentifier: (NSUserInterfaceItemIdentifier)identifier forIdentifier: (NSUserInterfaceItemIdentifier)identifier
{ {

View file

@ -131,6 +131,7 @@ static NSImage *multipleFiles = nil;
static NSImage *unknownApplication = nil; static NSImage *unknownApplication = nil;
static NSImage *unknownTool = nil; static NSImage *unknownTool = nil;
static NSLock *classLock = nil;
static NSLock *mlock = nil; static NSLock *mlock = nil;
static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification"; static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification";
@ -598,26 +599,22 @@ static NSDictionary *urlPreferences = nil;
{ {
if (self == [NSWorkspace class]) if (self == [NSWorkspace class])
{ {
static BOOL beenHere = NO;
NSFileManager *mgr = [NSFileManager defaultManager];
NSString *service;
NSData *data;
NSDictionary *dict;
[self setVersion: 1]; [self setVersion: 1];
if (classLock)
[gnustep_global_lock lock];
if (beenHere == YES)
{ {
[gnustep_global_lock unlock];
return; return;
} }
classLock = [NSLock new];
beenHere = YES;
mlock = [NSLock new]; mlock = [NSLock new];
NS_DURING NS_DURING
{ {
NSFileManager *mgr = [NSFileManager defaultManager];
NSString *service;
NSData *data;
NSDictionary *dict;
service = [[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, service = [[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSUserDomainMask, YES) objectAtIndex: 0] NSUserDomainMask, YES) objectAtIndex: 0]
stringByAppendingPathComponent: @"Services"]; stringByAppendingPathComponent: @"Services"];
@ -675,12 +672,9 @@ static NSDictionary *urlPreferences = nil;
} }
NS_HANDLER NS_HANDLER
{ {
[gnustep_global_lock unlock];
[localException raise]; [localException raise];
} }
NS_ENDHANDLER NS_ENDHANDLER
[gnustep_global_lock unlock];
} }
} }
@ -698,14 +692,14 @@ static NSDictionary *urlPreferences = nil;
{ {
if (sharedWorkspace == nil) if (sharedWorkspace == nil)
{ {
[gnustep_global_lock lock]; [classLock lock];
if (sharedWorkspace == nil) if (sharedWorkspace == nil)
{ {
sharedWorkspace = sharedWorkspace =
(NSWorkspace*)NSAllocateObject(self, 0, NSDefaultMallocZone()); (NSWorkspace*)NSAllocateObject(self, 0, NSDefaultMallocZone());
[sharedWorkspace init]; [sharedWorkspace init];
} }
[gnustep_global_lock unlock]; [classLock unlock];
} }
return sharedWorkspace; return sharedWorkspace;
} }

View file

@ -10,49 +10,60 @@
int main() int main()
{ {
START_SET("GSXib5KeyedUnarchiver NSButtonCell tests") START_SET("GSXib5KeyedUnarchiver NSButtonCell tests")
NS_DURING NS_DURING
{ {
[NSApplication sharedApplication]; [NSApplication sharedApplication];
} }
NS_HANDLER NS_HANDLER
{ {
if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) if ([[localException name]
SKIP("It looks like GNUstep backend is not yet installed") isEqualToString: NSInternalInconsistencyException ])
} {
SKIP("It looks like GNUstep backend is not yet installed")
}
}
NS_ENDHANDLER NS_ENDHANDLER
NSData* data = [NSData dataWithContentsOfFile:@"ButtonCell.xib"]; NSData *data;
GSXibKeyedUnarchiver* unarchiver = [GSXibKeyedUnarchiver unarchiverForReadingWithData: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"]; rootObjects = [unarchiver decodeObjectForKey: @"IBDocument.RootObjects"];
NSMatrix* matrix; enumerator = [rootObjects objectEnumerator];
while ((element = [enumerator nextObject]) != nil)
for (id element in rootObjects) { {
if ([element isKindOfClass:[NSMatrix class]]) { if ([element isKindOfClass: [NSMatrix class]])
{
matrix = (NSMatrix*)element; matrix = (NSMatrix*)element;
break; 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];
// <modifierMask key="keyEquivalentModifierMask" shift="YES"/> node // <modifierMask key="keyEquivalentModifierMask" shift="YES"/> node
PASS_MODIFIER(0, NSShiftKeyMask); PASS_MODIFIER(0, NSShiftKeyMask)
// <modifierMask key="keyEquivalentModifierMask" command="YES"/> node // <modifierMask key="keyEquivalentModifierMask" command="YES"/> node
PASS_MODIFIER(1, NSCommandKeyMask); PASS_MODIFIER(1, NSCommandKeyMask)
// <modifierMask key="keyEquivalentModifierMask" /> // <modifierMask key="keyEquivalentModifierMask" />
PASS_MODIFIER(2, 0); PASS_MODIFIER(2, 0)
// Unlike NSMenuItem, the default for NSButtonCell is 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;
} }

View file

@ -9,56 +9,67 @@
int main() int main()
{ {
START_SET("GSXib5KeyedUnarchiver NSMenu tests") START_SET("GSXib5KeyedUnarchiver NSMenu tests")
NS_DURING NS_DURING
{ {
[NSApplication sharedApplication]; [NSApplication sharedApplication];
} }
NS_HANDLER NS_HANDLER
{ {
if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) if ([[localException name]
SKIP("It looks like GNUstep backend is not yet installed") isEqualToString: NSInternalInconsistencyException ])
} {
NS_ENDHANDLER SKIP("It looks like GNUstep backend is not yet installed")
}
}
NS_ENDHANDLER;
NSData *data;
GSXibKeyedUnarchiver *unarchiver;
NSArray *rootObjects;
NSEnumerator *enumerator;
id element;
NSMenu *menu;
NSData* data = [NSData dataWithContentsOfFile:@"Menu.xib"]; data = [NSData dataWithContentsOfFile:@"Menu.xib"];
GSXibKeyedUnarchiver* unarchiver = [GSXibKeyedUnarchiver unarchiverForReadingWithData:data]; unarchiver = [GSXibKeyedUnarchiver unarchiverForReadingWithData:data];
NSArray *rootObjects;
rootObjects = [unarchiver decodeObjectForKey: @"IBDocument.RootObjects"]; rootObjects = [unarchiver decodeObjectForKey: @"IBDocument.RootObjects"];
enumerator = [rootObjects objectEnumerator];
NSMenu* menu; while ((element = [enumerator nextObject]) != nil)
{
for (id element in rootObjects) { if ([element isKindOfClass: [NSMenu class]])
if ([element isKindOfClass:[NSMenu class]]) { {
menu = (NSMenu*)element; menu = (NSMenu*)element;
break; break;
} }
} }
PASS(menu != nil, "Top-level NSMenu was found"); PASS(menu != nil, "Top-level NSMenu was found")
// Empty <modifierMask key="keyEquivalentModifierMask"/> node // Empty <modifierMask key="keyEquivalentModifierMask"/> node
PASS_MODIFIER(0, 0); PASS_MODIFIER(0, 0)
// <modifierMask key="keyEquivalentModifierMask" shift="YES"/> // <modifierMask key="keyEquivalentModifierMask" shift="YES"/>
PASS_MODIFIER(1, NSShiftKeyMask); PASS_MODIFIER(1, NSShiftKeyMask)
// <modifierMask key="keyEquivalentModifierMask" command="YES"/> // <modifierMask key="keyEquivalentModifierMask" command="YES"/>
PASS_MODIFIER(2, NSCommandKeyMask); PASS_MODIFIER(2, NSCommandKeyMask)
// <modifierMask key="keyEquivalentModifierMask" option="YES"/> // <modifierMask key="keyEquivalentModifierMask" option="YES"/>
PASS_MODIFIER(3, NSAlternateKeyMask); PASS_MODIFIER(3, NSAlternateKeyMask)
// No modifierMask element // No modifierMask element
PASS_MODIFIER(4, NSCommandKeyMask); PASS_MODIFIER(4, NSCommandKeyMask)
// No modifierMask element and no keyEquivalent attribute // No modifierMask element and no keyEquivalent attribute
PASS_MODIFIER(5, NSCommandKeyMask); PASS_MODIFIER(5, NSCommandKeyMask)
// no modfierMask // no modfierMask
PASS_MODIFIER(6, NSCommandKeyMask); PASS_MODIFIER(6, NSCommandKeyMask)
// empty modifierMask // empty modifierMask
PASS_MODIFIER(7, 0); PASS_MODIFIER(7, 0)
// explicit modifier mask // explicit modifier mask
PASS_MODIFIER(8, NSCommandKeyMask); PASS_MODIFIER(8, NSCommandKeyMask)
END_SET("GSXib5KeyedUnarchiver NSMenu tests") END_SET("GSXib5KeyedUnarchiver NSMenu tests")
return 0;
} }

View file

@ -11,159 +11,159 @@ copyright 2004 Alexander Malmberg <alexander@malmberg.org>
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
CREATE_AUTORELEASE_POOL(arp); CREATE_AUTORELEASE_POOL(arp);
NSBezierPath *p=[[NSBezierPath alloc] init]; NSBezierPath *p=[[NSBezierPath alloc] init];
NSRect r; 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 moveToPoint: NSMakePoint(100,100)];
[p lineToPoint: NSMakePoint(150,150)]; [p lineToPoint: NSMakePoint(150,150)];
pass(NSEqualRects([p bounds],NSMakeRect(100,100,50,50)),"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)"); pass(NSEqualRects([p controlPointBounds],NSMakeRect(100,100,50,50)),"control-point bounds accuracy (1)");
[p removeAllPoints]; [p removeAllPoints];
pass(NSIsEmptyRect([p bounds]),"empty path gives empty bounds (2)"); pass(NSIsEmptyRect([p bounds]),"empty path gives empty bounds (2)");
[p moveToPoint: NSMakePoint(100,100)]; [p moveToPoint: NSMakePoint(100,100)];
[p curveToPoint: NSMakePoint(200,100) [p curveToPoint: NSMakePoint(200,100)
controlPoint1: NSMakePoint(125,50) controlPoint1: NSMakePoint(125,50)
controlPoint2: NSMakePoint(175,150)]; controlPoint2: NSMakePoint(175,150)];
/* Basic checking Y. */ /* Basic checking Y. */
r=[p bounds]; r=[p bounds];
if (fabs(r.origin.x - 100.0000) > 0.001 || if (fabs(r.origin.x - 100.0000) > 0.001 ||
fabs(r.origin.y - 85.5662) > 0.001 || fabs(r.origin.y - 85.5662) > 0.001 ||
fabs(r.size.width - 100.0000) > 0.001 || fabs(r.size.width - 100.0000) > 0.001 ||
fabs(r.size.height - 28.8678) > 0.001) fabs(r.size.height - 28.8678) > 0.001)
{ {
pass(0,"bounds accuracy (2)"); pass(0,"bounds accuracy (2)");
printf("expected %s, got %s\n", printf("expected %s, got %s\n",
[NSStringFromRect(NSMakeRect(100.0000, 85.5662, 100.0000, 28.8678)) lossyCString], [NSStringFromRect(NSMakeRect(100.0000, 85.5662, 100.0000, 28.8678)) lossyCString],
[NSStringFromRect(r) lossyCString]); [NSStringFromRect(r) lossyCString]);
} }
else else
pass(1,"bounds accuracy (2)"); 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. */ /* Basic checking X. */
[p removeAllPoints]; [p removeAllPoints];
[p moveToPoint: NSMakePoint(100,100)]; [p moveToPoint: NSMakePoint(100,100)];
[p curveToPoint: NSMakePoint(100,200) [p curveToPoint: NSMakePoint(100,200)
controlPoint1: NSMakePoint(50,125) controlPoint1: NSMakePoint(50,125)
controlPoint2: NSMakePoint(150,175)]; controlPoint2: NSMakePoint(150,175)];
r=[p bounds]; r=[p bounds];
if (fabs(r.origin.y - 100.0000) > 0.001 || if (fabs(r.origin.y - 100.0000) > 0.001 ||
fabs(r.origin.x - 85.5662) > 0.001 || fabs(r.origin.x - 85.5662) > 0.001 ||
fabs(r.size.height - 100.0000) > 0.001 || fabs(r.size.height - 100.0000) > 0.001 ||
fabs(r.size.width - 28.8678) > 0.001) fabs(r.size.width - 28.8678) > 0.001)
{ {
pass(0,"bounds accuracy (3)"); pass(0,"bounds accuracy (3)");
printf("expected %s, got %s\n", printf("expected %s, got %s\n",
[NSStringFromRect(NSMakeRect(85.5662, 100.0000, 28.8678, 100.0000)) lossyCString], [NSStringFromRect(NSMakeRect(85.5662, 100.0000, 28.8678, 100.0000)) lossyCString],
[NSStringFromRect(r) lossyCString]); [NSStringFromRect(r) lossyCString]);
} }
else else
pass(1,"bounds accuracy (3)"); pass(1,"bounds accuracy (3)");
/* A bit of both, and extreme values beyond the initial points. */ /* A bit of both, and extreme values beyond the initial points. */
[p removeAllPoints]; [p removeAllPoints];
[p moveToPoint: NSMakePoint(-100,0)]; [p moveToPoint: NSMakePoint(-100,0)];
[p curveToPoint: NSMakePoint(100,0) [p curveToPoint: NSMakePoint(100,0)
controlPoint1: NSMakePoint(-118.2, 10.393) controlPoint1: NSMakePoint(-118.2, 10.393)
controlPoint2: NSMakePoint( 118.2,-10.393)]; controlPoint2: NSMakePoint( 118.2,-10.393)];
r=[p bounds]; r=[p bounds];
if (fabs(r.origin.x + 101.0) > 0.001 || if (fabs(r.origin.x + 101.0) > 0.001 ||
fabs(r.origin.y + 3.0) > 0.001 || fabs(r.origin.y + 3.0) > 0.001 ||
fabs(r.size.width - 202.0) > 0.001 || fabs(r.size.width - 202.0) > 0.001 ||
fabs(r.size.height - 6.0) > 0.001) fabs(r.size.height - 6.0) > 0.001)
{ {
pass(0,"bounds accuracy (4)"); pass(0,"bounds accuracy (4)");
printf("expected %s, got %s\n", printf("expected %s, got %s\n",
[NSStringFromRect(NSMakeRect(-101.0, -3.0, 202.0, 6.0)) lossyCString], [NSStringFromRect(NSMakeRect(-101.0, -3.0, 202.0, 6.0)) lossyCString],
[NSStringFromRect(r) lossyCString]); [NSStringFromRect(r) lossyCString]);
} }
else else
pass(1,"bounds accuracy (4)"); pass(1,"bounds accuracy (4)");
/* Check the control-point bounding box. */ /* Check the control-point bounding box. */
r=[p controlPointBounds]; r=[p controlPointBounds];
if (fabs(r.origin.x + 118.2 ) > 0.001 || if (fabs(r.origin.x + 118.2 ) > 0.001 ||
fabs(r.origin.y + 10.393) > 0.001 || fabs(r.origin.y + 10.393) > 0.001 ||
fabs(r.size.width - 236.4 ) > 0.001 || fabs(r.size.width - 236.4 ) > 0.001 ||
fabs(r.size.height - 20.786) > 0.001) fabs(r.size.height - 20.786) > 0.001)
{ {
pass(0,"control-point bounds accuracy (3)"); pass(0,"control-point bounds accuracy (3)");
printf("expected %s, got %s\n", printf("expected %s, got %s\n",
[NSStringFromRect(NSMakeRect(-118.2, -10.393, 236.4, 20.786)) lossyCString], [NSStringFromRect(NSMakeRect(-118.2, -10.393, 236.4, 20.786)) lossyCString],
[NSStringFromRect(r) lossyCString]); [NSStringFromRect(r) lossyCString]);
} }
else else
pass(1,"control-point bounds accuracy (3)"); 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) c-2b+a +- sqrt(a(d-c)+b(-d-c)+c^2+b^2)
t= -------------------------------------- t= --------------------------------------
-d+3c-3b+a -d+3c-3b+a
*/ */
if (0) if (0)
{ {
NSPoint a,b,c,d; NSPoint a,b,c,d;
double t1,t2; double t1,t2;
double t,ti; double t,ti;
NSPoint p; NSPoint p;
a=NSMakePoint(-100,0); a=NSMakePoint(-100,0);
b=NSMakePoint(-118.2,10.39); b=NSMakePoint(-118.2,10.39);
c=NSMakePoint(118.2,-10.39); c=NSMakePoint(118.2,-10.39);
d=NSMakePoint(100,0); d=NSMakePoint(100,0);
#define D \ #define D \
ti=1.0-t; \ 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.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; \ 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); printf(" t=%15.7f (%15.7f %15.7f)\n",t,p.x,p.y);
t=0; D t=0; D
t=1; D t=1; D
t=0.5; 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); 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); 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"); printf("x:\n");
t=t1; t=t1;
D D
t=t2; t=t2;
D 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); 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); 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"); printf("y:\n");
t=t1; t=t1;
D D
t=t2; t=t2;
D D
} }
// printf("bounds=%@\n",NSStringFromRect([p bounds])); // printf("bounds=%@\n",NSStringFromRect([p bounds]));
DESTROY(arp); DESTROY(arp);
return 0; return 0;
} }

View file

@ -8,44 +8,57 @@
int main() int main()
{ {
START_SET("NSButtonCell encoding tests") START_SET("NSButtonCell encoding tests")
NS_DURING NS_DURING
{ {
[NSApplication sharedApplication]; [NSApplication sharedApplication];
} }
NS_HANDLER NS_HANDLER
{ {
if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) if ([[localException name]
SKIP("It looks like GNUstep backend is not yet installed") isEqualToString: NSInternalInconsistencyException ])
} {
SKIP("It looks like GNUstep backend is not yet installed")
}
}
NS_ENDHANDLER NS_ENDHANDLER
NSString* mask = @"NSButtonFlags2"; NSString *mask = @"NSButtonFlags2";
NSButtonCell* item = [[NSButtonCell alloc] init]; NSButtonCell *item = [[NSButtonCell alloc] init];
item.keyEquivalent = @"A"; item.keyEquivalent = @"A";
item.keyEquivalentModifierMask = NSShiftKeyMask; item.keyEquivalentModifierMask = NSShiftKeyMask;
NSMutableData *data = [NSMutableData data]; NSMutableData *data = [NSMutableData data];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]; NSKeyedArchiver *archiver;
[archiver encodeRootObject:item]; archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData: data];
[archiver encodeRootObject: item];
[archiver finishEncoding]; [archiver finishEncoding];
NSError* error; NSError *error;
NSDictionary* archive = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:nil error:&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; dict = (NSDictionary*)element;
if ([[dict allKeys] containsObject:mask]) if ([[dict allKeys] containsObject: mask])
{ {
break; break;
} }
@ -53,14 +66,22 @@ int main()
{ {
dict = nil; dict = nil;
} }
} }
} }
PASS(dict != nil, "Found a dict with a NSButtonFlags2 entry"); 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 != 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") END_SET("NSButtonCell encoding tests")
}
return 0;
}

View file

@ -7,30 +7,42 @@
int main() int main()
{ {
NSString* mask = @"NSKeyEquivModMask"; START_SET("NSMenuItem key equivalent mask")
NSMenuItem* item = [[NSMenuItem alloc] init];
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; item.keyEquivalentModifierMask = NSShiftKeyMask;
NSMutableData *data = [NSMutableData data]; archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData: data];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
[archiver encodeRootObject:item]; [archiver encodeRootObject: item];
[archiver finishEncoding]; [archiver finishEncoding];
NSError* error; archive = [NSPropertyListSerialization propertyListWithData: data
NSDictionary* archive = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:nil error:&error]; options: NSPropertyListImmutable
format: nil
error: &error];
NSArray* topLevelObjects = [archive objectForKey:@"$objects"]; topLevelObjects = [archive objectForKey: @"$objects"];
enumerator = [topLevelObjects objectEnumerator];
NSDictionary* dict; while ((element = [enumerator nextObject]) != nil)
for (id element in topLevelObjects)
{ {
if ([element isKindOfClass:[NSDictionary class]]) if ([element isKindOfClass: [NSDictionary class]])
{ {
dict = (NSDictionary*)element; dict = (NSDictionary*)element;
if ([[dict allKeys] containsObject:mask]) if ([[dict allKeys] containsObject: mask])
{ {
break; break;
} }
@ -43,7 +55,13 @@ int main()
PASS(dict != nil, "Found a dict with a NSKeyEquivModMask entry"); PASS(dict != nil, "Found a dict with a NSKeyEquivModMask entry");
NSNumber* encodedKeyMask = [dict valueForKey:mask]; encodedKeyMask = [dict valueForKey: mask];
PASS(encodedKeyMask != nil, "Retrieved the NSKeyEquivModMask value"); 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); PASS([encodedKeyMask intValue] == NSShiftKeyMask,
} "Encoded key mask 0x%x matches expected key mask 0x%x",
[encodedKeyMask intValue], NSShiftKeyMask)
END_SET("NSMenuItem key equivalent mask")
return 0;
}

View file

@ -16,24 +16,27 @@
int main() int main()
{ {
NSAutoreleasePool *arp = [NSAutoreleasePool new]; NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSArray **testObjects; NSArray **testObjects = NULL;
BOOL success = NO; BOOL success = NO;
NSFileManager *mgr = [NSFileManager defaultManager]; NSFileManager *mgr = [NSFileManager defaultManager];
NSString *path = [mgr currentDirectoryPath]; NSString *path = [mgr currentDirectoryPath];
NSBundle *bundle = [[NSBundle alloc] initWithPath: path]; NSBundle *bundle = [[NSBundle alloc] initWithPath: path];
START_SET("NSNibLoading GNUstep basic") START_SET("NSNibLoading GNUstep basic")
NS_DURING NS_DURING
{ {
[NSApplication sharedApplication]; [NSApplication sharedApplication];
} }
NS_HANDLER NS_HANDLER
{ {
if ([[localException name] isEqualToString: NSInternalInconsistencyException ]) if ([[localException name]
SKIP("It looks like GNUstep backend is not yet installed") isEqualToString: NSInternalInconsistencyException])
} {
SKIP("It looks like GNUstep backend is not yet installed")
}
}
NS_ENDHANDLER NS_ENDHANDLER
if ([[path lastPathComponent] isEqualToString: @"obj"]) if ([[path lastPathComponent] isEqualToString: @"obj"])
@ -49,19 +52,22 @@ int main()
owner: [NSApplication sharedApplication] owner: [NSApplication sharedApplication]
topLevelObjects: testObjects]; 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" success = [bundle loadNibNamed: @"Test-xib"
owner: [NSApplication sharedApplication] owner: [NSApplication sharedApplication]
topLevelObjects: testObjects]; 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" success = [bundle loadNibNamed: @"Test-nib"
owner: [NSApplication sharedApplication] owner: [NSApplication sharedApplication]
topLevelObjects: testObjects]; 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 NS_HANDLER
{ {

View file

@ -5,15 +5,15 @@
GNUSTEP_GUI_GCC=4.0.0 GNUSTEP_GUI_GCC=4.0.0
# Versions for libraries that gnustep-gui is dependent upon # 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 GNUSTEP_GUI_LIBTIFF=3.4
# The version number of this release. # The version number of this release.
GNUSTEP_GUI_MAJOR_VERSION=0 GNUSTEP_GUI_MAJOR_VERSION=0
GNUSTEP_GUI_MINOR_VERSION=30 GNUSTEP_GUI_MINOR_VERSION=31
GNUSTEP_GUI_SUBMINOR_VERSION=0 GNUSTEP_GUI_SUBMINOR_VERSION=1
# numeric value should match above # numeric value should match above
VERSION_NUMBER=030.0 VERSION_NUMBER=031.1
GNUSTEP_GUI_VERSION=${GNUSTEP_GUI_MAJOR_VERSION}.${GNUSTEP_GUI_MINOR_VERSION}.${GNUSTEP_GUI_SUBMINOR_VERSION} GNUSTEP_GUI_VERSION=${GNUSTEP_GUI_MAJOR_VERSION}.${GNUSTEP_GUI_MINOR_VERSION}.${GNUSTEP_GUI_SUBMINOR_VERSION}
VERSION=${GNUSTEP_GUI_VERSION} VERSION=${GNUSTEP_GUI_VERSION}

View file

@ -10,11 +10,12 @@ URL: http://www.gnustep.org/
%description %description
The GNUstep gui Library is a powerful library of graphical user interface The GNUstep gui Library is a powerful library of graphical user interface
classes written completely in the Objective-C language; the classes are classes written completely in the Objective-C language; the classes are based
based upon the OpenStep specification, and provide the user with a on Cocoa (formerly OPENSTEP), and provide the user with a themable environment.
traditional nextstep-like look and feel. The classes include graphical While the default look and feel resembles NeXTSTEP, this can be changed.
objects such as windows, menus, buttons, text fields, popup lists, browsers, The classes include graphical objects such as windows, menus, buttons,
scrollviews, splitviews, fonts, colors, images, events, pasteboards,... This text fields, popup lists, browsers, scrollviews, splitviews, fonts, colors,
package includes development headers too. You need the corresponding images, events, pasteboards,... This package includes development headers too.
backend library package (gnustep-back) to use this package. You need the corresponding backend library package (gnustep-back) to use
this package.