Merge branch 'master' into NSStoryboard_refactor

This commit is contained in:
Gregory John Casamento 2025-02-17 03:51:10 -05:00
commit d3082229b9
76 changed files with 5139 additions and 2916 deletions

View file

@ -44,8 +44,7 @@ install_libobjc2() {
install_libdispatch() {
echo "::group::libdispatch"
cd $DEPS_PATH
# will reference upstream after https://github.com/apple/swift-corelibs-libdispatch/pull/534 is merged
git clone -q -b system-blocksruntime https://github.com/ngrewe/swift-corelibs-libdispatch.git libdispatch
git clone -q https://github.com/swiftlang/swift-corelibs-libdispatch.git libdispatch
mkdir libdispatch/build
cd libdispatch/build
# -Wno-error=void-pointer-to-int-cast to work around build error in queue.c due to -Werror

View file

@ -33,6 +33,10 @@ env:
libcurl4-gnutls-dev
libgmp-dev
libcairo2-dev
libjpeg-dev
libtiff-dev
libpng-dev
libicns-dev
# packages for GCC Objective-C runtime
APT_PACKAGES_gcc: >-
@ -129,7 +133,7 @@ jobs:
make check
- name: Upload logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: Logs - ${{ matrix.name }}

View file

@ -1,7 +1,7 @@
1 Announcement
**************
This is version 0.31.1 of the GNUstep GUI library ('gnustep-gui').
This is version 0.32.0 of the GNUstep GUI library (gnustep-gui).
1.1 What is the GNUstep GUI Library?
====================================
@ -32,25 +32,61 @@ Group's libjpeg library, and a back-end component from the GNUstep
libraries. For example, to build the Cairo backend in the GNUstep Back
library, you will need to install Cairo.
1.2 Noteworthy changes in version '0.31.1'
1.2 Noteworthy changes in version 0.32.0
==========================================
This is a bugfix release
This version adds binding support for NSBrowser, NSOutlineView and
NSTableView. Plus the usual bunch of bug fixes.
* Fix bug decoding menu items (breaking archive)
* Remove use of deprecated lock from base library
• Add support for bindings in NSBrowser.
• Return top level object when loading .gorm files.
• Add bindings support to NSOutlineView,
• Add support for 10.6 item-based delegate methods to NSBrowser.
• Add NSMenuToolbarItem.
• Add view based rendering to NSTableView and NSOutlineView.
• Add code to NSTreeController.
• Fix display of icons if the home is a symlink.
• Make some ivars in NSView protected instead of package scoped.
• Fix CI pipeline.
• Revert _updateFieldEditor: on NSTextFieldCell.
• GSTheme bug fix by Tom Sheffler <tom.sheffler@gmail.com>.
• Fix memory leaks in test code.
• Don't load nil filename in NSImageRep.
• Prevent flickering in NSClipView.
• Simplify ICU configuration.
• Move GSColorSliderCell into gui itself.
• Bugfix for NSMenuView.
• Fix single colum handling in NSCollectionView.
• Additional GSTheme method(s) for NSTabView.
• Modify NSComboBox to handle attributed strings.
• NSTextFieldCell: Decode placeholder string.
• Make white default selection highlight color for NSTableView.
• Implement showsresizeindicator.
• NSApplication: toggle menu item "Hide" title and action on user
click.
• Add NSCellHitResult typedef, introduced in OSX 10.10.
• Make menu visiblity themable.
• Fix decoding alternateContents in NSButtonCell.
• Font Panel autosizing fix.
• Implement integerValue method in NSSliderCell.
• NSBox: use macro to decode NSInteger into enum.
• Fall back to pkgconfig for resolving libtiff.
• GSMemoryPanel: Only call GSDebug* in debug mode.
• Add APPKIT_EXPORT_CLASS, APPKIT_EXPORT annotations for some GS*
classes.
• Push modal window to top later in process.
1.3 Where can you get it? How can you compile it?
=================================================
The gnustep-gui-0.31.1.tar.gz distribution file has been placed at
The gnustep-gui-0.32.0.tar.gz distribution file has been placed at
<ftp://ftp.gnustep.org/pub/gnustep/core>.
It is accompanied by gnustep-gui-0.31.1.tar.gz.sig, a PGP signature
It is accompanied by gnustep-gui-0.32.0.tar.gz.sig, a PGP signature
which you can validate by putting both files in the same directory and
using:
gpg --verify gnustep-gui-0.31.1.tar.gz.sig
gpg --verify gnustep-gui-0.32.0.tar.gz.sig
Signature has been created using the key with the following
fingerprint:

12
BUGS
View file

@ -7,12 +7,12 @@
The following classes are currently unimplemented or unfinished to such
a degree to be unusable.
* NSFontDescriptor
* NSColorSpace
* NSSearchField and NSSearchFieldCell
NSFontDescriptor
NSColorSpace
NSSearchField and NSSearchFieldCell
Classes that need work (well every class needs work!)
* NSTableView and NSOutlineView
* NSProgressIndicator
* All the Text classes
NSTableView and NSOutlineView
NSProgressIndicator
All the Text classes

View file

@ -1,3 +1,61 @@
2025-02-11 Richard Frith-Macdonald <rfm@gnu.org>
* ANNOUNCE:
* BUGS:
* INSTALL:
* NEWS:
* Source/DocMakefile:
* Version:
Updates for 0.32.0 release
2024-11-08 Gregory John Casamento <greg.casamento@gmail.com>
* Headers/AppKit/NSBrowser.h: Add dictionary to hold relationships.
* Source/NSBrowser.m: Add logic in methods to support bindings,
expose bindings in +initialize.
* Source/NSTextFieldCell.m: Minor fix to NSTextField for displaying
binding values.
2024-10-31 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSServicesManager.m: fix -laterDate: conditionals to be true
only when file date has been updated (returned value != receiver).
2024-10-29 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSLayoutAnchor.h: Add missing include that is required after a change in base.
* Source/NSTableView.m: Forward declare new methods.
2024-08-29 Gregory John Casamento <greg.casamento@gmail.com>
* Source/NSBundleAdditions.m: Quick fix for .gorm loading
not returning top level objects.
2024-08-18 Gregory John Casamento <greg.casamento@gmail.com>
* Headers/AppKit/NSTreeController.h: Update header
* Headers/AppKit/NSTreeNode.h: Update header
* Source/GNUmakefile: Add new class
* Source/GSBindingHelpers.h: Add NSString category
* Source/GSControllerTreeProxy.[hm]: Proxy class
for NSTreeController, a subclass of NSTreeNode.
* Source/GSThemeDrawing.m: Optimize code a bit and
add changes for bindings.
* Source/GSXib5KeyedUnarchiver.m: Add support for new keys
on NSTreeController.
* Source/NSKeyValueBinding.m: Add new methods to
GSKeyValueBinding
* Source/NSOutlineView.m: Add support for bindings.
* Source/NSTreeController.m: Implement new methods.
* Source/NSTreeNode.m: Implement new methods
2024-07-25 Gregory John Casamento <greg.casamento@gmail.com>
* Headers/AppKit/NSBrowser.h: Add declarations for
10.6 delegate methods for item-based browsers.
* Source/NSBrowser.m: Add support for 10.6 item-based
delegate methods.
2024-06-28 Gregory John Casamento <greg.casamento@gmail.com>
* Headers/AppKit/AppKit.h: Add NSMenuToolbarItem.h
@ -9,7 +67,7 @@
* 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

View file

@ -34,7 +34,7 @@ BUNDLE_NAME = StandardPicker NamedPicker WheelPicker
BUNDLE_INSTALL_DIR = $(GNUSTEP_LIBRARY)/ColorPickers
ADDITIONAL_INCLUDE_DIRS += -I../Headers/Additions -I../Headers
ADDITIONAL_INCLUDE_DIRS += -I../Headers/Additions -I../Headers -I../Source
ADDITIONAL_LIB_DIRS += -L../Source/$(GNUSTEP_OBJ_DIR) -L../Models/$(GNUSTEP_OBJ_DIR)
@ -43,10 +43,9 @@ StandardPicker_OBJC_FILES = GSStandardColorPicker.m \
GSRGBColorPicker.m \
GSCMYKColorPicker.m \
GSHSBColorPicker.m \
GSGrayColorPicker.m \
GSColorSliderCell.m
GSGrayColorPicker.m
NamedPicker_OBJC_FILES = GSNamedColorPicker.m
WheelPicker_OBJC_FILES = GSWheelColorPicker.m GSColorSliderCell.m
WheelPicker_OBJC_FILES = GSWheelColorPicker.m
# The class to load
StandardPicker_PRINCIPAL_CLASS = GSStandardColorPicker

View file

@ -9,6 +9,51 @@
The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}.
@end ifclear
@section Noteworthy changes in version @samp{0.32.0}
This version adds binding support for NSBrowser, NSOutlineView and NSTableView.
Plus the usual bunch of bug fixes.
@itemize @bullet
@item Add support for bindings in NSBrowser.
@item Return top level object when loading .gorm files.
@item Add bindings support to NSOutlineView,
@item Add support for 10.6 item-based delegate methods to NSBrowser.
@item Add NSMenuToolbarItem.
@item Add view based rendering to NSTableView and NSOutlineView.
@item Add code to NSTreeController.
@item Fix display of icons if the home is a symlink.
@item Make some ivars in NSView protected instead of package scoped.
@item Fix CI pipeline.
@item Revert _updateFieldEditor: on NSTextFieldCell.
@item GSTheme bug fix by Tom Sheffler <tom.sheffler@@gmail.com>.
@item Fix memory leaks in test code.
@item Don't load nil filename in NSImageRep.
@item Prevent flickering in NSClipView.
@item Simplify ICU configuration.
@item Move GSColorSliderCell into gui itself.
@item Bugfix for NSMenuView.
@item Fix single colum handling in NSCollectionView.
@item Additional GSTheme method(s) for NSTabView.
@item Modify NSComboBox to handle attributed strings.
@item NSTextFieldCell: Decode placeholder string.
@item Make white default selection highlight color for NSTableView.
@item Implement showsresizeindicator.
@item NSApplication: toggle menu item "Hide" title and action on user click.
@item Add NSCellHitResult typedef, introduced in OSX 10.10.
@item Make menu visiblity themable.
@item Fix decoding alternateContents in NSButtonCell.
@item Font Panel autosizing fix.
@item Implement integerValue method in NSSliderCell.
@item NSBox: use macro to decode NSInteger into enum.
@item Fall back to pkgconfig for resolving libtiff.
@item GSMemoryPanel: Only call GSDebug* in debug mode.
@item Add APPKIT_EXPORT_CLASS, APPKIT_EXPORT annotations for some GS* classes.
@item Push modal window to top later in process.
@end itemize
@ifclear ANNOUNCE-ONLY
@section Noteworthy changes in version @samp{0.31.1}
This is a bugfix release
@ -18,8 +63,6 @@ This is a bugfix release
@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.

View file

@ -169,6 +169,7 @@
</unit>
*/
APPKIT_EXPORT_CLASS
@interface GSHbox: GSTable
{
BOOL _haveViews;

View file

@ -44,7 +44,7 @@
@class NSView;
@class NSPrintInfo;
APPKIT_EXPORT_CLASS
@interface GSPrintOperation: NSPrintOperation
{
}

View file

@ -171,6 +171,7 @@
</section>
</unit>
*/
APPKIT_EXPORT_CLASS
@interface GSTable: NSView
{
int _numberOfRows;

View file

@ -1265,6 +1265,8 @@ APPKIT_EXPORT_CLASS
- (NSRect) browserHeaderDrawingRectForCell: (NSTableHeaderCell*)cell
withFrame: (NSRect)rect;
- (CGFloat) tabHeightForType: (NSTabViewType)type;
- (NSRect) tabViewContentRectForBounds: (NSRect)aRect
tabViewType: (NSTabViewType)type
tabView: (NSTabView *)view;
@ -1275,6 +1277,10 @@ APPKIT_EXPORT_CLASS
- (NSRect) tabViewBackgroundRectForBounds: (NSRect)aRect
tabViewType: (NSTabViewType)type;
- (void) drawTabViewBezelRect: (NSRect)aRect
tabViewType: (NSTabViewType)type
inView: (NSView *)view;
- (void) drawTabViewRect: (NSRect)rect
inView: (NSView *)view
withItems: (NSArray *)items
@ -1569,6 +1575,12 @@ withRepeatedImage: (NSImage*)image
- (void) organizeMenu: (NSMenu *)menu
isHorizontal: (BOOL)horizontal;
/**
* Used by the theme to override the proposed menu visibility. The default
* implementation simply returns the proposed visibility unmodified.
*/
- (BOOL) proposedVisibility: (BOOL)visible
forMenu: (NSMenu *) menu;
@end
@interface GSTheme (OpenSavePanels)

View file

@ -591,7 +591,6 @@ name(GSCTXT *ctxt, type1 var1, type2 var2, type3 var3, type4 var4, type5 var5, t
(ctxt, @selector(name: : : : : : : :), var1, var2, var3, var4, var5, var6, var7, var8); \
}
#endif // _MSVC_VER
/** </ignore> */
/* ----------------------------------------------------------------------- */
/* Color operations */
@ -819,6 +818,7 @@ DPS_METHOD_8(DPSdissolve, CGFloat, x, CGFloat, y, CGFloat, w, CGFloat, h, NSInte
DPS_METHOD_2(GSDrawImage, NSRect, rect, void *, imageref)
/** </ignore> */
/* ----------------------------------------------------------------------- */
/* Postscript Client functions */

View file

@ -37,12 +37,13 @@
@class NSArray;
@class NSIndexPath;
@class NSIndexSet;
@class NSMutableDictionary;
@class NSCell;
@class NSEvent;
@class NSMatrix;
@class NSScroller;
//@class NSBox;
@class NSViewController;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
enum _NSBrowserColumnResizingType
@ -62,7 +63,6 @@ APPKIT_EXPORT_CLASS
Class _browserMatrixClass;
NSString *_pathSeparator;
//NSBox *_horizontalScrollerBox;
NSScroller *_horizontalScroller;
NSTimeInterval _lastKeyPressed;
NSString *_charBuffer;
@ -99,6 +99,9 @@ APPKIT_EXPORT_CLASS
int _lastVisibleColumn;
NSString *_columnsAutosaveName;
NSBrowserColumnResizingType _columnResizing;
BOOL _itemBasedDelegate;
NSMutableDictionary *_columnDictionary;
}
//
@ -355,6 +358,31 @@ canDragRowsWithIndexes: (NSIndexSet *)rowIndexes
inColumn: (NSInteger)column
withEvent: (NSEvent *)event;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
- (NSInteger) browser: (NSBrowser *)browser
numberOfChildrenOfItem: (id)item;
- (id) browser: (NSBrowser *)browser
child: (NSInteger)index
ofItem: (id)item;
- (BOOL) browser: (NSBrowser *)browser
isLeafItem: (id)item;
- (BOOL) browser: (NSBrowser *)browser
shouldEditItem: (id)item;
- (id) browser: (NSBrowser *)browser
objectValueForItem: (id)item;
- (id) browser: (NSBrowser *)browser
setObjectValue: (id)object
forItem: (id)item;
- (id) rootItemForBrowser: (NSBrowser *)browser;
- (NSViewController *) browser: (NSBrowser *)browser
previewViewControllerForLeafItem: (id)item;
- (NSViewController *) browser: (NSBrowser *)browser
headerViewControllerForItem: (id)item;
- (void) browser: (NSBrowser *)browser
didChangeLastColumn: (NSInteger)oldLastColumn
toColumn: (NSInteger)column;
#endif
@end
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)

View file

@ -167,6 +167,9 @@ enum {
NSCellHitTrackableArea = 4
};
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST)
typedef NSUInteger NSCellHitResult;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
enum {
@ -492,10 +495,17 @@ APPKIT_EXPORT_CLASS
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
- (NSBackgroundStyle)backgroundStyle;
- (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST)
- (NSCellHitResult)hitTestForEvent:(NSEvent *)event
inRect:(NSRect)cellFrame
ofView:(NSView *)controlView;
#else
- (NSUInteger)hitTestForEvent:(NSEvent *)event
inRect:(NSRect)cellFrame
ofView:(NSView *)controlView;
#endif
#endif
//
// Managing the Cursor

View file

@ -126,6 +126,7 @@ APPKIT_EXPORT NSString *NSSelectedObjectBinding;
APPKIT_EXPORT NSString *NSSelectedTagBinding;
APPKIT_EXPORT NSString *NSSelectedValueBinding;
APPKIT_EXPORT NSString *NSSelectionIndexesBinding;
APPKIT_EXPORT NSString *NSSelectionIndexPathsBinding;
APPKIT_EXPORT NSString *NSSortDescriptorsBinding;
APPKIT_EXPORT NSString *NSTextColorBinding;
APPKIT_EXPORT NSString *NSTitleBinding;

View file

@ -27,6 +27,7 @@
#import <AppKit/AppKitDefines.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST)

View file

@ -410,7 +410,7 @@ APPKIT_EXPORT_CLASS
unsigned int unused: 25;
} _menu;
@private
@protected
NSWindow *_aWindow;
NSWindow *_bWindow;
NSMenu *_oldAttachedMenu;

View file

@ -44,7 +44,6 @@ APPKIT_EXPORT_CLASS
NSMapTable *_itemDict;
NSMutableArray *_items;
NSMutableArray *_expandedItems;
NSMutableArray *_selectedItems; /* No longer in use */
NSMapTable *_levelOfItems;
BOOL _autoResizesOutlineColumn;
BOOL _indentationMarkerFollowsCell;

View file

@ -1,4 +1,4 @@
/*
/*
NSTreeController.h
The tree controller class.
@ -7,7 +7,7 @@
Author: Gregory Casamento <greg.casamento@gmail.com>
Date: 2012
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
@ -22,10 +22,10 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
*/
#ifndef _GNUstep_H_NSTreeController
#define _GNUstep_H_NSTreeController
@ -34,6 +34,7 @@
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
#import <AppKit/NSObjectController.h>
#import <AppKit/NSNibDeclarations.h>
@class NSString;
@class NSArray;
@ -47,61 +48,306 @@ APPKIT_EXPORT_CLASS
NSString *_countKeyPath;
NSString *_leafKeyPath;
NSArray *_sortDescriptors;
NSTreeNode *_arranged_objects;
NSMutableArray *_selection_index_paths;
BOOL _alwaysUsesMultipleValuesMarker;
BOOL _avoidsEmptySelection;
BOOL _preservesSelection;
BOOL _selectsInsertedObjects;
BOOL _canAddChild;
BOOL _canInsert;
BOOL _canInsertChild;
}
- (BOOL) addSelectionIndexPaths: (NSArray*)indexPaths;
/**
* Adds the objects in the indexPaths array to the current selection.
*/
- (BOOL) addSelectionIndexPaths: (NSArray *)indexPaths;
/**
* BOOL that indicates if the controller returns the multiple values marker when
* multiple objects have been selected.
*/
- (BOOL) alwaysUsesMultipleValuesMarker;
/**
* If YES, requires the content array to maintain a selection.
*/
- (BOOL) avoidsEmptySelection;
- (BOOL) canAddChid;
/**
* If YES, a child can be added.
*/
- (BOOL) canAddChild;
/**
* If YES, an object can be inserted.
*/
- (BOOL) canInsert;
/**
* If YES, a child can be inserted.
*/
- (BOOL) canInsertChild;
- (BOOL) preservesSelection;
/**
* If YES, then preserve the current selection when the content changes.
*/
- (BOOL) preservesSelection;
/**
* If YES, then when an object is inserted it is added to the selection.
*/
- (BOOL) selectsInsertedObjects;
- (BOOL) setSelectionIndexPath: (NSIndexPath*)indexPath;
- (BOOL) setSelectionIndexPaths: (NSArray*)indexPaths;
- (id) arrangedObjects;
- (id) content;
- (NSArray*) selectedObjects;
- (NSIndexPath*) selectionIndexPath;
- (NSArray*) selectionIndexPaths;
- (NSArray*) sortDescriptors;
- (NSString*) childrenKeyPath;
- (NSString*) countKeyPath;
- (NSString*) leafKeyPath;
- (void) addChild: (id)sender;
- (void) add: (id)sender;
- (void) insertChild: (id)sender;
- (void) insertObject: (id)object atArrangedObjectIndexPath: (NSIndexPath*)indexPath;
- (void) insertObjects: (NSArray*)objects atArrangedObjectIndexPaths: (NSArray*)indexPaths;
- (void) insert: (id)sender;
/**
* Makes indexPath the current selection.
*/
- (BOOL) setSelectionIndexPath: (NSIndexPath *)indexPath;
/**
* Makes the array indexPaths the current selections.
*/
- (BOOL) setSelectionIndexPaths: (NSArray *)indexPaths;
/**
* All objects managed by this tree controller.
*/
- (NSTreeNode *) arrangedObjects;
/**
* An NSArray containing all selected objects.
*/
- (NSArray *) selectedObjects;
/**
* The index path of the first selected object.
*/
- (NSIndexPath *) selectionIndexPath;
/**
* An array containing all of the currently selected objects.
*/
- (NSArray *) selectionIndexPaths;
/**
* An array containing sort descriptors used to arrange content.
*/
- (NSArray *) sortDescriptors;
/**
* Key path for children of the node. This key must be key value
* compliant.
*/
- (NSString *) childrenKeyPath;
/**
* Key value path for the flag which gives the count for the children
* of this node. The path indicated here must be key-value compliant.
* If count is enabled, then add:, addChild:, remove:, removeChild:
* and insert: are disabled. This key path is option since it can
* be determined by the array of children retuned by the
* childKeyPath. The mode the tree controller is in when this is
* not specified is called "object" mode.
*/
- (NSString *) countKeyPath;
/**
* Key value path for the flag which determins that this is a leaf.
* The path indicated here must be key-value compliant. This
* key path is optional as it can be determined by the children
* returned by the childrenKeyPath.
*/
- (NSString *) leafKeyPath;
/**
* Adds a child to the current selection using the newObject method.
* If the tree controller is in "object" mode, then newObject is called
* to add a new node.
*/
- (IBAction) addChild: (id)sender;
/**
* Adds a new objeect to the tree usin the newObject method.
* If the tree controller is in "object" mode, then newObject is called
* to add a new node.
*/
- (IBAction) add: (id)sender;
/**
* Inserts a child using the newObject method. This method
* will fail if canInsertChild returns NO.
* If the tree controller is in "object" mode, then newObject is called
* to add a new node.
*/
- (IBAction) insertChild: (id)sender;
/**
* Inserts and object using the newObject method at the specified indexPath.
* If the tree controller is in "object" mode, then newObject is called
* to add a new node.
*/
- (void) insertObject: (id)object atArrangedObjectIndexPath: (NSIndexPath *)indexPath;
/**
* Inserts objects into arranged objects at the specified indexPaths. These arrays are
* expected to be parallel and have the same number of objects.
* This method will only function if the tree controller is in
* "object" mode.
*/
- (void) insertObjects: (NSArray *)objects atArrangedObjectIndexPaths: (NSArray *)indexPaths;
/**
* Insert an object created by newObject into arranged objects.
* This method will only function if the tree controller is in
* "object" mode.
*/
- (void) insertObject: (id)object atArrangedObjectIndexPath: (NSIndexPath *)indexPath;
/**
* Inserts objects into arranged objects at the specified indexPaths. These arrays are
* expected to be parallel and have the same number of objects.
* This method will only function if the tree controller is in
* "object" mode.
*/
- (void) insertObjects: (NSArray *)objects atArrangedObjectIndexPaths: (NSArray *)indexPaths;
/**
* Insert an object created by newObject into arranged objects.
* This method will only function if the tree controller is in
* "object" mode.
*/
- (IBAction) insert: (id)sender;
/**
* Causes the controller to re-sort and rearrange the objects. This method
* should be called if anything has been done that affects the list of objects
* in the controller.
*/
- (void) rearrangeObjects;
- (void) removeObjectAtArrangedObjectIndexPath: (NSIndexPath*)indexPath;
- (void) removeObjectsAtArrangedObjectIndexPaths: (NSArray*)indexPaths;
- (void) removeSelectionIndexPaths: (NSArray*)indexPaths;
- (void) remove: (id)sender;
/**
* Removes object at the specified indexPath.
* This method will only function if the tree controller is in
* "object" mode.
*/
- (void) removeObjectAtArrangedObjectIndexPath: (NSIndexPath *)indexPath;
/**
* Removes objects at the specified indexPaths.
*/
- (void) removeObjectsAtArrangedObjectIndexPaths: (NSArray *)indexPaths;
/**
* Removes selection of objects at the specified indexPaths.
*/
- (void) removeSelectionIndexPaths: (NSArray *)indexPaths;
/**
* Remove the currently selected object
*/
- (void) removeObjectAtArrangedObjectIndexPath: (NSIndexPath *)indexPath;
/**
* Removes objects at the specified indexPaths.
*/
- (void) removeObjectsAtArrangedObjectIndexPaths: (NSArray *)indexPaths;
/**
* Removes selection of objects at the specified indexPaths.
*/
- (void) removeSelectionIndexPaths: (NSArray *)indexPaths;
/**
* Remove the currently selected object. This method will only
* function if the tree controller is in "object" mode.
*/
- (IBAction) remove: (id)sender;
/**
* Sets the flag to always use multiple values marker.
*/
- (void) setAlwaysUsesMultipleValuesMarker: (BOOL)flag;
/**
* Sets the flag to avoid empty selection.
*/
- (void) setAvoidsEmptySelection: (BOOL)flag;
- (void) setChildrenKeyPath: (NSString*)path;
- (void) setContent: (id)content;
- (void) setCountKeyPath: (NSString*)path;
- (void) setLeafPathKey: (NSString*)key;
/**
* Sets the children key path. This needs to be key-value compliant.
*/
- (void) setChildrenKeyPath: (NSString *)path;
/**
* Sets the count key path. This needs to be key-value compliant.
* Setting this key path will disable add:, addChild:, remove:,
* removeChild:, and insert: methods. If this is not specified,
* the tree controller is in "object" mode.
*/
- (void) setCountKeyPath: (NSString *)path;
/**
* Sets leaf key path. This value needs to be key-value compliant.
*/
- (void) setLeafKeyPath: (NSString *)key;
/**
* Sets the preserves selection flag.
*/
- (void) setPreservesSelection: (BOOL)flag;
/**
* Sets the flag that determines if objects inserted are automatically
* selected.
*/
- (void) setSelectsInsertedObjects: (BOOL)flag;
- (void) setSortDescriptors: (NSArray*)descriptors;
/**
* Sets the array of sort descriptors used when building arrangedObjects.
*/
- (void) setSortDescriptors: (NSArray *)descriptors;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
- (NSString*) childrenKeyPathForNode: (NSTreeNode*)node;
- (NSString*) countKeyPathForNode: (NSTreeNode*)node;
- (NSString*) leafKeyPathForNode: (NSTreeNode*)node;
- (void) moveNode: (NSTreeNode*)node toIndexPath: (NSIndexPath*)indexPath;
- (void) moveNodes: (NSArray*)nodes toIndexPath: (NSIndexPath*)startingIndexPath;
- (NSArray*) selectedNodes;
#endif
/**
* children key path for the given NSTreeNode.
*/
- (NSString *) childrenKeyPathForNode: (NSTreeNode *)node;
/**
* count key path for the given NSTreeNode.
*/
- (NSString *) countKeyPathForNode: (NSTreeNode *)node;
/**
* leaf key path for the given NSTreeNode.
*/
- (NSString *) leafKeyPathForNode: (NSTreeNode *)node;
/**
* Moves node to given indexPath
*/
- (void) moveNode: (NSTreeNode *)node toIndexPath: (NSIndexPath *)indexPath;
/**
* Move nodes to position at startingIndexPath
*/
- (void) moveNodes: (NSArray *)nodes toIndexPath: (NSIndexPath *)startingIndexPath;
/**
* Set the descriptors by which the content of this tree controller
* is sorted.
*/
- (void) setSortDescriptors: (NSArray *)descriptors;
/**
* Array containing all selected nodes
*/
- (NSArray *) selectedNodes;
#endif // 10_5
@end
#endif
#endif // if OS_API_VERSION...
#endif /* _GNUstep_H_NSTreeController */

View file

@ -26,6 +26,7 @@
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _GNUstep_H_NSTreeNode
#define _GNUstep_H_NSTreeNode

View file

@ -157,7 +157,7 @@ PACKAGE_SCOPE
void *_previousKeyView;
CGFloat _alphaValue;
@public
PACKAGE_SCOPE
/*
* Flags for internal use by NSView and it's subclasses.
*/
@ -176,6 +176,7 @@ PACKAGE_SCOPE
/* backing flush when drawn */
} _rFlags;
@protected
BOOL _is_rotated_from_base;
BOOL _is_rotated_or_scaled_from_base;
BOOL _post_frame_changes;
@ -199,6 +200,7 @@ PACKAGE_SCOPE
NSShadow *_shadow;
NSAppearance* _appearance;
NSUserInterfaceItemIdentifier _identifier;
}
/*

28
INSTALL
View file

@ -5,7 +5,7 @@
================
This file documents the installation of the GNUstep GUI Library,
'gnustep-gui'. If you are installing this package as part of the
gnustep-gui. If you are installing this package as part of the
GNUstep core package, read the file GNUstep-HOWTO for more complete
instructions on how to install the entire GNUstep package (including
this library). GNUstep-HOWTO is located at <http://www.gnustep.org> and
@ -17,14 +17,14 @@ GNUstep Base version 1.15.0 or greater is required.
Other external libraries that you should have installed include:
* tiff (REQUIRED)
* jpeg (RECOMMENDED)
* png (RECOMMENDED)
* gif or ungif (OPTIONAL)
* aspell (OPTIONAL)
* cups (OPTIONAL)
* audiofile (OPTIONAL)
* portaudio, v19 which has several API changes previous version
tiff (REQUIRED)
jpeg (RECOMMENDED)
png (RECOMMENDED)
gif or ungif (OPTIONAL)
aspell (OPTIONAL)
cups (OPTIONAL)
audiofile (OPTIONAL)
portaudio, v19 which has several API changes previous version
(OPTIONAL)
Read the GNUstep-HOWTO for more information. After installing this
@ -33,9 +33,9 @@ library, install gnustep-back.
1.2 Configuration
=================
Configuration is performed by running the 'configure' program at a shell
Configuration is performed by running the configure program at a shell
prompt. You may want to use some of the optional arguments to the
'configure' program. Type 'configure --help' for a list. GNUstep
configure program. Type configure --help for a list. GNUstep
specific options are at the end of this list (if any).
1.3 Compilation
@ -43,8 +43,8 @@ specific options are at the end of this list (if any).
To compile this library, type make. After this is complete, type make
install (make sure you are the root user). Some additional options you
can use with make are 'debug=yes' to make a debugging version of the
library and 'shared=no' to make a static version of the library. See
can use with make are debug=yes to make a debugging version of the
library and shared=no to make a static version of the library. See
the gstep-make package for more information on these options.
1.4 Installing
@ -57,7 +57,7 @@ To install, type
1.5 Post Installation
=====================
GNUstep gui comes with a tool called 'make_services' which builds a list
GNUstep gui comes with a tool called make_services which builds a list
of installed applications and services. This list is used to find
services for the services menu, for instance. This tool should be run
after a new service or application is installed in the system.

930
NEWS

File diff suppressed because it is too large Load diff

View file

@ -313,7 +313,8 @@ GuiAdditions_AGSDOC_FILES = $(AUTOGSDOC_HEADERS_GUIADD) \
# directory.
#
Gui_AGSDOC_FLAGS = \
-MakeFrames YES \
-MakeFrames NO \
-IndexFile Gui \
-DocumentationDirectory ../Documentation/Gui \
-HeaderDirectory ../Headers/AppKit \
-Declared AppKit \

View file

@ -304,6 +304,7 @@ NSWindowController.m \
NSWorkspace.m \
GSAnimator.m \
GSAutocompleteWindow.m \
GSControllerTreeProxy.m \
GSDisplayServer.m \
GSHelpManagerPanel.m \
GSInfoPanel.m \
@ -375,7 +376,8 @@ GSCSLinearExpression.m \
GSCSStrength.m \
GSCSEditInfo.m \
GSCSEditVariableManager.m \
GSCSTableau.m
GSCSTableau.m \
GSColorSliderCell.m
# Turn off NSMenuItem warning that NSMenuItem conforms to <NSObject>,
# but does not implement <NSObject>'s methods itself (it inherits

View file

@ -64,6 +64,7 @@
- (void) reverseSetValueFor: (NSString *)binding;
- (id) destinationValue;
- (id) sourceValueFor: (NSString *)binding;
- (id) observedObject;
/* Transforms the value with a value transformer, if specified and available,
* and takes care of any placeholders

View file

@ -42,7 +42,7 @@ typedef struct _GSCellFlags {
unsigned int disabled:1;
unsigned int editable:1;
NSCellType type:2;
unsigned int type:2;
unsigned int vCentered:1;
unsigned int hCentered:1;
@ -57,7 +57,7 @@ typedef struct _GSCellFlags {
unsigned int invalidObjectValue:1;
unsigned int invalidFont:1;
NSLineBreakMode lineBreakMode:3;
unsigned int lineBreakMode:3;
unsigned int weakTargetHelperFlag:1;
unsigned int allowsAppearanceEffects:1;
@ -84,7 +84,7 @@ typedef struct _GSCellFlags {
unsigned int singleLineMode:1;
unsigned int allowsAppearanceEffects:1;
unsigned int weakTargetHelperFlag:1;
NSLineBreakMode lineBreakMode:3;
unsigned int lineBreakMode:3;
unsigned int invalidFont:1;
unsigned int invalidObjectValue:1;
unsigned int isLeaf:1;
@ -96,7 +96,7 @@ typedef struct _GSCellFlags {
unsigned int bordered:1;
unsigned int hCentered:1;
unsigned int vCentered:1;
NSCellType type:2;
unsigned int type:2;
unsigned int editable:1;
unsigned int disabled:1;
unsigned int highlighted:1;

View file

@ -31,6 +31,7 @@
#include <AppKit/NSSliderCell.h>
APPKIT_EXPORT_CLASS
@interface GSColorSliderCell : NSSliderCell
{
int mode;

View file

@ -1,4 +1,4 @@
/* GSStandardColorPicker.m
/* GSColorSliderCell.m
Copyright (C) 2007 Free Software Foundation, Inc.

View file

@ -0,0 +1,59 @@
/* Definition of class GSControllerTreeProxy
Copyright (C) 2024 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: 24-06-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 _GSControllerTreeProxy_h_GNUSTEP_GUI_INCLUDE
#define _GSControllerTreeProxy_h_GNUSTEP_GUI_INCLUDE
#import "AppKit/NSTreeNode.h"
@class NSTreeController;
#if defined(__cplusplus)
extern "C" {
#endif
@interface GSControllerTreeProxy : NSTreeNode
{
NSTreeController *_controller;
}
- (instancetype) initWithContent: (id)content
withController: (id)controller;
- (NSUInteger) count;
- (NSMutableArray *) children;
- (id) value;
- (void) setValue: (id)value;
@end
#if defined(__cplusplus)
}
#endif
#endif /* _GSControllerTreeProxy_h_GNUSTEP_GUI_INCLUDE */

View file

@ -0,0 +1,90 @@
/* Implementation of class GSControllerTreeProxy
Copyright (C) 2024 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: 24-06-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 <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSString.h>
#import "AppKit/NSTreeController.h"
#import "GSControllerTreeProxy.h"
#import "GSBindingHelpers.h"
@implementation GSControllerTreeProxy
- (instancetype) initWithContent: (id)content
withController: (id)controller
{
NSMutableDictionary *dict =
[NSMutableDictionary dictionaryWithObject:
[NSMutableArray arrayWithArray: content]
forKey: @"children"];
self = [super initWithRepresentedObject: dict];
if (self != nil)
{
ASSIGN(_controller, controller);
}
return self;
}
- (NSUInteger) count
{
NSArray *children = [[self representedObject] objectForKey: @"children"];
return [children count];
}
// This is here so that when the path is specified as "children" it responds
- (NSMutableArray *) children
{
NSDictionary *ro = [self representedObject];
NSMutableArray *children = [ro objectForKey: @"children"];
return children;
}
- (id) value
{
return [_representedObject objectForKey: @"value"];
}
- (void) setValue: (id)value
{
[_representedObject setObject: value
forKey: @"value"];
}
// These return the value in the cases where the parent class method is called...
- (NSArray *) childNodes
{
return [self children];
}
- (NSMutableArray *) mutableChildNodes
{
return [self children];
}
@end

View file

@ -32,6 +32,7 @@
#import <Foundation/NSBundle.h>
#import <Foundation/NSCoder.h>
#import "AppKit/AppKitDefines.h"
#include "GNUstepBase/GSConfig.h"
#include <math.h>
@ -40,7 +41,7 @@
* Should be only used inside the gnustep-gui library. Implemented
* in Source/NSApplication.m
*/
NSBundle *GSGuiBundle (void);
APPKIT_EXPORT NSBundle *GSGuiBundle (void);
/*
* Localize a message of the gnustep-gui library.

View file

@ -191,7 +191,9 @@ static GSMemoryPanel *sharedGSMemoryPanel = nil;
NSButton *button;
/* Activate debugging of allocation. */
#ifndef NDEBUG
GSDebugAllocationActive (YES);
#endif
hbox = [GSHbox new];
[hbox setDefaultMinXMargin: 5];
@ -359,6 +361,7 @@ static GSMemoryPanel *sharedGSMemoryPanel = nil;
- (void) update: (id)sender
{
#ifndef NDEBUG
Class *classList = GSDebugAllocationClassList ();
Class *pointer;
GSMemoryPanelEntry *entry;
@ -388,6 +391,7 @@ static GSMemoryPanel *sharedGSMemoryPanel = nil;
NSZoneFree(NSDefaultMallocZone(), classList);
[array sortUsingSelector: orderingBy];
#endif
[table reloadData];
}

View file

@ -864,7 +864,8 @@ static NSString *disabledName = @".GNUstepDisabled";
attr = [mgr fileAttributesAtPath: _disabledPath
traverseLink: YES];
mod = [attr objectForKey: NSFileModificationDate];
if (_disabledStamp == nil || [_disabledStamp laterDate: mod] == mod)
if (_disabledStamp == nil
|| [_disabledStamp laterDate: mod] != _disabledStamp)
{
NSData *data;
id plist = nil;
@ -895,7 +896,8 @@ static NSString *disabledName = @".GNUstepDisabled";
attr = [mgr fileAttributesAtPath: _servicesPath
traverseLink: YES];
mod = [attr objectForKey: NSFileModificationDate];
if (_servicesStamp == nil || [_servicesStamp laterDate: mod] == mod)
if (_servicesStamp == nil
|| [_servicesStamp laterDate: mod] != _servicesStamp)
{
NSData *data;
id plist = nil;

View file

@ -942,8 +942,8 @@ typedef struct {
mth = [[GSThemeMethod new] autorelease];
types = method_getTypeEncoding(method);
mth->imp = method_getImplementation(method);
memcpy(buf, name + 9, (ptr - name) + 9);
buf[(ptr - name) + 9] = '\0';
memcpy(buf, name + 9, (ptr - name) - 9);
buf[(ptr - name) - 9] = '\0';
mth->cls = objc_lookUpClass(buf);
if (mth->cls == 0)
{

View file

@ -44,6 +44,7 @@
#import "AppKit/NSGraphics.h"
#import "AppKit/NSImage.h"
#import "AppKit/NSImageView.h"
#import "AppKit/NSKeyValueBinding.h"
#import "AppKit/NSMenuView.h"
#import "AppKit/NSMenuItemCell.h"
#import "AppKit/NSOutlineView.h"
@ -70,6 +71,7 @@
#import "GNUstepGUI/GSToolbarView.h"
#import "GNUstepGUI/GSTitleView.h"
#import "GSBindingHelpers.h"
/* a border width of 5 gives a reasonable compromise between Cocoa metrics and looking good */
/* 7.0 gives us the NeXT Look (which is 8 pix wide including the shadow) */
@ -3284,7 +3286,7 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
{
endingRow = numberOfRows - 1;
}
// NSLog(@"drawRect : %d-%d", startingRow, endingRow);
// NSLog(@"drawRect : %ld-%ld", startingRow, endingRow);
{
SEL sel = @selector(drawRow:clipRect:);
void (*imp)(id, SEL, NSInteger, NSRect);
@ -3317,9 +3319,9 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
if (selectionColor == nil)
{
selectionColor = [NSColor colorWithCalibratedRed: 0.86
green: 0.92
blue: 0.99
selectionColor = [NSColor colorWithCalibratedRed: 1.0
green: 1.0
blue: 1.0
alpha: 1.0];
}
[selectionColor set];
@ -3408,6 +3410,7 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
{
const BOOL columnSelected = [tableView isColumnSelected: i];
const BOOL cellSelected = (rowSelected || columnSelected);
tb = [tableColumns objectAtIndex: i];
cell = [tb dataCellForRow: rowIndex];
[tableView _willDisplayCell: cell
@ -3529,14 +3532,8 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
NSInteger endingColumn;
NSRect drawingRect;
NSInteger i;
id dataSource = [outlineView dataSource];
NSTableColumn *outlineTableColumn = [outlineView outlineTableColumn];
if (dataSource == nil)
{
return;
}
/* Using columnAtPoint: here would make it called twice per row per drawn
rect - so we avoid it and do it natively */
@ -3566,9 +3563,9 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
}
else
{
[cell setObjectValue: [dataSource outlineView: outlineView
objectValueForTableColumn: tb
byItem: item]];
id value = [outlineView _objectValueForTableColumn: tb
row: rowIndex];
[cell setObjectValue: value];
}
drawingRect = [outlineView frameOfCellAtColumn: i

View file

@ -418,5 +418,11 @@
[[menu menuRepresentation] update];
[menu sizeToFit];
}
- (BOOL) proposedVisibility: (BOOL)visible
forMenu: (NSMenu *) menu
{
return visible;
}
@end

View file

@ -335,6 +335,9 @@ static NSArray *XmlBoolDefaultYes = nil;
@"shadow", @"NSViewShadow",
@"blurRadius", @"NSShadowBlurRadius",
@"color", @"NSShadowColor",
@"childrenKeyPath", @"NSTreeContentChildrenKey", // NSTreeController
@"countKeyPath", @"NSTreeContentCountKey",
@"leafKeyPath", @"NSTreeContentLeafKey",
nil];
RETAIN(XmlKeyMapTable);

View file

@ -1677,7 +1677,7 @@ static BOOL _isAutolaunchChecked = NO;
[theWindow center];
[theWindow setLevel: NSModalPanelWindowLevel];
}
[theWindow orderFrontRegardless];
if ([self isActive] == YES)
{
if ([theWindow canBecomeKeyWindow] == YES)
@ -1689,6 +1689,7 @@ static BOOL _isAutolaunchChecked = NO;
[theWindow makeMainWindow];
}
}
[theWindow orderFrontRegardless];
return theSession;
}
@ -2495,6 +2496,7 @@ image.</p><p>See Also: -applicationIconImage</p>
NSDictionary *info;
NSWindow *win;
NSEnumerator *iter;
id<NSMenuItem> menuItem;
[nc postNotificationName: NSApplicationWillHideNotification
object: self];
@ -2542,7 +2544,16 @@ image.</p><p>See Also: -applicationIconImage</p>
[_hidden addObject: win];
[win orderOut: self];
}
}
}
menuItem = [sender isKindOfClass:[NSMenuItem class]]
? sender
: [_main_menu itemWithTitle:_(@"Hide")];
if (menuItem)
{
[menuItem setAction:@selector(unhide:)];
[menuItem setTitle:_(@"Show")];
}
_app_is_hidden = YES;
if (YES == [[NSUserDefaults standardUserDefaults]
@ -2605,6 +2616,14 @@ image.</p><p>See Also: -applicationIconImage</p>
*/
- (void) unhide: (id)sender
{
id<NSMenuItem> menuItem = [sender isKindOfClass:[NSMenuItem class]]
? sender
: [_main_menu itemWithTitle:_(@"Show")];
if (menuItem)
{
[menuItem setAction:@selector(hide:)];
[menuItem setTitle:_(@"Hide")];
}
if (_app_is_hidden)
{
[self unhideWithoutActivation];

View file

@ -147,6 +147,7 @@
if (self == [NSArrayController class])
{
[self exposeBinding: NSContentArrayBinding];
[self exposeBinding: NSSelectionIndexesBinding];
[self setKeys: [NSArray arrayWithObjects: NSContentBinding, NSContentObjectBinding, nil]
triggerChangeNotificationsForDependentKey: @"arrangedObjects"];
}

View file

@ -287,14 +287,21 @@ static CGFloat default_miter_limit = 10.0;
- (void) dealloc
{
GSIArrayEmpty(_pathElements);
NSZoneFree([self zone], _pathElements);
if (_pathElements)
{
GSIArrayEmpty(_pathElements);
NSZoneFree([self zone], _pathElements);
}
if (_cacheImage != nil)
RELEASE(_cacheImage);
if (_cacheImage)
{
RELEASE(_cacheImage);
}
if (_dash_pattern != NULL)
NSZoneFree([self zone], _dash_pattern);
if (_dash_pattern)
{
NSZoneFree([self zone], _dash_pattern);
}
[super dealloc];
}
@ -2066,22 +2073,36 @@ static int winding_curve(double_point from, double_point to, double_point c1,
//
// NSCopying Protocol
//
- (id)copyWithZone:(NSZone *)zone
- (id) copyWithZone: (NSZone *)zone
{
NSBezierPath *path = (NSBezierPath*)NSCopyObject (self, 0, zone);
NSBezierPath *path = (NSBezierPath*)NSCopyObject(self, 0, zone);
/* Get the zone actually usd by the copy so we can use it consistently.
*/
zone = [path zone];
if (_cachesBezierPath && _cacheImage)
path->_cacheImage = [_cacheImage copy];
{
// FIXME ... should this retain rather than copy?
path->_cacheImage = [_cacheImage copyWithZone: zone];
}
else
{
path->_cacheImage = nil;
}
if (_dash_pattern != NULL)
if (_dash_pattern)
{
CGFloat *pattern = NSZoneMalloc(zone, _dash_count * sizeof(CGFloat));
memcpy(pattern, _dash_pattern, _dash_count * sizeof(CGFloat));
_dash_pattern = pattern;
path->_dash_pattern = pattern;
}
path->_pathElements = GSIArrayCopyWithZone(_pathElements, zone);
if (_pathElements)
{
path->_pathElements = GSIArrayCopyWithZone(_pathElements, zone);
}
return path;
}

View file

@ -3,7 +3,7 @@
<abstract>Simple box view that can display a border and title
</abstract>
Copyright (C) 1996-2015 Free Software Foundation, Inc.
Copyright (C) 1996-2024 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: 1996
@ -41,6 +41,7 @@
#import "AppKit/NSTextFieldCell.h"
#import "AppKit/NSWindow.h"
#import "GNUstepGUI/GSTheme.h"
#import "GSGuiPrivate.h"
#include <math.h>
@ -637,10 +638,12 @@
}
else
{
NSInteger tempInt;
[aDecoder decodeValueOfObjCType: @encode(id) at: &_cell];
_offsets = [aDecoder decodeSize];
[aDecoder decodeValueOfObjCType: @encode(int)
at: &_border_type];
decode_NSInteger(aDecoder, &tempInt);
_border_type = tempInt;
[aDecoder decodeValueOfObjCType: @encode(int)
at: &_title_position];

File diff suppressed because it is too large Load diff

View file

@ -165,8 +165,30 @@
if (owner != nil && aNibName != nil)
{
NSDictionary *table = [NSDictionary dictionaryWithObject: owner forKey: NSNibOwner];
NSDictionary *table = nil;
NSMutableArray *tlo = nil;
// Based on the arguments above, set up the table appropriately...
if (owner != nil)
{
if (topLevelObjects != NULL)
{
// Here we initialize the array, it is sent in using the dictionary.
// In the code below it is pulled back out and assigned to the
// reference in the arguments.
tlo = [NSMutableArray array];
table = [NSDictionary dictionaryWithObjectsAndKeys:
owner, NSNibOwner,
tlo, NSNibTopLevelObjects,
nil];
}
else
{
table = [NSDictionary dictionaryWithObject: owner forKey: NSNibOwner];
}
}
// Attempt to load the model file...
success = [self loadNibFile: aNibName
externalNameTable: table
withZone: [owner zone]];

View file

@ -1752,7 +1752,19 @@
}
if ([aDecoder containsValueForKey: @"NSAlternateContents"])
{
[self setAlternateTitle: [aDecoder decodeObjectForKey: @"NSAlternateContents"]];
id alternateContents = [aDecoder decodeObjectForKey: @"NSAlternateContents"];
if ([alternateContents isKindOfClass:[NSString class]])
{
[self setAlternateTitle:alternateContents];
}
else if ([alternateContents isKindOfClass:[NSImage class]])
{
[self setAlternateImage:alternateContents];
}
else
{
NSLog(@"Invalid class for NSAlternateContents: %@", [alternateContents class]);
}
}
if ([aDecoder containsValueForKey: @"NSButtonFlags"])
{

View file

@ -565,9 +565,24 @@ static inline NSRect integralRect (NSRect rect, NSView *view)
- (void) setFrame: (NSRect)rect
{
BOOL changedOrigin = NO;
BOOL changedSize = NO;
if (NSEqualPoints(_frame.origin, rect.origin) == NO)
{
changedOrigin = YES;
}
if (NSEqualSizes(_frame.size, rect.size) == NO)
{
changedSize = YES;
}
[super setFrame: rect];
[self setBoundsOrigin: [self constrainScrollPoint: _bounds.origin]];
[_super_view reflectScrolledClipView: self];
if (changedOrigin || changedSize)
{
NSPoint proposedPoint = [self constrainScrollPoint: _bounds.origin];
[self setBoundsOrigin: proposedPoint];
[_super_view reflectScrolledClipView: self];
}
}
- (void) translateOriginToPoint: (NSPoint)aPoint

View file

@ -688,7 +688,7 @@ static NSString *_placeholderItem = nil;
NSRect itemFrame = NSMakeRect (0,0,0,0);
NSInteger index;
NSUInteger count = [_items count];
CGFloat x = _horizontalMargin;
CGFloat x = 0;
CGFloat y = -_itemSize.height;
if (_maxNumberOfColumns > 0 && _maxNumberOfRows > 0)
@ -700,7 +700,7 @@ static NSString *_placeholderItem = nil;
{
if (index % _numberOfColumns == 0)
{
x = _horizontalMargin;
x = 0;
y += _verticalMargin + _itemSize.height;
}
@ -731,6 +731,9 @@ static NSString *_placeholderItem = nil;
x += _itemSize.width + _horizontalMargin;
}
if(_maxNumberOfColumns == 1) {
itemFrame.size.width = self.frame.size.width;
}
return itemFrame;
}

View file

@ -1775,23 +1775,39 @@ static inline NSRect buttonCellFrameFromRect(NSRect cellRect)
}
else
{
id object = nil;
if (_dataSource == nil)
{
NSLog(@"%@: No data source currently specified", self);
return nil;
}
else if ([_dataSource respondsToSelector:
@selector(comboBox:objectValueForItemAtIndex:)])
NSLog(@"%@: No data source currently specified", self);
}
else if ([_dataSource respondsToSelector:
@selector(comboBox:objectValueForItemAtIndex:)])
{
return [[_dataSource comboBox: (NSComboBox *)[self controlView]
objectValueForItemAtIndex: index] description];
}
else if ([_dataSource respondsToSelector:
@selector(comboBoxCell:objectValueForItemAtIndex:)])
object = [_dataSource comboBox: (NSComboBox *)[self controlView]
objectValueForItemAtIndex: index];
}
else if ([_dataSource respondsToSelector:
@selector(comboBoxCell:objectValueForItemAtIndex:)])
{
return [[_dataSource comboBoxCell: self
objectValueForItemAtIndex: index] description];
}
object = [_dataSource comboBoxCell: self objectValueForItemAtIndex: index];
}
if (object)
{
// Check for attributed string type and return actual string instead..
if ([object isKindOfClass: [NSAttributedString class]])
{
object = [object string];
}
else
{
object = [object description];
}
// Return the request object...
return object;
}
}
return nil;

View file

@ -122,6 +122,7 @@ static NSNotificationCenter *nc;
- (void) dealloc
{
[GSKeyValueBinding unbindAllForObject: self];
RELEASE(_cell);
[super dealloc];
}

View file

@ -84,6 +84,107 @@ static float sizes[] = {4.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0,
}
@end
@interface FPBrowser : NSBrowser
@end
@implementation FPBrowser
static void
autoresize(CGFloat oldContainerSize, CGFloat newContainerSize,
CGFloat *contentPositionInOut, CGFloat *contentSizeInOut,
BOOL minMarginFlexible, BOOL sizeFlexible, BOOL maxMarginFlexible)
{
const CGFloat change = newContainerSize - oldContainerSize;
if (change == 0.0)
return;
// Size
if (sizeFlexible)
{
if (maxMarginFlexible || minMarginFlexible)
{
*contentSizeInOut += change / 2;
}
else
{
*contentSizeInOut += change;
}
}
// Position
if (minMarginFlexible)
{
if (maxMarginFlexible || sizeFlexible)
{
*contentPositionInOut += change / 2;
}
else
{
*contentPositionInOut += change;
}
}
}
- (void) resizeWithOldSuperviewSize: (NSSize)oldSize
{
NSSize superViewFrameSize;
NSRect newFrame = _frame;
NSRect newFrameRounded;
if (_autoresizingMask == NSViewNotSizable)
return;
if (!NSEqualRects(NSZeroRect, _autoresizingFrameError))
{
newFrame.origin.x -= _autoresizingFrameError.origin.x;
newFrame.origin.y -= _autoresizingFrameError.origin.y;
newFrame.size.width -= _autoresizingFrameError.size.width;
newFrame.size.height -= _autoresizingFrameError.size.height;
}
superViewFrameSize = NSMakeSize(0,0);
if (_super_view)
superViewFrameSize = [_super_view frame].size;
autoresize(oldSize.width, superViewFrameSize.width, &newFrame.origin.x,
&newFrame.size.width, (_autoresizingMask & NSViewMinXMargin),
(_autoresizingMask & NSViewWidthSizable),
(_autoresizingMask & NSViewMaxXMargin));
{
const BOOL flipped = (_super_view && [_super_view isFlipped]);
const BOOL maxMarginFlexible = flipped
? (_autoresizingMask & NSViewMinYMargin)
: (_autoresizingMask & NSViewMaxYMargin);
const BOOL minMarginFlexible = flipped
? (_autoresizingMask & NSViewMaxYMargin)
: (_autoresizingMask & NSViewMinYMargin);
autoresize(oldSize.height, superViewFrameSize.height, &newFrame.origin.y,
&newFrame.size.height, minMarginFlexible,
(_autoresizingMask & NSViewHeightSizable), maxMarginFlexible);
}
newFrameRounded = newFrame;
/**
* Perform rounding to pixel-align the frame if we are not rotated
*/
if (![self isRotatedFromBase] && [self superview] != nil)
{
newFrameRounded = [[self superview] centerScanRect: newFrameRounded];
}
[self setFrame: newFrameRounded];
_autoresizingFrameError.origin.x = (newFrameRounded.origin.x - newFrame.origin.x);
_autoresizingFrameError.origin.y = (newFrameRounded.origin.y - newFrame.origin.y);
_autoresizingFrameError.size.width = (newFrameRounded.size.width - newFrame.size.width);
_autoresizingFrameError.size.height = (newFrameRounded.size.height - newFrame.size.height);
}
@end
@interface NSFontPanel (Private)
- (NSFont*) _fontForSelection: (NSFont*) fontObject;
@ -587,7 +688,7 @@ static float sizes[] = {4.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0,
// Selection of the font family
// We use a browser with one column to get a selection list
familyBrowser = [[NSBrowser alloc] initWithFrame: familyBrowserRect];
familyBrowser = [[FPBrowser alloc] initWithFrame: familyBrowserRect];
[familyBrowser setDelegate: self];
[familyBrowser setMaxVisibleColumns: 1];
[familyBrowser setMinColumnWidth: 0];
@ -608,7 +709,7 @@ static float sizes[] = {4.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0,
// selection of type face
// We use a browser with one column to get a selection list
faceBrowser = [[NSBrowser alloc] initWithFrame: typefaceBrowserRect];
faceBrowser = [[FPBrowser alloc] initWithFrame: typefaceBrowserRect];
[faceBrowser setDelegate: self];
[faceBrowser setMaxVisibleColumns: 1];
[faceBrowser setMinColumnWidth: 0];
@ -654,7 +755,7 @@ static float sizes[] = {4.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0,
[bottomSplit addSubview: sizeField];
RELEASE(sizeField);
sizeBrowser = [[NSBrowser alloc] initWithFrame: sizeBrowserRect];
sizeBrowser = [[FPBrowser alloc] initWithFrame: sizeBrowserRect];
[sizeBrowser setDelegate: self];
[sizeBrowser setMaxVisibleColumns: 1];
[sizeBrowser setAllowsMultipleSelection: NO];
@ -686,7 +787,7 @@ static float sizes[] = {4.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0,
slash = [[NSBox alloc] initWithFrame: slashRect];
[slash setBorderType: NSGrooveBorder];
[slash setTitlePosition: NSNoTitle];
[slash setTitlePosition:NSNoTitle];
[slash setAutoresizingMask: NSViewWidthSizable];
[bottomArea addSubview: slash];
RELEASE(slash);

View file

@ -210,6 +210,10 @@ implement, so we can't do that. */
Class rep;
NSData* data;
// Not worth trying to load an empty file
if (nil == filename)
return nil;
// Is the file extension already the file type?
ext = [filename pathExtension];
if (!ext)

View file

@ -192,8 +192,11 @@ void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey,
if (!objectTable)
return nil;
NSDebugLLog(@"NSBinding", @"+++ called with %@, %@", binding, anObject);
[bindingLock lock];
bindings = (NSMutableDictionary *)NSMapGet(objectTable, (void *)anObject);
NSDebugLLog(@"NSBinding", @"+++ Bindings found for %@ => %@", anObject, bindings);
if (bindings != nil)
{
theBinding = (GSKeyValueBinding*)[bindings objectForKey: binding];
@ -321,6 +324,11 @@ void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey,
[super dealloc];
}
- (id) observedObject
{
return [info objectForKey: NSObservedObjectKey];
}
- (id) destinationValue
{
id newValue;

View file

@ -383,7 +383,8 @@ static BOOL menuBarVisible = YES;
- (BOOL) _isVisible
{
return [_aWindow isVisible] || [_bWindow isVisible];
BOOL isVisible = [_aWindow isVisible] || [_bWindow isVisible];
return [[GSTheme theme] proposedVisibility: isVisible forMenu: self];
}
- (BOOL) _isMain

View file

@ -1832,6 +1832,11 @@ static float menuBarHeight = 0.0;
inMode: NSEventTrackingRunLoopMode
dequeue: YES];
type = [event type];
if (type == NSLeftMouseUp || type == NSRightMouseUp || type == NSOtherMouseUp)
{
shouldFinish = YES;
break; // Exit the loop to proceed to StopPeriodicEvents
}
if (type == NSAppKitDefined)
{
[[event window] sendEvent: event];

View file

@ -209,7 +209,7 @@
// add the necessary things to the table...
[externalNameTable setObject: owner forKey: NSNibOwner];
if (topLevelObjects != 0)
if (topLevelObjects != NULL)
{
*topLevelObjects = [NSMutableArray array];
[externalNameTable setObject: *topLevelObjects

View file

@ -99,6 +99,8 @@
{
if (self == [NSObjectController class])
{
[self setVersion: 1];
[self exposeBinding: NSContentObjectBinding];
[self setKeys: [NSArray arrayWithObject: @"editable"]
triggerChangeNotificationsForDependentKey: @"canAdd"];
@ -155,11 +157,13 @@
[coder encodeValueOfObjCType: @encode(BOOL) at: &_is_editable];
[coder encodeValueOfObjCType: @encode(BOOL) at: &_automatically_prepares_content];
[coder encodeConditionalObject: _managed_proxy];
[coder encodeObject: NSStringFromClass([self objectClass])];
}
}
- (id) initWithCoder: (NSCoder *)coder
{
{
int version = [coder versionForClassName: @"NSObjectController"];
if ((self = [super initWithCoder: coder]) != nil)
{
if ([self automaticallyPreparesContent])
@ -190,6 +194,11 @@
[coder decodeValueOfObjCType: @encode(BOOL) at: &_is_editable];
[coder decodeValueOfObjCType: @encode(BOOL) at: &_automatically_prepares_content];
ASSIGN(_managed_proxy, [coder decodeObject]);
if (version > 0)
{
NSString *className = [coder decodeObject];
[self setObjectClass: NSClassFromString(className)];
}
}
}

View file

@ -54,16 +54,22 @@
#import "AppKit/NSEvent.h"
#import "AppKit/NSGraphics.h"
#import "AppKit/NSImage.h"
#import "AppKit/NSKeyValueBinding.h"
#import "AppKit/NSOutlineView.h"
#import "AppKit/NSScroller.h"
#import "AppKit/NSTableColumn.h"
#import "AppKit/NSTableHeaderView.h"
#import "AppKit/NSText.h"
#import "AppKit/NSTextFieldCell.h"
#import "AppKit/NSTreeController.h"
#import "AppKit/NSTreeNode.h"
#import "AppKit/NSWindow.h"
#import "GNUstepGUI/GSTheme.h"
#import "GSBindingHelpers.h"
#import "GSFastEnumeration.h"
#import "GSGuiPrivate.h"
#include <math.h>
static NSMapTableKeyCallBacks keyCallBacks;
@ -143,6 +149,24 @@ static NSImage *unexpandable = nil;
clipRect: (NSRect)clipRect;
@end
@interface NSTableColumn (Private)
- (void) _applyBindingsToCell: (NSCell *)cell
atRow: (NSInteger)index;
- (NSString *) _keyPathForValueBinding;
@end
@interface NSTreeNode (Private_NSOutlineView)
- (void) _setParentNode: (NSTreeNode*)parentNode;
@end
@implementation NSTreeNode (Private_NSOutlineView)
- (void) _setParentNode: (NSTreeNode*)parentNode
{
_parentNode = parentNode;
}
@end
@implementation NSOutlineView
// Initialize the class when it is loaded
@ -170,6 +194,12 @@ static NSImage *unexpandable = nil;
unexpandable = [[NSImage alloc] initWithSize: [expanded size]];
#endif
autoExpanded = [NSMutableSet new];
// Bindings..
[self exposeBinding: NSContentBinding];
[self exposeBinding: NSContentArrayBinding];
[self exposeBinding: NSSelectionIndexesBinding];
[self exposeBinding: NSSortDescriptorsBinding];
}
}
@ -440,11 +470,57 @@ static NSImage *unexpandable = nil;
*/
- (BOOL) isExpandable: (id)item
{
if (item == nil)
BOOL result = NO;
GSKeyValueBinding *theBinding = [GSKeyValueBinding getBinding: NSContentBinding
forObject: self];
if (theBinding != nil)
{
return NO;
BOOL leaf = YES;
id observedObject = [theBinding observedObject];
NSTreeController *tc = (NSTreeController *)observedObject;
NSString *leafKeyPath = [tc leafKeyPathForNode: item];
if (leafKeyPath == nil)
{
NSString *countKeyPath = [tc countKeyPathForNode: item];
if (countKeyPath == nil)
{
NSString *childrenKeyPath = [tc childrenKeyPathForNode: item];
if (childrenKeyPath == nil)
{
result = NO;
}
else
{
id children = [item valueForKeyPath: childrenKeyPath];
leaf = ([children count] > 0);
}
}
else
{
NSNumber *countValue = [item valueForKeyPath: countKeyPath];
leaf = ([countValue integerValue] > 0);
}
}
else
{
NSNumber *leafValue = [item valueForKeyPath: leafKeyPath];
leaf = [leafValue boolValue];
}
result = !leaf; // if item is a leaf, it's not expandable...
}
return [_dataSource outlineView: self isItemExpandable: item];
else if (item != nil)
{
result = [_dataSource outlineView: self isItemExpandable: item];
}
return result;
}
/**
@ -700,21 +776,34 @@ static NSImage *unexpandable = nil;
*/
- (void) setDataSource: (id)anObject
{
GSKeyValueBinding *theBinding;
#define CHECK_REQUIRED_METHOD(selector_name) \
if (anObject && ![anObject respondsToSelector: @selector(selector_name)]) \
[NSException raise: NSInternalInconsistencyException \
format: @"data source does not respond to %@", @#selector_name]
CHECK_REQUIRED_METHOD(outlineView:child:ofItem:);
CHECK_REQUIRED_METHOD(outlineView:isItemExpandable:);
CHECK_REQUIRED_METHOD(outlineView:numberOfChildrenOfItem:);
theBinding = [GSKeyValueBinding getBinding: NSContentBinding
forObject: self];
if (theBinding == nil)
{
CHECK_REQUIRED_METHOD(outlineView:child:ofItem:);
CHECK_REQUIRED_METHOD(outlineView:isItemExpandable:);
CHECK_REQUIRED_METHOD(outlineView:numberOfChildrenOfItem:);
// This method is @optional in NSOutlineViewDataSource as of macOS10.0
// CHECK_REQUIRED_METHOD(outlineView:objectValueForTableColumn:byItem:);
// This method is @optional in NSOutlineViewDataSource as of macOS10.0
// CHECK_REQUIRED_METHOD(outlineView:objectValueForTableColumn:byItem:);
// Is the data source editable?
_dataSource_editable = [anObject respondsToSelector:
@selector(outlineView:setObjectValue:forTableColumn:byItem:)];
// Is the data source editable?
_dataSource_editable = [anObject respondsToSelector:
@selector(outlineView:setObjectValue:forTableColumn:byItem:)];
}
else
{
/* Based on testing on macOS, this should default to YES if there is a binding...
*/
_dataSource_editable = YES;
}
/* We do *not* retain the dataSource, it's like a delegate */
_dataSource = anObject;
@ -956,6 +1045,16 @@ static NSImage *unexpandable = nil;
*/
- (void) drawRow: (NSInteger)rowIndex clipRect: (NSRect)aRect
{
GSKeyValueBinding *theBinding = nil;
theBinding = [GSKeyValueBinding getBinding: NSContentBinding
forObject: self];
if (_dataSource == nil && theBinding == nil)
{
return;
}
if (_viewBased)
{
[self _drawCellViewRow: rowIndex
@ -1642,6 +1741,85 @@ Also returns the child index relative to this parent. */
@end /* implementation of NSOutlineView */
@implementation NSOutlineView (NotificationRequestMethods)
- (NSIndexPath *) _findIndexPathForItem: (id)item
parentItem: (id)pItem
{
id parentItem = (pItem == nil) ? (id)[NSNull null] : (id)pItem;
NSArray *children = NSMapGet(_itemDict, parentItem);
NSInteger childCount = [children count];
NSInteger index = 0;
for (index = 0; index < childCount; index++)
{
id childItem = [children objectAtIndex: index];
if (childItem == item)
{
return [NSIndexPath indexPathWithIndex: index];
}
else
{
NSIndexPath *foundPath = [self _findIndexPathForItem: item
parentItem: childItem];
if (foundPath != nil)
{
NSIndexPath *newPath = [NSIndexPath indexPathWithIndex: index];
NSUInteger length = [foundPath length];
NSUInteger indexes[length + 1];
NSUInteger i = 0;
[foundPath getIndexes: indexes];
// Iterate over existing indexes...
for (i = 0; i < length; i++)
{
newPath = [newPath indexPathByAddingIndex: indexes[i]];
}
return newPath;
}
}
}
return nil;
}
- (NSIndexPath *) _indexPathForItem: (id)item
{
return [self _findIndexPathForItem: item
parentItem: nil];
}
- (NSArray *) _indexPathsFromSelectedRows
{
NSUInteger index = [_selectedRows firstIndex];
NSMutableArray *result = [[NSMutableArray alloc] init];
// Regenerate the array...
while (index != NSNotFound)
{
id item = [_items objectAtIndex: index];
NSIndexPath *path = nil;
if ([item respondsToSelector: @selector(indexPath)])
{
path = [item indexPath];
}
else
{
path = [self _indexPathForItem: item];
}
[result addObject: path];
index = [_selectedRows indexGreaterThanIndex: index];
}
return result;
}
/*
* (NotificationRequestMethods)
*/
@ -1651,12 +1829,38 @@ Also returns the child index relative to this parent. */
NSOutlineViewSelectionIsChangingNotification
object: self];
}
- (void) _postSelectionDidChangeNotification
{
[nc postNotificationName:
NSOutlineViewSelectionDidChangeNotification
object: self];
NSTableColumn *tb = [_tableColumns objectAtIndex: 0];
GSKeyValueBinding *theBinding;
theBinding = [GSKeyValueBinding getBinding: NSValueBinding
forObject: tb];
// If there is a binding, send the indexes back
if (theBinding != nil)
{
id observedObject = [theBinding observedObject];
// Set the selection indexes on the controller...
theBinding = [GSKeyValueBinding getBinding: NSSelectionIndexPathsBinding
forObject: observedObject];
if (theBinding != nil)
{
NSArray *paths = [self _indexPathsFromSelectedRows];
if ([observedObject respondsToSelector: @selector(setSelectionIndexPaths:)])
{
[observedObject setSelectionIndexPaths: paths];
}
[theBinding reverseSetValue: paths];
}
}
[nc postNotificationName: NSOutlineViewSelectionDidChangeNotification
object: self];
}
- (void) _postColumnDidMoveNotificationWithOldIndex: (NSInteger) oldIndex
newIndex: (NSInteger) newIndex
{
@ -1766,10 +1970,13 @@ Also returns the child index relative to this parent. */
return YES;
}
- (void) _willDisplayCell: (NSCell*)cell
- (void) _willDisplayCell: (NSCell *)cell
forTableColumn: (NSTableColumn *)tb
row: (NSInteger)index
{
[tb _applyBindingsToCell: cell
atRow: index];
if (_del_responds)
{
id item = [self itemAtRow: index];
@ -1814,15 +2021,24 @@ Also returns the child index relative to this parent. */
row: (NSInteger) index
{
id result = nil;
NSString *keyPath = [tb _keyPathForValueBinding];
if ([_dataSource respondsToSelector:
@selector(outlineView:objectValueForTableColumn:byItem:)])
if (keyPath != nil)
{
id item = [self itemAtRow: index];
id theItem = [_items objectAtIndex: index];
result = [theItem valueForKeyPath: keyPath];
}
else
{
if ([_dataSource respondsToSelector:
@selector(outlineView:objectValueForTableColumn:byItem:)])
{
id item = [self itemAtRow: index];
result = [_dataSource outlineView: self
objectValueForTableColumn: tb
byItem: item];
result = [_dataSource outlineView: self
objectValueForTableColumn: tb
byItem: item];
}
}
return result;
@ -1832,15 +2048,30 @@ Also returns the child index relative to this parent. */
forTableColumn: (NSTableColumn *)tb
row: (NSInteger) index
{
if ([_dataSource respondsToSelector:
@selector(outlineView:setObjectValue:forTableColumn:byItem:)])
{
id item = [self itemAtRow: index];
NSString *keyPath = [tb _keyPathForValueBinding];
[_dataSource outlineView: self
setObjectValue: value
forTableColumn: tb
byItem: item];
// If we have content binding the data source is used only
// like a delegate
if (keyPath != nil)
{
id theItem = [_items objectAtIndex: index];
// Set the value on the keyPath.
[theItem setValue: value
forKeyPath: keyPath];
}
else
{
if ([_dataSource respondsToSelector:
@selector(outlineView:setObjectValue:forTableColumn:byItem:)])
{
id item = [self itemAtRow: index];
[_dataSource outlineView: self
setObjectValue: value
forTableColumn: tb
byItem: item];
}
}
}
@ -1953,43 +2184,132 @@ Also returns the child index relative to this parent. */
- (void) _loadDictionaryStartingWith: (id) startitem
atLevel: (NSInteger) level
{
GSKeyValueBinding *theBinding = nil;
NSInteger num = 0;
NSInteger i = 0;
id sitem = (startitem == nil) ? (id)[NSNull null] : (id)startitem;
NSMutableArray *anarray = nil;
/* Check to see if item is expandable and expanded before getting the number
* of items. For macos compatibility the topmost item (startitem==nil)
* is always considered expandable and must not be checked.
* We must load the item only if expanded, otherwise an outline view is not
* usable with a big tree structure. For example, an outline view to browse
* file system would try to traverse every file/directory on -reloadData.
*/
if ((startitem == nil
|| [_dataSource outlineView: self isItemExpandable: startitem])
&& [self isItemExpanded: startitem])
theBinding = [GSKeyValueBinding getBinding: NSContentBinding
forObject: self];
if (theBinding != nil)
{
num = [_dataSource outlineView: self
numberOfChildrenOfItem: startitem];
id observedObject = [theBinding observedObject];
NSArray *children = nil;
/* If there is a binding present, then allow it to be editable
* by default as editability of cells is determined in the
* NSTableColumn class based on the binding there for the
* editable property as defined in IB.
*/
_dataSource_editable = YES;
/* Implement logic to build the internal data structure here using
* bindings...
*/
if ([observedObject isKindOfClass: [NSTreeController class]])
{
NSTreeController *tc = (NSTreeController *)observedObject;
if (startitem == nil)
{
NSTreeNode *node = (NSTreeNode *)[theBinding destinationValue];
/* Per the documentation 10.4/5+ uses NSTreeNode as the return value for
* the contents of this tree node consists of a dictionary with a single
* key of "children". This is per the tests for this at
* https://github.com/gcasa/NSTreeController_test. Specifically it returns
* _NSControllerTreeProxy. The equivalent of that class in GNUstep is
* GSControllerTreeProxy.
*/
children = [node mutableChildNodes];
num = [children count];
}
else
{
/* Per the documentation in NSTreeController, we can determine everything
* from whether there are children present on a given node. See
* the documentation for NSTreeController for more info.
*/
if ([self isExpandable: startitem]
&& [self isItemExpanded: startitem])
{
NSString *childrenKeyPath = [tc childrenKeyPathForNode: startitem];
if (childrenKeyPath != nil)
{
NSString *countKeyPath = [tc countKeyPathForNode: startitem];
children = [sitem valueForKeyPath: childrenKeyPath];
if (countKeyPath == nil)
{
num = [children count]; // get the count directly...
}
else
{
NSNumber *countValue = [sitem valueForKeyPath: countKeyPath];
num = [countValue integerValue];
}
}
}
}
if (num > 0)
{
anarray = [NSMutableArray arrayWithCapacity: num];
NSMapInsert(_itemDict, sitem, anarray);
}
NSMapInsert(_levelOfItems, sitem, [NSNumber numberWithInteger: level]);
for (i = 0; i < num; i++)
{
id anitem = [children objectAtIndex: i];
if ([anitem respondsToSelector: @selector(_setParentNode:)])
{
[anitem _setParentNode: startitem];
}
[anarray addObject: anitem];
[self _loadDictionaryStartingWith: anitem
atLevel: level + 1];
}
}
}
if (num > 0)
else
{
anarray = [NSMutableArray array];
NSMapInsert(_itemDict, sitem, anarray);
}
/* Check to see if item is expandable and expanded before getting the number
* of items. For macos compatibility the topmost item (startitem==nil)
* is always considered expandable and must not be checked.
* We must load the item only if expanded, otherwise an outline view is not
* usable with a big tree structure. For example, an outline view to browse
* file system would try to traverse every file/directory on -reloadData.
*/
if (startitem == nil
|| ([self isExpandable: startitem]
&& [self isItemExpanded: startitem]))
{
num = [_dataSource outlineView: self
numberOfChildrenOfItem: startitem];
}
NSMapInsert(_levelOfItems, sitem, [NSNumber numberWithInteger: level]);
if (num > 0)
{
anarray = [NSMutableArray arrayWithCapacity: num];
NSMapInsert(_itemDict, sitem, anarray);
}
for (i = 0; i < num; i++)
{
id anitem = [_dataSource outlineView: self
child: i
ofItem: startitem];
NSMapInsert(_levelOfItems, sitem, [NSNumber numberWithInteger: level]);
[anarray addObject: anitem];
[self _loadDictionaryStartingWith: anitem
atLevel: level + 1];
for (i = 0; i < num; i++)
{
id anitem = [_dataSource outlineView: self
child: i
ofItem: startitem];
[anarray addObject: anitem];
[self _loadDictionaryStartingWith: anitem
atLevel: level + 1];
}
}
}
@ -2226,7 +2546,7 @@ Also returns the child index relative to this parent. */
drawingRect: drawingRect
rowIndex: row];
}
if (view == nil
&& flag == YES)
{

View file

@ -658,6 +658,11 @@ double _doubleValueForMousePoint (NSPoint point, NSRect knobRect,
}
}
- (NSInteger) integerValue
{
return (NSInteger)_value;
}
- (id) objectValue
{
return [NSNumber numberWithDouble: _value];

View file

@ -97,6 +97,10 @@
[self setVersion: 4];
[self exposeBinding: NSValueBinding];
[self exposeBinding: NSEnabledBinding];
[self exposeBinding: NSEditableBinding];
[self exposeBinding: NSFontBinding];
[self exposeBinding: NSFontNameBinding];
[self exposeBinding: NSFontSizeBinding];
}
}
@ -650,6 +654,89 @@ to YES. */
return [_headerCell stringValue];
}
- (NSString *) _keyPathForValueBinding
{
NSString *keyPath = nil;
NSDictionary *info = [GSKeyValueBinding infoForBinding: NSValueBinding
forObject: self];
if (info != nil)
{
NSString *ikp = [info objectForKey: NSObservedKeyPathKey];
NSUInteger location = [ikp rangeOfString: @"."].location;
keyPath = (location == NSNotFound ? ikp : [ikp substringFromIndex: location + 1]);
}
return keyPath;
}
- (void) _applyBindingsToCell: (NSCell *)cell
atRow: (NSInteger)index
{
GSKeyValueBinding *theBinding = nil;
NSFont *font = nil;
[cell setEditable: _is_editable];
theBinding = [GSKeyValueBinding getBinding: NSEnabledBinding
forObject: self];
if (theBinding != nil)
{
id result = nil;
BOOL flag = NO;
result = [(NSArray *)[theBinding destinationValue]
objectAtIndex: index];
flag = [result boolValue];
[cell setEnabled: flag];
}
/* Font bindings... According to Apple documentation, if the
* font binding is available, then name, size, and other
* font related bindings are ignored. Otherwise they are
* used
*/
theBinding = [GSKeyValueBinding getBinding: NSFontBinding
forObject: self];
if (theBinding != nil)
{
font = [(NSArray *)[theBinding destinationValue]
objectAtIndex: index];
}
else
{
NSString *fontName = nil;
CGFloat fontSize = 0.0;
theBinding = [GSKeyValueBinding getBinding: NSFontNameBinding
forObject: self];
if (theBinding != nil)
{
fontName = [(NSArray *)[theBinding destinationValue]
objectAtIndex: index];
}
if (fontName != nil)
{
theBinding = [GSKeyValueBinding getBinding: NSFontSizeBinding
forObject: self];
if (theBinding != nil)
{
id num = [(NSArray *)[theBinding destinationValue]
objectAtIndex: index];
fontSize = [num doubleValue];
}
font = [NSFont fontWithName: fontName
size: fontSize];
}
}
if (font != nil)
{
[cell setFont: font];
}
}
- (void) setValue: (id)anObject forKey: (NSString*)aKey
{
if ([aKey isEqual: NSValueBinding])
@ -661,6 +748,13 @@ to YES. */
{
// FIXME
}
else if ([aKey isEqual: NSEditableBinding])
{
if ([anObject isKindOfClass: [NSNumber class]])
{
_is_editable = [anObject boolValue];
}
}
else
{
[super setValue: anObject forKey: aKey];
@ -678,6 +772,10 @@ to YES. */
// FIXME
return [NSNumber numberWithBool: YES];
}
else if ([aKey isEqual: NSEditableBinding])
{
return [NSNumber numberWithBool: _is_editable];
}
else
{
return [super valueForKey: aKey];

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@
Date: 1996
Author: Nicola Pero <n.pero@mi.flashnet.it>
Date: November 1999
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
@ -23,10 +23,10 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
*/
#import "config.h"
#import <Foundation/NSNotification.h>
@ -36,17 +36,21 @@
#import "AppKit/NSEvent.h"
#import "AppKit/NSFont.h"
#import "AppKit/NSGraphics.h"
#import "AppKit/NSKeyValueBinding.h"
#import "AppKit/NSStringDrawing.h"
#import "AppKit/NSTextField.h"
#import "AppKit/NSTextFieldCell.h"
#import "AppKit/NSText.h"
#import "GSBindingHelpers.h"
@implementation NSTextFieldCell
+ (void) initialize
{
if (self == [NSTextFieldCell class])
{
[self exposeBinding: NSValueBinding];
[self setVersion: 2];
}
}
@ -87,7 +91,7 @@
}
//
// Modifying Graphic Attributes
// Modifying Graphic Attributes
//
- (void) setBackgroundColor: (NSColor *)aColor
{
@ -199,25 +203,25 @@
return textObject;
}
- (void) _drawBackgroundWithFrame: (NSRect)cellFrame
inView: (NSView*)controlView
- (void) _drawBackgroundWithFrame: (NSRect)cellFrame
inView: (NSView*)controlView
{
if (_textfieldcell_draws_background)
{
if ([self isEnabled])
{
[_background_color set];
}
{
[_background_color set];
}
else
{
[[NSColor controlBackgroundColor] set];
}
{
[[NSColor controlBackgroundColor] set];
}
NSRectFill([self drawingRectForBounds: cellFrame]);
}
}
}
- (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame
inView: (NSView*)controlView
- (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame
inView: (NSView*)controlView
{
// FIXME: Should use the bezel style if set.
[super _drawBorderAndBackgroundWithFrame: cellFrame inView: controlView];
@ -233,16 +237,16 @@
NSRect titleRect;
/* Make sure we are a text cell; titleRect might return an incorrect
rectangle otherwise. Note that the type could be different if the
user has set an image on us, which we just ignore (OS X does so as
well). */
rectangle otherwise. Note that the type could be different if the
user has set an image on us, which we just ignore (OS X does so as
well). */
_cell.type = NSTextCellType;
titleRect = [self titleRectForBounds: cellFrame];
[[self _drawAttributedString] drawInRect: titleRect];
}
}
/*
/*
Attributed string that will be displayed.
*/
- (NSAttributedString*) _drawAttributedString
@ -254,31 +258,31 @@
{
attrStr = [self placeholderAttributedString];
if ((attrStr == nil) || ([[attrStr string] length] == 0))
{
NSString *string;
NSDictionary *attributes;
NSMutableDictionary *newAttribs;
string = [self placeholderString];
if (string == nil)
{
return nil;
}
{
NSString *string;
NSDictionary *attributes;
NSMutableDictionary *newAttribs;
attributes = [self _nonAutoreleasedTypingAttributes];
newAttribs = [NSMutableDictionary
dictionaryWithDictionary: attributes];
[newAttribs setObject: [NSColor disabledControlTextColor]
forKey: NSForegroundColorAttributeName];
return AUTORELEASE([[NSAttributedString alloc]
initWithString: string
attributes: newAttribs]);
}
string = [self placeholderString];
if (string == nil)
{
return nil;
}
attributes = [self _nonAutoreleasedTypingAttributes];
newAttribs = [NSMutableDictionary
dictionaryWithDictionary: attributes];
[newAttribs setObject: [NSColor disabledControlTextColor]
forKey: NSForegroundColorAttributeName];
return AUTORELEASE([[NSAttributedString alloc]
initWithString: string
attributes: newAttribs]);
}
else
{
return attrStr;
}
{
return attrStr;
}
}
else
{
@ -286,22 +290,14 @@
}
}
- (void) _updateFieldEditor: (NSText*)textObject
{
[super _updateFieldEditor: textObject];
[textObject setDrawsBackground: _textfieldcell_draws_background];
[textObject setBackgroundColor: _background_color];
[textObject setTextColor: _text_color];
}
- (BOOL) isOpaque
{
if (_textfieldcell_draws_background == NO
|| _background_color == nil
if (_textfieldcell_draws_background == NO
|| _background_color == nil
|| [_background_color alphaComponent] < 1.0)
return NO;
else
return YES;
return YES;
}
//
@ -319,9 +315,9 @@
[aCoder encodeObject: [self textColor] forKey: @"NSTextColor"];
[aCoder encodeBool: [self drawsBackground] forKey: @"NSDrawsBackground"];
if ([self isBezeled])
{
[aCoder encodeInt: [self bezelStyle] forKey: @"NSTextBezelStyle"];
}
{
[aCoder encodeInt: [self bezelStyle] forKey: @"NSTextBezelStyle"];
}
}
else
{
@ -337,48 +333,53 @@
self = [super initWithCoder: aDecoder];
if (self == nil)
return self;
if ([aDecoder allowsKeyedCoding])
{
if ([aDecoder containsValueForKey: @"NSBackgroundColor"])
{
[self setBackgroundColor: [aDecoder decodeObjectForKey:
@"NSBackgroundColor"]];
}
{
[self setBackgroundColor: [aDecoder decodeObjectForKey:
@"NSBackgroundColor"]];
}
if ([aDecoder containsValueForKey: @"NSTextColor"])
{
[self setTextColor: [aDecoder decodeObjectForKey: @"NSTextColor"]];
}
{
[self setTextColor: [aDecoder decodeObjectForKey: @"NSTextColor"]];
}
if ([aDecoder containsValueForKey: @"NSDrawsBackground"])
{
[self setDrawsBackground: [aDecoder decodeBoolForKey:
@"NSDrawsBackground"]];
}
{
[self setDrawsBackground: [aDecoder decodeBoolForKey:
@"NSDrawsBackground"]];
}
if ([aDecoder containsValueForKey: @"NSTextBezelStyle"])
{
[self setBezelStyle: [aDecoder decodeIntForKey:
@"NSTextBezelStyle"]];
}
{
[self setBezelStyle: [aDecoder decodeIntForKey:
@"NSTextBezelStyle"]];
}
if ([aDecoder containsValueForKey: @"NSPlaceholderString"])
{
[self setPlaceholderString: [aDecoder decodeObjectForKey:
@"NSPlaceholderString"]];
}
}
else
{
BOOL tmp;
if ([aDecoder versionForClassName:@"NSTextFieldCell"] < 2)
{
/* Replace the old default _action_mask with the new default one
if it's set. There isn't really a way to modify this value
on an NSTextFieldCell encoded in a .gorm file. The old default value
causes problems with newer NSTableViews which uses this to discern
whether it should trackMouse:inRect:ofView:untilMouseUp: or not.
This also disables the action from being sent on an uneditable and
unselectable text fields.
*/
if (_action_mask == NSLeftMouseUpMask)
{
_action_mask = NSKeyUpMask | NSKeyDownMask;
}
}
{
/* Replace the old default _action_mask with the new default one
if it's set. There isn't really a way to modify this value
on an NSTextFieldCell encoded in a .gorm file. The old default value
causes problems with newer NSTableViews which uses this to discern
whether it should trackMouse:inRect:ofView:untilMouseUp: or not.
This also disables the action from being sent on an uneditable and
unselectable text fields.
*/
if (_action_mask == NSLeftMouseUpMask)
{
_action_mask = NSKeyUpMask | NSKeyDownMask;
}
}
[aDecoder decodeValueOfObjCType: @encode(id) at: &_background_color];
[aDecoder decodeValueOfObjCType: @encode(id) at: &_text_color];

View file

@ -1,13 +1,13 @@
/*
NSTreeController.h
/*
NSTreeController.m
The tree controller class.
Copyright (C) 2012 Free Software Foundation, Inc.
Copyright (C) 2012, 2024 Free Software Foundation, Inc.
Author: Gregory Casamento <greg.casamento@gmail.com>
Date: 2012
Date: 2012, 2024
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
@ -22,55 +22,77 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
/*
NSTreeController.h
The tree controller class.
Copyright (C) 2012 Free Software Foundation, Inc.
Author: Gregory Casamento <greg.casamento@gmail.com>
Date: 2012
This file is part of the GNUstep GUI 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 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; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
*/
#import <Foundation/NSArchiver.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSIndexPath.h>
#import <Foundation/NSKeyedArchiver.h>
#import <Foundation/NSKeyValueCoding.h>
#import <Foundation/NSKeyValueObserving.h>
#import <Foundation/NSNotification.h>
#import <Foundation/NSString.h>
#import <Foundation/NSSortDescriptor.h>
#import <AppKit/NSTreeController.h>
#import <AppKit/NSTreeNode.h>
#import "AppKit/NSOutlineView.h"
#import "AppKit/NSKeyValueBinding.h"
#import "AppKit/NSTreeController.h"
#import "AppKit/NSTreeNode.h"
#import "GSBindingHelpers.h"
#import "GSFastEnumeration.h"
#import "GSControllerTreeProxy.h"
@implementation NSTreeController
+ (void) initialize
{
if (self == [NSTreeController class])
{
[self exposeBinding: NSContentArrayBinding];
[self exposeBinding: NSContentBinding];
[self exposeBinding: NSSelectionIndexPathsBinding];
[self setKeys: [NSArray arrayWithObjects: NSContentBinding, NSContentObjectBinding, nil]
triggerChangeNotificationsForDependentKey: @"arrangedObjects"];
}
}
- (void) _initDefaults
{
_childrenKeyPath = nil;
_countKeyPath = nil;
_leafKeyPath = nil;
_sortDescriptors = nil;
_selection_index_paths = [[NSMutableArray alloc] init];
_canInsert = YES;
_canInsertChild = YES;
_canAddChild = YES;
[self setObjectClass: [NSMutableDictionary class]];
}
- (id) initWithContent: (id)content
{
if ((self = [super initWithContent: content]) != nil)
{
[self _initDefaults];
}
return self;
}
- (id) init
{
NSMutableArray *array = [[NSMutableArray alloc] init];
self = [self initWithContent: array];
RELEASE(array);
return self;
}
@ -80,13 +102,22 @@
RELEASE(_countKeyPath);
RELEASE(_leafKeyPath);
RELEASE(_sortDescriptors);
RELEASE(_arranged_objects);
RELEASE(_selection_index_paths);
[super dealloc];
}
- (BOOL) addSelectionIndexPaths: (NSArray*)indexPaths
- (BOOL) addSelectionIndexPaths: (NSArray *)indexPaths
{
// FIXME
return NO;
BOOL f = [self commitEditing];
if (YES == f)
{
[_selection_index_paths addObjectsFromArray: indexPaths];
}
return f;
}
- (BOOL) alwaysUsesMultipleValuesMarker
@ -99,22 +130,19 @@
return _avoidsEmptySelection;
}
- (BOOL) canAddChid
- (BOOL) canAddChild
{
// FIXME
return NO;
return _canAddChild;
}
- (BOOL) canInsert
{
// FIXME
return NO;
return _canInsert;
}
- (BOOL) canInsertChild
{
// FIXME
return NO;
return _canInsertChild;
}
- (BOOL) preservesSelection
@ -127,123 +155,248 @@
return _selectsInsertedObjects;
}
- (BOOL) setSelectionIndexPath: (NSIndexPath*)indexPath
- (BOOL) setSelectionIndexPath: (NSIndexPath *)indexPath
{
// FIXME
return NO;
BOOL f = [self commitEditing];
if (YES == f)
{
NSMutableArray *mutable_index_paths = [NSMutableArray arrayWithObject: indexPath];
ASSIGN(_selection_index_paths, mutable_index_paths);
}
return f;
}
- (BOOL) setSelectionIndexPaths: (NSArray*)indexPaths
- (BOOL) setSelectionIndexPaths: (NSArray *)indexPaths
{
// FIXME
return NO;
BOOL f = [self commitEditing];
if (YES == f)
{
NSMutableArray *mutable_index_paths = [NSMutableArray arrayWithArray: indexPaths];
ASSIGN(_selection_index_paths, mutable_index_paths);
}
return f;
}
- (id) arrangedObjects
- (NSTreeNode *) arrangedObjects
{
// FIXME
return nil;
}
- (id) content
{
// FIXME
return [super content];
}
- (NSArray*) selectedObjects
{
// FIXME
return [super selectedObjects];
}
- (NSIndexPath*) selectionIndexPath
{
// FIXME
return nil;
}
- (NSArray*) selectionIndexPaths
{
// FIXME
return nil;
}
- (NSArray*) sortDescriptors
{
return _sortDescriptors;
}
- (NSString*) childrenKeyPath
{
return _childrenKeyPath;
}
- (NSString*) countKeyPath
{
return _countKeyPath;;
}
- (NSString*) leafKeyPath
{
return _leafKeyPath;
}
- (void) addChild: (id)sender
{
// FIXME
}
- (void) add: (id)sender
{
// FIXME
[super add: sender];
}
- (void) insertChild: (id)sender
{
// FIXME
}
- (void) insertObject: (id)object atArrangedObjectIndexPath: (NSIndexPath*)indexPath
{
// FIXME
}
- (void) insertObjects: (NSArray*)objects atArrangedObjectIndexPaths: (NSArray*)indexPaths
{
// FIXME
}
- (void) insert: (id)sender
{
// FIXME
if (_arranged_objects == nil)
{
[self rearrangeObjects];
}
return _arranged_objects;
}
- (void) rearrangeObjects
{
// FIXME
[self willChangeValueForKey: @"arrangedObjects"];
DESTROY(_arranged_objects);
if ([_content isKindOfClass: [NSArray class]])
{
_arranged_objects = [[GSControllerTreeProxy alloc] initWithContent: _content
withController: self];
}
[self didChangeValueForKey: @"arrangedObjects"];
}
- (void) removeObjectAtArrangedObjectIndexPath: (NSIndexPath*)indexPath
- (id) _objectAtIndexPath: (NSIndexPath *)indexPath
{
// FIXME
NSUInteger length = [indexPath length];
NSUInteger pos = 0;
NSMutableArray *children = [_arranged_objects mutableChildNodes];
NSUInteger lastIndex = 0;
id obj = nil;
for (pos = 0; pos < length - 1; pos++)
{
NSUInteger i = [indexPath indexAtPosition: pos];
id node = [children objectAtIndex: i];
children = [node valueForKeyPath: _childrenKeyPath];
}
lastIndex = [indexPath indexAtPosition: length - 1];
obj = [children objectAtIndex: lastIndex];
return obj;
}
- (void) removeObjectsAtArrangedObjectIndexPaths: (NSArray*)indexPaths
- (NSArray *) selectedObjects
{
// FIXME
NSMutableArray *selectedObjects = [NSMutableArray array];
FOR_IN(NSIndexPath*, path, _selection_index_paths)
{
id obj = [self _objectAtIndexPath: path];
[selectedObjects addObject: obj];
}
END_FOR_IN(_selection_index_paths);
return selectedObjects;
}
- (void) removeSelectionIndexPaths: (NSArray*)indexPaths
- (NSIndexPath *) selectionIndexPath
{
// FIXME
if ([_selection_index_paths count] > 0)
{
return [_selection_index_paths objectAtIndex: 0];
}
return nil;
}
- (void) remove: (id)sender
- (NSArray *) selectionIndexPaths
{
// FIXME
[super remove: sender];
return [_selection_index_paths copy];
}
- (NSArray *) sortDescriptors
{
return [_sortDescriptors copy];
}
- (NSString *) childrenKeyPath
{
return _childrenKeyPath;
}
- (NSString *) countKeyPath
{
return _countKeyPath;
}
- (NSString *) leafKeyPath
{
return _leafKeyPath;
}
- (IBAction) add: (id)sender
{
NSIndexPath *p = [NSIndexPath indexPathWithIndex: 0];
id newObject = [self newObject];
[self insertObject: newObject atArrangedObjectIndexPath: p];
RELEASE(newObject);
}
- (IBAction) addChild: (id)sender
{
NSIndexPath *p = [self selectionIndexPath];
id newObject = [self newObject];
if (p != nil)
{
[self insertObject: newObject atArrangedObjectIndexPath: p];
RELEASE(newObject);
}
}
- (IBAction) remove: (id)sender
{
if ([self canRemove]
&& [self countKeyPath] == nil)
{
if ([_selection_index_paths count] > 0)
{
NSIndexPath *p = [self selectionIndexPath];
[self removeObjectAtArrangedObjectIndexPath: p];
}
}
}
- (IBAction) insertChild: (id)sender
{
[self addChild: sender];
}
- (void) insertObject: (id)object atArrangedObjectIndexPath: (NSIndexPath *)indexPath
{
if ([self canAddChild]
&& [self countKeyPath] == nil)
{
NSUInteger length = [indexPath length];
NSUInteger pos = 0;
NSMutableArray *children = [_arranged_objects mutableChildNodes];
for (pos = 0; pos < length - 1; pos++)
{
NSUInteger i = [indexPath indexAtPosition: pos];
id node = [children objectAtIndex: i];
children = [node valueForKeyPath: _childrenKeyPath];
}
[children addObject: object];
[self rearrangeObjects];
}
}
- (void) insertObjects: (NSArray *)objects atArrangedObjectIndexPaths: (NSArray *)indexPaths
{
if ([self canAddChild]
&& [self countKeyPath] == nil)
{
if ([objects count] != [indexPaths count])
{
return;
}
else
{
NSUInteger i = 0;
FOR_IN(id, object, objects)
{
NSIndexPath *indexPath = [indexPaths objectAtIndex: i];
[self insertObject: object atArrangedObjectIndexPath: indexPath];
i++;
}
END_FOR_IN(objects);
}
}
}
- (IBAction) insert: (id)sender
{
[self addChild: sender];
}
- (void) removeObjectAtArrangedObjectIndexPath: (NSIndexPath *)indexPath
{
NSUInteger length = [indexPath length];
NSUInteger pos = 0;
NSMutableArray *children = [_arranged_objects mutableChildNodes];
NSUInteger lastIndex = 0;
for (pos = 0; pos < length - 1; pos++)
{
NSUInteger i = [indexPath indexAtPosition: pos];
id node = [children objectAtIndex: i];
children = [node valueForKeyPath: _childrenKeyPath];
}
lastIndex = [indexPath indexAtPosition: length - 1];
[children removeObjectAtIndex: lastIndex];
[self rearrangeObjects];
}
- (void) removeObjectsAtArrangedObjectIndexPaths: (NSArray *)indexPaths
{
FOR_IN(NSIndexPath*, indexPath, indexPaths)
{
[self removeObjectAtArrangedObjectIndexPath: indexPath];
}
END_FOR_IN(indexPaths);
}
- (void) removeSelectionIndexPaths: (NSArray *)indexPaths
{
[self removeObjectsAtArrangedObjectIndexPaths: indexPaths];
}
- (void) setAlwaysUsesMultipleValuesMarker: (BOOL)flag
@ -256,23 +409,23 @@
_avoidsEmptySelection = flag;
}
- (void) setChildrenKeyPath: (NSString*)path
- (void) setChildrenKeyPath: (NSString *)path
{
ASSIGN(_childrenKeyPath, path);
}
- (void) setContent: (id)content
{
// FIXME
[super setContent: content];
[self rearrangeObjects];
}
- (void) setCountKeyPath: (NSString*)path
- (void) setCountKeyPath: (NSString *)path
{
ASSIGN(_countKeyPath, path);
}
- (void) setLeafPathKey: (NSString*)key
- (void) setLeafKeyPath: (NSString *)key
{
ASSIGN(_leafKeyPath, key);
}
@ -287,58 +440,204 @@
_selectsInsertedObjects = flag;
}
- (void) setSortDescriptors: (NSArray*)descriptors
- (void) setSortDescriptors: (NSArray *)descriptors
{
ASSIGN(_sortDescriptors, descriptors);
}
- (NSString*) childrenKeyPathForNode: (NSTreeNode*)node
- (NSString *) childrenKeyPathForNode: (NSTreeNode *)node
{
// FIXME
return nil;
return _childrenKeyPath;
}
- (NSString*) countKeyPathForNode: (NSTreeNode*)node
- (NSString *) countKeyPathForNode: (NSTreeNode *)node
{
// FIXME
return nil;
return _countKeyPath;
}
- (NSString*) leafKeyPathForNode: (NSTreeNode*)node
- (NSString *) leafKeyPathForNode: (NSTreeNode *)node
{
// FIXME
return nil;
return _leafKeyPath;
}
- (void) moveNode: (NSTreeNode*)node toIndexPath: (NSIndexPath*)indexPath
- (void) moveNode: (NSTreeNode *)node toIndexPath: (NSIndexPath *)indexPath
{
// FIXME
}
- (void) moveNodes: (NSArray*)nodes toIndexPath: (NSIndexPath*)startingIndexPath
- (void) moveNodes: (NSArray *)nodes toIndexPath: (NSIndexPath *)startingIndexPath
{
// FIXME
}
- (NSArray*) selectedNodes
- (NSArray *) selectedNodes
{
// FIXME
return nil;
return [self selectedObjects];
}
- (id) initWithCoder: (NSCoder*)coder
- (void) bind: (NSString *)binding
toObject: (id)anObject
withKeyPath: (NSString *)keyPath
options: (NSDictionary *)options
{
if ([binding isEqual: NSContentArrayBinding])
{
GSKeyValueBinding *kvb;
[self unbind: binding];
kvb = [[GSKeyValueBinding alloc] initWithBinding: @"content"
withName: binding
toObject: anObject
withKeyPath: keyPath
options: options
fromObject: self];
// The binding will be retained in the binding table
RELEASE(kvb);
}
else
{
[super bind: binding
toObject: anObject
withKeyPath: keyPath
options: options];
}
}
- (id) initWithCoder: (NSCoder *)coder
{
self = [super initWithCoder: coder];
if (self != nil)
{
[self _initDefaults]; // set up default values...
if ([coder allowsKeyedCoding])
{
// These names do not stick to convention. Usually it would be
// NS* or NSTreeController* so they must be overriden in
// GSXib5KeyedUnarchver.
if ([coder containsValueForKey: @"NSTreeContentChildrenKey"])
{
[self setChildrenKeyPath:
[coder decodeObjectForKey: @"NSTreeContentChildrenKey"]];
}
if ([coder containsValueForKey: @"NSTreeContentCountKey"])
{
[self setCountKeyPath:
[coder decodeObjectForKey: @"NSTreeContentCountKey"]];
}
if ([coder containsValueForKey: @"NSTreeContentLeafKey"])
{
[self setLeafKeyPath:
[coder decodeObjectForKey: @"NSTreeContentLeafKey"]];
}
// Since we don't inherit from NSArrayController these are decoded here
// as well.
if ([coder containsValueForKey: @"NSAvoidsEmptySelection"])
{
[self setAvoidsEmptySelection:
[coder decodeBoolForKey: @"NSAvoidsEmptySelection"]];
}
if ([coder containsValueForKey: @"NSPreservesSelection"])
{
[self setPreservesSelection:
[coder decodeBoolForKey: @"NSPreservesSelection"]];
}
if ([coder containsValueForKey: @"NSSelectsInsertedObjects"])
{
[self setSelectsInsertedObjects:
[coder decodeBoolForKey: @"NSSelectsInsertedObjects"]];
}
}
}
else
{
id obj = nil;
BOOL f = NO;
obj = [coder decodeObject];
[self setChildrenKeyPath: obj];
obj = [coder decodeObject];
[self setCountKeyPath: obj];
obj = [coder decodeObject];
[self setLeafKeyPath: obj];
[coder decodeValueOfObjCType: @encode(BOOL)
at: &f];
[self setAvoidsEmptySelection: f];
[coder decodeValueOfObjCType: @encode(BOOL)
at: &f];
[self setPreservesSelection: f];
[coder decodeValueOfObjCType: @encode(BOOL)
at: &f];
[self setSelectsInsertedObjects: f];
}
return self;
}
- (void) encodeWithCoder: (NSCoder*)coder
- (void) encodeWithCoder: (NSCoder *)coder
{
// Do nothing...
[super encodeWithCoder: coder];
if ([coder allowsKeyedCoding])
{
[coder encodeObject: _childrenKeyPath
forKey: @"NSTreeContentChildrenKey"];
[coder encodeObject: _countKeyPath
forKey: @"NSTreeContentCountKey"];
[coder encodeObject: _leafKeyPath
forKey: @"NSTreeContentLeafKey"];
[coder encodeBool: _avoidsEmptySelection
forKey: @"NSAvoidsEmptySelection"];
[coder encodeBool: _preservesSelection
forKey: @"NSPreservesSelection"];
[coder encodeBool: _selectsInsertedObjects
forKey: @"NSSelectsInsertedObjects"];
}
else
{
id obj = nil;
BOOL f = NO;
obj = [self childrenKeyPath];
[coder encodeObject: obj];
obj = [self countKeyPath];
[coder encodeObject: obj];
obj = [self leafKeyPath];
[coder encodeObject: obj];
f = [self avoidsEmptySelection];
[coder encodeValueOfObjCType: @encode(BOOL)
at: &f];
f = [self preservesSelection];
[coder encodeValueOfObjCType: @encode(BOOL)
at: &f];
f = [self selectsInsertedObjects];
[coder encodeValueOfObjCType: @encode(BOOL)
at: &f];
}
}
- (id) copyWithZone: (NSZone*)zone
- (id) copyWithZone: (NSZone *)zone
{
return [self retain];
id copy = [[NSTreeController allocWithZone: zone] initWithContent: [self content]];
if (copy != nil)
{
[copy setChildrenKeyPath: [self childrenKeyPath]];
[copy setCountKeyPath: [self countKeyPath]];
[copy setLeafKeyPath: [self leafKeyPath]];
[copy setAvoidsEmptySelection: [self avoidsEmptySelection]];
[copy setPreservesSelection: [self preservesSelection]];
[copy setSelectsInsertedObjects: [self selectsInsertedObjects]];
}
return copy;
}
@end

View file

@ -32,7 +32,7 @@
#import <Foundation/NSString.h>
#import <Foundation/NSSortDescriptor.h>
#import <AppKit/NSTreeNode.h>
#import "AppKit/NSTreeNode.h"
@interface NSTreeNode (Private)
- (NSMutableArray*) _childNodes;
@ -159,7 +159,7 @@
NSIndexPath *path;
NSUInteger index;
index = [_parentNode->_childNodes indexOfObject: self];
index = [[_parentNode childNodes] indexOfObject: self];
path = [_parentNode indexPath];
if (path != nil)
{
@ -248,4 +248,10 @@
}
}
- (NSString *) description
{
return [NSString stringWithFormat: @"<%@> _representedObject = %@, _childNode = %@, _parentNode = %@",
[super description], _representedObject, _childNodes, _parentNode];
}
@end

View file

@ -2109,10 +2109,7 @@ titleWithRepresentedFilename(NSString *representedFilename)
- (BOOL) showsResizeIndicator
{
// TODO
NSLog(@"Method %s is not implemented for class %s",
"showsResizeIndicator", "NSWindow");
return YES;
return ([self styleMask] & NSResizableWindowMask) ? YES : NO;
}
- (void) setShowsResizeIndicator: (BOOL)show

View file

@ -28,7 +28,7 @@
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
*/
#import "config.h"
@ -794,10 +794,10 @@ static NSDictionary *urlPreferences = nil;
}
if (sysDir != nil)
[folderPathIconDict setObject: @"GSFolder" forKey: sysDir];
[folderPathIconDict setObject: @"GSFolder" forKey: [sysDir stringByResolvingSymlinksInPath]];
[folderPathIconDict setObject: @"HomeDirectory"
forKey: NSHomeDirectory()];
forKey: [NSHomeDirectory() stringByResolvingSymlinksInPath]];
/* it would be nice to use different root icons... */
[folderPathIconDict setObject: @"Root_PC" forKey: NSOpenStepRootDirectory()];
@ -805,42 +805,42 @@ static NSDictionary *urlPreferences = nil;
for (i = 0; i < [libraryDirs count]; i++)
{
[folderPathIconDict setObject: @"LibraryFolder"
forKey: [libraryDirs objectAtIndex: i]];
forKey: [[libraryDirs objectAtIndex: i] stringByResolvingSymlinksInPath]];
}
for (i = 0; i < [appDirs count]; i++)
{
[folderPathIconDict setObject: @"ApplicationFolder"
forKey: [appDirs objectAtIndex: i]];
forKey: [[appDirs objectAtIndex: i] stringByResolvingSymlinksInPath]];
}
for (i = 0; i < [documentDir count]; i++)
{
[folderPathIconDict setObject: @"DocsFolder"
forKey: [documentDir objectAtIndex: i]];
forKey: [[documentDir objectAtIndex: i] stringByResolvingSymlinksInPath]];
}
for (i = 0; i < [downloadDir count]; i++)
{
[folderPathIconDict setObject: @"DownloadFolder"
forKey: [downloadDir objectAtIndex: i]];
forKey: [[downloadDir objectAtIndex: i] stringByResolvingSymlinksInPath]];
}
for (i = 0; i < [desktopDir count]; i++)
{
[folderPathIconDict setObject: @"Desktop"
forKey: [desktopDir objectAtIndex: i]];
forKey: [[desktopDir objectAtIndex: i] stringByResolvingSymlinksInPath]];
}
for (i = 0; i < [imgDir count]; i++)
{
[folderPathIconDict setObject: @"ImageFolder"
forKey: [imgDir objectAtIndex: i]];
forKey: [[imgDir objectAtIndex: i] stringByResolvingSymlinksInPath]];
}
for (i = 0; i < [musicDir count]; i++)
{
[folderPathIconDict setObject: @"MusicFolder"
forKey: [musicDir objectAtIndex: i]];
forKey: [[musicDir objectAtIndex: i] stringByResolvingSymlinksInPath]];
}
for (i = 0; i < [videoDir count]; i++)
{
[folderPathIconDict setObject: @"VideoFolder"
forKey: [videoDir objectAtIndex: i]];
forKey: [[videoDir objectAtIndex: i] stringByResolvingSymlinksInPath]];
}
folderIconCache = [[NSMutableDictionary alloc] init];
@ -1514,13 +1514,13 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
if ([fileType isEqual: NSFileTypeDirectory] == YES)
{
NSString *iconPath = nil;
if ([pathExtension isEqualToString: @"app"]
|| [pathExtension isEqualToString: @"debug"]
|| [pathExtension isEqualToString: @"profile"])
{
image = [self appIconForApp: fullPath];
if (image == nil)
{
/*

View file

@ -711,6 +711,7 @@ APPKIT_DECLARE NSString *NSSelectedObjectBinding = @"selectedObject";
APPKIT_DECLARE NSString *NSSelectedTagBinding = @"selectedTag";
APPKIT_DECLARE NSString *NSSelectedValueBinding = @"selectedValue";
APPKIT_DECLARE NSString *NSSelectionIndexesBinding = @"selectionIndexes";
APPKIT_DECLARE NSString *NSSelectionIndexPathsBinding = @"selectionIndexPaths";
APPKIT_DECLARE NSString *NSSortDescriptorsBinding = @"sortDescriptors";
APPKIT_DECLARE NSString *NSTextColorBinding = @"textColor";
APPKIT_DECLARE NSString *NSTitleBinding = @"title";

View file

@ -0,0 +1,45 @@
#include "Testing.h"
#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSValue.h>
#include "GSCodingFlags.h"
int main()
{
CREATE_AUTORELEASE_POOL(arp);
GSCellFlagsUnion mask = { { 0 } };
START_SET("GSCodingFlags GNUstep CellFlags Union")
// first make sure flags translate to values
mask.flags.state = 1;
mask.flags.selectable = 1;
mask.flags.scrollable = 1;
mask.flags.editable = 1;
mask.flags.continuous = 1;
mask.flags.useUserKeyEquivalent = 1;
mask.flags.truncateLastLine = 1;
pass(mask.value == 0b10010000001110000000000001001000, "mask.flags translates to mask.value");
// reset mask
mask.value = 0;
mask.flags = (GSCellFlags){0};
// now make sure values translate to flags
mask.value = 0b10010000001110000000000001001000;
pass(mask.flags.state == 1, "state is correctly set");
pass(mask.flags.selectable == 1, "selectable is correctly set");
pass(mask.flags.scrollable == 1, "scrollable is correctly set");
pass(mask.flags.editable == 1, "editable is correctly set");
pass(mask.flags.continuous == 1, "continuous is correctly set");
pass(mask.flags.useUserKeyEquivalent == 1, "useUserKeyEquivalent is correctly set");
pass(mask.flags.truncateLastLine == 1, "truncateLastLine is correctly set");
END_SET("GSCodingFlags GNUstep CellFlags Union")
DESTROY(arp);
return 0;
}

View file

View file

@ -161,7 +161,7 @@ int main(int argc, char **argv)
}
// printf("bounds=%@\n",NSStringFromRect([p bounds]));
DESTROY(p);
DESTROY(arp);
return 0;

View file

@ -700,6 +700,7 @@ int main(int argc, char **argv)
PAUSE
}
DESTROY(p);
DESTROY(arp);
return 0;

View file

@ -32,6 +32,9 @@ int main()
pass([copy1Bitmap bitmapData] != [copy2Bitmap bitmapData],
"Copied bitmaps have a different image data pointer - could cause image data corruption.");
DESTROY(copy1Bitmap);
DESTROY(copy2Bitmap);
DESTROY(origBitmap);
[arp release];
return 0;
}

View file

@ -10,7 +10,7 @@ int main()
START_SET("NSMenuItem key equivalent mask")
NSString *mask = @"NSKeyEquivModMask";
NSMenuItem *item = [[NSMenuItem alloc] init];
NSMenuItem *item = AUTORELEASE([[NSMenuItem alloc] init]);
NSMutableData *data = [NSMutableData data];
NSNumber *encodedKeyMask;
NSError *error = nil;
@ -23,7 +23,8 @@ int main()
item.keyEquivalentModifierMask = NSShiftKeyMask;
archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData: data];
archiver = AUTORELEASE(
[[NSKeyedArchiver alloc] initForWritingWithMutableData: data]);
[archiver encodeRootObject: item];
[archiver finishEncoding];

View file

@ -11,7 +11,7 @@ int main(int argc, char **argv)
{
CREATE_AUTORELEASE_POOL(arp);
NSRect f = NSMakeRect(0,0,100,100);
NSView *v = [[NSView alloc] initWithFrame: f];
NSView *v = AUTORELEASE([[NSView alloc] initWithFrame: f]);
int passed = 1;
if (!NSEqualRects([v visibleRect], f))

View file

@ -5,15 +5,15 @@
GNUSTEP_GUI_GCC=4.0.0
# Versions for libraries that gnustep-gui is dependent upon
GNUSTEP_GUI_BASE=1.30.0
GNUSTEP_GUI_BASE=1.31.0
GNUSTEP_GUI_LIBTIFF=3.4
# The version number of this release.
GNUSTEP_GUI_MAJOR_VERSION=0
GNUSTEP_GUI_MINOR_VERSION=31
GNUSTEP_GUI_SUBMINOR_VERSION=1
GNUSTEP_GUI_MINOR_VERSION=32
GNUSTEP_GUI_SUBMINOR_VERSION=0
# numeric value should match above
VERSION_NUMBER=031.1
VERSION_NUMBER=032.0
GNUSTEP_GUI_VERSION=${GNUSTEP_GUI_MAJOR_VERSION}.${GNUSTEP_GUI_MINOR_VERSION}.${GNUSTEP_GUI_SUBMINOR_VERSION}
VERSION=${GNUSTEP_GUI_VERSION}

568
configure vendored
View file

@ -644,19 +644,23 @@ BUILD_SPEECH_RECOGNIZER
BUILD_SPEECH
BUILD_SOUND
HAVE_ICU
ICU_CFLAGS
ICU_LIBS
ICU_CONFIG
MAGICKCORE_LIBS
MAGICKCORE_CFLAGS
IMAGEMAGICK_LIBS
IMAGEMAGICK_CFLAGS
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
HAVE_LIBPNG_CONFIG
TIFF_LIBS
TIFF_CFLAGS
EGREP
GREP
XMKMF
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
WHOAMI
CPP
OBJEXT
EXEEXT
@ -696,7 +700,6 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -732,7 +735,6 @@ enable_ungif
enable_libgif
enable_imagemagick
enable_icu
enable_icu_config
with_icu_library
enable_aspell
enable_sound
@ -749,14 +751,18 @@ LDFLAGS
LIBS
CPPFLAGS
CPP
XMKMF
PKG_CONFIG
PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR
XMKMF
TIFF_CFLAGS
TIFF_LIBS
IMAGEMAGICK_CFLAGS
IMAGEMAGICK_LIBS
MAGICKCORE_CFLAGS
MAGICKCORE_LIBS'
MAGICKCORE_LIBS
ICU_CFLAGS
ICU_LIBS'
# Initialize some variables set by options.
@ -795,7 +801,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE}'
@ -1048,15 +1053,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1194,7 +1190,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -1347,7 +1343,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -1390,8 +1385,6 @@ Optional Features:
--enable-libgif Enable libgif-based GIF support
--enable-imagemagick Enable ImageMagick support
--disable-icu Disable International Components for Unicode
--disable-icu-config Do not use the icu-config script to check
for ICU.
--disable-aspell Disable aspell for spellchecker
--disable-sound Disable sound
--disable-speech Disable speech server
@ -1420,12 +1413,14 @@ Some influential environment variables:
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
XMKMF Path to xmkmf, Makefile generator for X Window System
PKG_CONFIG path to pkg-config utility
PKG_CONFIG_PATH
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path
XMKMF Path to xmkmf, Makefile generator for X Window System
TIFF_CFLAGS C compiler flags for TIFF, overriding pkg-config
TIFF_LIBS linker flags for TIFF, overriding pkg-config
IMAGEMAGICK_CFLAGS
C compiler flags for IMAGEMAGICK, overriding pkg-config
IMAGEMAGICK_LIBS
@ -1434,6 +1429,8 @@ Some influential environment variables:
C compiler flags for MAGICKCORE, overriding pkg-config
MAGICKCORE_LIBS
linker flags for MAGICKCORE, overriding pkg-config
ICU_CFLAGS C compiler flags for ICU, overriding pkg-config
ICU_LIBS linker flags for ICU, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@ -3401,6 +3398,216 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
#--------------------------------------------------------------------
# Check for pkg-config
#--------------------------------------------------------------------
# Extract the first word of "whoami", so it can be a program name with args.
set dummy whoami; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_WHOAMI+:} false; then :
$as_echo_n "(cached) " >&6
else
case $WHOAMI in
[\\/]* | ?:[\\/]*)
ac_cv_path_WHOAMI="$WHOAMI" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_dummy="$PATH:/usr/ucb"
for as_dir in $as_dummy
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_WHOAMI="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_WHOAMI" && ac_cv_path_WHOAMI="echo"
;;
esac
fi
WHOAMI=$ac_cv_path_WHOAMI
if test -n "$WHOAMI"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WHOAMI" >&5
$as_echo "$WHOAMI" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
$as_echo "$PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_path_PKG_CONFIG"; then
ac_pt_PKG_CONFIG=$PKG_CONFIG
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $ac_pt_PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
if test -n "$ac_pt_PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
$as_echo "$ac_pt_PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_pt_PKG_CONFIG" = x; then
PKG_CONFIG=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
PKG_CONFIG=$ac_pt_PKG_CONFIG
fi
else
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
fi
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=0.9.0
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
PKG_CONFIG=""
fi
fi
# If the modern mechanism fails we may have an older pkg-config
# so try looking it up the old fashioned way.
if test -z "$PKG_CONFIG"; then
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
$as_echo "$PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
#--------------------------------------------------------------------
# Add target OS directories as necessary
#--------------------------------------------------------------------
@ -4489,7 +4696,84 @@ fi
GRAPHIC_LFLAGS="$with_tiff_library $GRAPHIC_LFLAGS"
GRAPHIC_CFLAGS="$with_tiff_include $GRAPHIC_CFLAGS"
else
have_tiff=no
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libtiff-4" >&5
$as_echo_n "checking for libtiff-4... " >&6; }
if test -n "$TIFF_CFLAGS"; then
pkg_cv_TIFF_CFLAGS="$TIFF_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtiff-4\""; } >&5
($PKG_CONFIG --exists --print-errors "libtiff-4") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_TIFF_CFLAGS=`$PKG_CONFIG --cflags "libtiff-4" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$TIFF_LIBS"; then
pkg_cv_TIFF_LIBS="$TIFF_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtiff-4\""; } >&5
($PKG_CONFIG --exists --print-errors "libtiff-4") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_TIFF_LIBS=`$PKG_CONFIG --libs "libtiff-4" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
TIFF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libtiff-4" 2>&1`
else
TIFF_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libtiff-4" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$TIFF_PKG_ERRORS" >&5
have_tiff=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
have_tiff=no
else
TIFF_CFLAGS=$pkg_cv_TIFF_CFLAGS
TIFF_LIBS=$pkg_cv_TIFF_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
GRAPHIC_LFLAGS="$TIFF_LIBS $GRAPHIC_LFLAGS"
GRAPHIC_CFLAGS="$TIFF_CFLAGS $GRAPHIC_CFLAGS"
fi
fi
fi
@ -5002,126 +5286,6 @@ if test "${enable_imagemagick+set}" = set; then :
enableval=$enable_imagemagick;
fi
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
$as_echo "$PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_path_PKG_CONFIG"; then
ac_pt_PKG_CONFIG=$PKG_CONFIG
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $ac_pt_PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
if test -n "$ac_pt_PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
$as_echo "$ac_pt_PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_pt_PKG_CONFIG" = x; then
PKG_CONFIG=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
PKG_CONFIG=$ac_pt_PKG_CONFIG
fi
else
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
fi
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=0.9.0
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
PKG_CONFIG=""
fi
fi
if test "x$enable_imagemagick" = "xyes"; then :
@ -5302,14 +5466,6 @@ else
fi
# Check whether --enable-icu-config was given.
if test "${enable_icu_config+set}" = set; then :
enableval=$enable_icu_config;
else
enable_icu_config=yes
fi
# Check whether --with-icu-library was given.
if test "${with_icu_library+set}" = set; then :
@ -5319,8 +5475,9 @@ else
fi
if test $enable_icu = yes; then
if test "$enable_icu_config" = "yes"; then
if test "x$enable_icu" = "xyes"; then :
# First attempt, icu-config
ok=no
@ -5403,13 +5560,102 @@ $as_echo "$ICU_LDFLAGS" >&6; }
fi
if test $ok = yes; then
have_icu=yes
HAVE_ICU=1
else
have_icu=no
HAVE_ICU=0
fi
else
have_icu=no;
# If no icu-config, attempt pkg-config
if test $HAVE_ICU = 0; then
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for icu-i18n > 49.0" >&5
$as_echo_n "checking for icu-i18n > 49.0... " >&6; }
if test -n "$ICU_CFLAGS"; then
pkg_cv_ICU_CFLAGS="$ICU_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-i18n > 49.0\""; } >&5
($PKG_CONFIG --exists --print-errors "icu-i18n > 49.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_ICU_CFLAGS=`$PKG_CONFIG --cflags "icu-i18n > 49.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$ICU_LIBS"; then
pkg_cv_ICU_LIBS="$ICU_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-i18n > 49.0\""; } >&5
($PKG_CONFIG --exists --print-errors "icu-i18n > 49.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_ICU_LIBS=`$PKG_CONFIG --libs "icu-i18n > 49.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
ICU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "icu-i18n > 49.0" 2>&1`
else
ICU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "icu-i18n > 49.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$ICU_PKG_ERRORS" >&5
HAVE_ICU=0
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
HAVE_ICU=0
else
ICU_CFLAGS=$pkg_cv_ICU_CFLAGS
ICU_LIBS=$pkg_cv_ICU_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
for ac_header in unicode/uloc.h unicode/ulocdata.h unicode/ucol.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h unicode/unorm2.h unicode/unum.h unicode/udat.h unicode/udatpg.h unicode/ustring.h unicode/usearch.h unicode/ucnv.h unicode/utext.h unicode/ubrk.h unicode/utypes.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
HAVE_ICU=1
fi
done
fi
fi
if test $HAVE_ICU = 0; then
HAVE_ICU=0;
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libicu (icu-config disabled)..." >&5
$as_echo "$as_me: checking for libicu (icu-config disabled)..." >&6;}
if test "$icu_libdir" != "no"; then
@ -5429,9 +5675,9 @@ main ()
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
have_icu="yes"
HAVE_ICU=1
else
have_icu="no"
HAVE_ICU=0
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext;
@ -5439,7 +5685,8 @@ rm -f core conftest.err conftest.$ac_objext \
ICU_LIBS="-licui18n -licuuc -licudata -lm"
fi
if test "$have_icu" = "yes"; then
if test $HAVE_ICU = 1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
for ac_header in unicode/uchar.h unicode/ustring.h
@ -5463,6 +5710,7 @@ $as_echo "no" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The International Components for Unicode (ICU) development headers and libraries do not appear to be available on this system." >&5
$as_echo "$as_me: WARNING: The International Components for Unicode (ICU) development headers and libraries do not appear to be available on this system." >&2;}
fi
fi

View file

@ -87,6 +87,17 @@ fi
AC_PROG_CC
AC_PROG_CPP
#--------------------------------------------------------------------
# Check for pkg-config
#--------------------------------------------------------------------
AC_PATH_PROG(WHOAMI, whoami, echo, $PATH:/usr/ucb)
PKG_PROG_PKG_CONFIG
# If the modern mechanism fails we may have an older pkg-config
# so try looking it up the old fashioned way.
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG,pkg-config,,)
fi
#--------------------------------------------------------------------
# Add target OS directories as necessary
#--------------------------------------------------------------------
@ -273,7 +284,16 @@ if test "$have_tiff" = yes; then
GRAPHIC_LFLAGS="$with_tiff_library $GRAPHIC_LFLAGS"
GRAPHIC_CFLAGS="$with_tiff_include $GRAPHIC_CFLAGS"
else
have_tiff=no
PKG_CHECK_MODULES(
[TIFF],
[libtiff-4],
[
GRAPHIC_LFLAGS="$TIFF_LIBS $GRAPHIC_LFLAGS"
GRAPHIC_CFLAGS="$TIFF_CFLAGS $GRAPHIC_CFLAGS"
],
[
have_tiff=no
])
fi
fi
@ -446,33 +466,37 @@ AC_ARG_ENABLE(icu,
[ --disable-icu Disable International Components for Unicode],,
enable_icu=yes)
AC_ARG_ENABLE(icu-config,
[ --disable-icu-config Do not use the icu-config script to check
for ICU.],,
enable_icu_config=yes)
AC_ARG_WITH(icu-library,
[ --with-icu-library=PATH library path for ICU libraries (only checked
if not using icu-config)],
icu_libdir="$withval", icu_libdir="no")
if test $enable_icu = yes; then
if test "$enable_icu_config" = "yes"; then
AC_CHECK_ICU(4.0, have_icu=yes, have_icu=no)
else
have_icu=no;
AS_IF([test "x$enable_icu" = "xyes"], [
# First attempt, icu-config
AC_CHECK_ICU(4.0, [HAVE_ICU=1], [HAVE_ICU=0])
# If no icu-config, attempt pkg-config
if test $HAVE_ICU = 0; then
PKG_CHECK_MODULES([ICU], [icu-i18n > 49.0], [
AC_CHECK_HEADERS([unicode/uloc.h unicode/ulocdata.h unicode/ucol.h unicode/ucurr.h unicode/uregex.h unicode/ucal.h unicode/unorm2.h unicode/unum.h unicode/udat.h unicode/udatpg.h unicode/ustring.h unicode/usearch.h unicode/ucnv.h unicode/utext.h unicode/ubrk.h unicode/utypes.h],
HAVE_ICU=1)], [HAVE_ICU=0])
fi
if test $HAVE_ICU = 0; then
HAVE_ICU=0;
AC_CHECKING([for libicu (icu-config disabled)])
if test "$icu_libdir" != "no"; then
ICU_LDFLAGS="-L$icu_libdir";
fi
saved_LDFLAGS="$LDFLAGS";
LDFLAGS="$LDFLAGS $LIBS $ICU_LDFLAGS -licui18n -licuuc -licudata -lm"
AC_TRY_LINK([],[], have_icu="yes", have_icu="no");
AC_TRY_LINK([],[], HAVE_ICU=1, HAVE_ICU=0);
LDFLAGS="$saved_LDFLAGS";
ICU_LIBS="-licui18n -licuuc -licudata -lm"
fi
if test "$have_icu" = "yes"; then
if test $HAVE_ICU = 1; then
AC_MSG_RESULT(yes)
AC_CHECK_HEADERS(unicode/uchar.h unicode/ustring.h)
GRAPHIC_LFLAGS="$ICU_LDFLAGS $ICU_LIBS $GRAPHIC_LFLAGS"
@ -481,7 +505,7 @@ if test $enable_icu = yes; then
AC_MSG_RESULT(no)
AC_MSG_WARN([The International Components for Unicode (ICU) development headers and libraries do not appear to be available on this system.])
fi
fi
])
AC_SUBST(HAVE_ICU)
#--------------------------------------------------------------------