mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 14:50:59 +00:00
Compare commits
259 commits
gui-0_31_1
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
4f255d2750 | ||
|
15de9c7eb3 | ||
|
4f54f4d6cf | ||
|
2e5f204d6a | ||
|
fcfc643e3c | ||
|
a4da1a1b5a | ||
|
0421737ed5 | ||
|
3c83194b7b | ||
|
e3da52aae3 | ||
|
0db5a24849 | ||
|
4faee2de0b | ||
|
2cd675f736 | ||
|
c00d5beaf8 | ||
|
60aca74336 | ||
|
62a162ed99 | ||
|
07f2213285 | ||
|
d7b54f7a76 | ||
|
5917f0519b | ||
|
4c1687d2b4 | ||
|
f63152d5b9 | ||
|
18175a38d2 | ||
|
bb2c4f4978 | ||
|
44e7af6704 | ||
|
04538546d4 | ||
|
16b311f12e | ||
|
d25d0ad027 | ||
|
c28695dd4a | ||
|
efb587850b | ||
|
7855b12d6a | ||
|
86f97ac54d | ||
|
fbb22c07bf | ||
|
4bb57d4af5 | ||
|
f63f89dd05 | ||
|
b75d59a5b9 | ||
|
f1a94d94b5 | ||
|
b19c9052a7 | ||
|
ddd239d702 | ||
|
df9f4560c6 | ||
|
989d3aacd6 | ||
|
fbd539ad24 | ||
|
b68ddb27b9 | ||
|
08163b48f1 | ||
|
a8018d6c8e | ||
|
a3ebaf2630 | ||
|
3a3a8c47c9 | ||
|
96a719ae20 | ||
|
e489d43ef1 | ||
|
74b5836b19 | ||
|
1a74cb6435 | ||
|
2bcc354972 | ||
|
7855252df0 | ||
|
4da0ca66a0 | ||
|
68e2716626 | ||
|
82717eefec | ||
|
bc53ea0ecf | ||
|
f7fd33a746 | ||
|
87e132ca82 | ||
|
c80105a312 | ||
|
299af29885 | ||
|
7d477230ec | ||
|
aac04a1a03 | ||
|
041b8fda1f | ||
|
5580e464d2 | ||
|
557796af5d | ||
|
c89d7432a4 | ||
|
c71f9dd715 | ||
|
70cdc3c908 | ||
|
ec89d161b0 | ||
|
42a79060b9 | ||
|
820492495a | ||
|
5cd432374c | ||
|
c5754158c5 | ||
|
9d419c9116 | ||
|
59f91c21cd | ||
|
3879f8e909 | ||
|
10256c9a60 | ||
|
349dc21144 | ||
|
a32741a5d7 | ||
|
acf00ce5d2 | ||
|
56d6fa064f | ||
|
9901bbcb4c | ||
|
55ef9f465f | ||
|
5fd4ff0ffe | ||
|
5a169767ff | ||
|
664fdada0c | ||
|
c3146bae6b | ||
|
427b9af224 | ||
|
245ec265f8 | ||
|
afe151aaaf | ||
|
40fc3ab2ec | ||
|
417a33de27 | ||
|
16ed635cd4 | ||
|
c2324e102d | ||
|
4d50863275 | ||
|
fb1472ad3b | ||
|
2916a92bf7 | ||
|
d04a1b8291 | ||
|
59381a7803 | ||
|
04e6cf804d | ||
|
64c5bb581d | ||
|
3b02ac1d9d | ||
|
fbad48733d | ||
|
fb61a0f287 | ||
|
22e5304a7b | ||
|
3784462321 | ||
|
6a3681aa82 | ||
|
35fb894ecc | ||
|
f6231b841d | ||
|
691bf4391b | ||
|
3c160c9bb8 | ||
|
530dee1e2f | ||
|
b003db284e | ||
|
e1f3109c94 | ||
|
8ed8754b2a | ||
|
068684d6d3 | ||
|
1a188b7eb7 | ||
|
27d57fe5eb | ||
|
4b380ab272 | ||
|
97ea7c5cc5 | ||
|
4813800ac8 | ||
|
5befed5855 | ||
|
fbc0cd160b | ||
|
ddf6546c37 | ||
|
118eb26a5f | ||
|
bb2c12d74a | ||
|
ac56a0fe29 | ||
|
6474e53fb6 | ||
|
5d9e49a2ff | ||
|
854af0901e | ||
|
0ab960e6fc | ||
|
dd67057784 | ||
|
8760810340 | ||
|
d8c4c14018 | ||
|
1fd80dabc2 | ||
|
21d0bc906e | ||
|
c85e4fcf37 | ||
|
329553c196 | ||
|
d694efc941 | ||
|
a1b9dc546e | ||
|
300a84c493 | ||
|
13f86ebfa9 | ||
|
8059cdadd0 | ||
|
27718ee794 | ||
|
1a8f0fa8e6 | ||
|
fbee6dce81 | ||
|
8935a2d2da | ||
|
ad75804102 | ||
|
52eef305b0 | ||
|
6f2c542b46 | ||
|
abfc782a6c | ||
|
3d59afd2c9 | ||
|
7b78d9b64e | ||
|
4e95021973 | ||
|
ddc47652ec | ||
|
1d266d7a9b | ||
|
4f9889bbe4 | ||
|
9712490625 | ||
|
71304617b2 | ||
|
b77c7052e6 | ||
|
3ae1a4b41d | ||
|
ab737b81d5 | ||
|
782321e063 | ||
|
f5decac3ba | ||
|
ffdf8fb6da | ||
|
a1dd317d29 | ||
|
f55d937ab2 | ||
|
1df45b788e | ||
|
b1d0ecc21b | ||
|
d22d839b0c | ||
|
dc78b11291 | ||
|
cd41f301a8 | ||
|
b32f21e549 | ||
|
da2803481b | ||
|
c68c459584 | ||
|
c39095cd61 | ||
|
74e0c19503 | ||
|
766a358fb7 | ||
|
ca4fe0e078 | ||
|
45c0368602 | ||
|
f253f3fa0e | ||
|
2ba9843537 | ||
|
4ddce03859 | ||
|
9b481f10b3 | ||
|
e6f86a5a9e | ||
|
90b3913a1f | ||
|
bbbe9d00b4 | ||
|
8da3d0afb7 | ||
|
aa86a96c55 | ||
|
060b27a854 | ||
|
fdb35eb869 | ||
|
435ccfb2c7 | ||
|
23bcb99166 | ||
|
20b8f2402b | ||
|
6b238f504c | ||
|
1d46aae920 | ||
|
8fbcbdb380 | ||
|
90d94fea22 | ||
|
7aee7f6667 | ||
|
ebf6bdb8d2 | ||
|
5c9ffa3929 | ||
|
ba9c12ddf8 | ||
|
860e1863da | ||
|
765160fdac | ||
|
6b2bddab4c | ||
|
963572f5c4 | ||
|
ff97a5bbe2 | ||
|
aa4f9b5dbf | ||
|
efe925cf38 | ||
|
9a91d04bc0 | ||
|
9a28851a3f | ||
|
ab2de84a90 | ||
|
786b48dd1b | ||
|
647076cb8a | ||
|
b0d02aa7e8 | ||
|
0f4e1711d0 | ||
|
6b808f2d24 | ||
|
930e3b6c0f | ||
|
fb2f605e18 | ||
|
340b95c9fa | ||
|
3dfcdf6570 | ||
|
f7afc331eb | ||
|
1d29613491 | ||
|
bfb33156cf | ||
|
422649ae5b | ||
|
baca2ae98a | ||
|
cf7b9ebd39 | ||
|
f9b89c41e6 | ||
|
77bf2f823b | ||
|
f8fca4e162 | ||
|
b4c98b329b | ||
|
a815ad5bb8 | ||
|
1d6a850081 | ||
|
8162920eea | ||
|
f83098bd8d | ||
|
44c0836bd9 | ||
|
c93ee13f57 | ||
|
c9a0e74437 | ||
|
d3e2d8c348 | ||
|
33a4e297b1 | ||
|
27c9dc9207 | ||
|
8fc0bffc5c | ||
|
615b3e9b27 | ||
|
d3f05037eb | ||
|
52423a430c | ||
|
61ff6962df | ||
|
5ab8768283 | ||
|
842b0d8014 | ||
|
bd4e093bad | ||
|
b7bea0213b | ||
|
bec2392e33 | ||
|
b9c5ba35be | ||
|
9070a9d30f | ||
|
4d5957eaf7 | ||
|
77ce97c266 | ||
|
f7e4b70f54 | ||
|
d3a0dd23c0 | ||
|
41c7257d4b | ||
|
dfef9c9e1f | ||
|
4d2dcb9e04 |
103 changed files with 6505 additions and 3742 deletions
3
.github/scripts/dependencies.sh
vendored
3
.github/scripts/dependencies.sh
vendored
|
@ -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
|
||||
|
|
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
|
@ -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 }}
|
||||
|
|
52
ANNOUNCE
52
ANNOUNCE
|
@ -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
12
BUGS
|
@ -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
|
||||
|
|
89
ChangeLog
89
ChangeLog
|
@ -1,3 +1,90 @@
|
|||
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
|
||||
* Headers/AppKit/NSMenuToolbarItem.h: Declarations
|
||||
for NSMenuToolbarItem.
|
||||
* Images/GNUmakefile: Add new image
|
||||
* Images/nsmapping.strings: Add image mapping
|
||||
* MISSING: Remove this class from the list
|
||||
* Source/GNUmakefile: Add class to build
|
||||
* Source/NSMenuToolbarItem.m: Implementation of
|
||||
NSMenuToolbarItem.
|
||||
|
||||
2024-06-07 Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Headers/Additions/GNUstepGUI/GSTheme.h: Add new methods
|
||||
for rendering view-based outline/table views.
|
||||
* Headers/AppKit/NSTableRowView.h: Add implementation
|
||||
* Headers/AppKit/NSTableView.h: Add references to
|
||||
NSTableRowView.h
|
||||
* Source/GSThemeDrawing.m: Factor out NSTableView and
|
||||
NSOutlineView rendering so that GSThemeDrawing methods
|
||||
are as minimal as possible.
|
||||
* Source/NSOutlineView.m: Refactor to use new methods
|
||||
to generate NSTableRowView when it is view-based.
|
||||
* Source/NSTableRowView.m: Add implementation of
|
||||
NSTableRowView implementation.
|
||||
* Source/NSTableView.m: Update to use NSTableRowView
|
||||
when it is view-based.
|
||||
|
||||
2024-06-05 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* ChangeLog: Update for new release
|
||||
|
@ -20,7 +107,7 @@
|
|||
|
||||
2024-05-26 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* ChangeLog: Update for new release
|
||||
* ChangeLog: Update for new release
|
||||
* ANNOUNCE:
|
||||
* NEWS:
|
||||
* Documentation/news.texi: Update of release notes for 0.31.0.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
to be used to view application help.<br /> If this is not specified
|
||||
(or is an empty string) the 'best' available viewer is used (an
|
||||
application whose Info.plist says that it can view files of the
|
||||
appropriate type ... usually rtp or rtfd files).<br />
|
||||
appropriate type ... usually rtf or rtfd files).<br />
|
||||
If this is set to <code>NSHelpPanel</code> or if no application can
|
||||
be used to view the help file, the help is displayed by the
|
||||
shared help panel object built in to the application.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -169,6 +169,7 @@
|
|||
|
||||
</unit>
|
||||
*/
|
||||
APPKIT_EXPORT_CLASS
|
||||
@interface GSHbox: GSTable
|
||||
{
|
||||
BOOL _haveViews;
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
@class NSView;
|
||||
@class NSPrintInfo;
|
||||
|
||||
|
||||
APPKIT_EXPORT_CLASS
|
||||
@interface GSPrintOperation: NSPrintOperation
|
||||
{
|
||||
}
|
||||
|
|
|
@ -171,6 +171,7 @@
|
|||
</section>
|
||||
</unit>
|
||||
*/
|
||||
APPKIT_EXPORT_CLASS
|
||||
@interface GSTable: NSView
|
||||
{
|
||||
int _numberOfRows;
|
||||
|
|
|
@ -253,6 +253,7 @@
|
|||
@class NSPopUpButtonCell;
|
||||
@class NSMenuView;
|
||||
@class NSProgressIndicator;
|
||||
@class NSTableColumn;
|
||||
@class NSTableHeaderCell;
|
||||
@class NSTableView;
|
||||
@class NSTabViewItem;
|
||||
|
@ -1264,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;
|
||||
|
@ -1274,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
|
||||
|
@ -1341,9 +1348,11 @@ APPKIT_EXPORT_CLASS
|
|||
clipRect: (NSRect)clipRect
|
||||
inView: (NSTableView *)view;
|
||||
|
||||
- (void) drawCellViewRow: (NSInteger)rowIndex
|
||||
clipRect: (NSRect)clipRect
|
||||
inView: (NSTableView *)v;
|
||||
- (NSRect) drawOutlineCell: (NSTableColumn *)tb
|
||||
outlineView: (NSOutlineView *)outlineView
|
||||
item: (id)item
|
||||
drawingRect: (NSRect)inputRect
|
||||
rowIndex: (NSInteger)rowIndex;
|
||||
|
||||
- (void) drawOutlineViewRow: (NSInteger)rowIndex
|
||||
clipRect: (NSRect)clipRect
|
||||
|
@ -1566,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)
|
||||
|
|
|
@ -101,6 +101,7 @@
|
|||
#import <AppKit/NSMenu.h>
|
||||
#import <AppKit/NSMenuItem.h>
|
||||
#import <AppKit/NSMenuItemCell.h>
|
||||
#import <AppKit/NSMenuToolbarItem.h>
|
||||
#import <AppKit/NSMenuView.h>
|
||||
#import <AppKit/NSNibLoading.h>
|
||||
#import <AppKit/NSOpenPanel.h>
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
Copyright (C) 1999, 2005 Free Software Foundation, Inc.
|
||||
|
||||
Author: Enrico Sersale <enrico@imago.ro>
|
||||
Author: Enrico Sersale
|
||||
Date: Dec 1999
|
||||
|
||||
This file is part of the GNUstep GUI Library.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -410,7 +410,7 @@ APPKIT_EXPORT_CLASS
|
|||
unsigned int unused: 25;
|
||||
} _menu;
|
||||
|
||||
@private
|
||||
@protected
|
||||
NSWindow *_aWindow;
|
||||
NSWindow *_bWindow;
|
||||
NSMenu *_oldAttachedMenu;
|
||||
|
|
60
Headers/AppKit/NSMenuToolbarItem.h
Normal file
60
Headers/AppKit/NSMenuToolbarItem.h
Normal file
|
@ -0,0 +1,60 @@
|
|||
/* Definition of class NSMenuToolbarItem
|
||||
Copyright (C) 2024 Free Software Foundation, Inc.
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: 03-05-2024
|
||||
|
||||
This file is part of the GNUstep Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110 USA.
|
||||
*/
|
||||
|
||||
#ifndef _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE
|
||||
#define _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE
|
||||
|
||||
#import <AppKit/NSToolbarItem.h>
|
||||
#import <AppKit/AppKitDefines.h>
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_15, GS_API_LATEST)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@class NSMenu;
|
||||
|
||||
APPKIT_EXPORT_CLASS
|
||||
@interface NSMenuToolbarItem : NSToolbarItem
|
||||
{
|
||||
BOOL _showsIndicator;
|
||||
NSMenu *_menu;
|
||||
}
|
||||
|
||||
- (BOOL) showsIndicator;
|
||||
- (void) setShowsIndicator: (BOOL)flag;
|
||||
|
||||
- (NSMenu *) menu;
|
||||
- (void) setMenu: (NSMenu *)menu;
|
||||
|
||||
@end
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GS_API_MACOSX */
|
||||
|
||||
#endif /* _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE */
|
|
@ -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;
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
Copyright (C) 2002, 2009 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Enrico Sersale <enrico@imago.ro>,
|
||||
Stefan Bidigaray <stefanbidi@gmail.com>
|
||||
Written by: Enrico Sersale
|
||||
Stefan Bidigaray <stefanbidi@gmail.com>
|
||||
Date: Jul 2002, Jun 2009
|
||||
|
||||
This file is part of the GNUstep GUI Library.
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/* Definition of class NSTableRowView
|
||||
Copyright (C) 2022 Free Software Foundation, Inc.
|
||||
|
||||
|
||||
By: Gregory John Casamento <greg.casamento@gmail.com>
|
||||
Date: 03-09-2022
|
||||
|
||||
This file is part of the GNUstep Library.
|
||||
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
|
@ -25,7 +25,8 @@
|
|||
#ifndef _NSTableRowView_h_GNUSTEP_GUI_INCLUDE
|
||||
#define _NSTableRowView_h_GNUSTEP_GUI_INCLUDE
|
||||
|
||||
#import <AppKit/NSView.h>
|
||||
#import <AppKit/NSTableView.h>
|
||||
#import <AppKit/NSCell.h>
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
|
||||
|
||||
|
@ -34,6 +35,78 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
@interface NSTableRowView : NSView
|
||||
{
|
||||
// Display style...
|
||||
BOOL _emphasized;
|
||||
NSBackgroundStyle _interiorBackgroundStyle;
|
||||
BOOL _floating;
|
||||
|
||||
// Row selection...
|
||||
BOOL _selected;
|
||||
NSTableViewSelectionHighlightStyle _selectionHighlightStyle;
|
||||
|
||||
// Drag and Drop...
|
||||
NSTableViewDraggingDestinationFeedbackStyle _draggingDestinationFeedbackStyle;
|
||||
CGFloat _indentationForDropOperation;
|
||||
BOOL _targetForDropOperation;
|
||||
|
||||
// Row grouping...
|
||||
BOOL _groupRowStyle;
|
||||
NSInteger _numberOfColumns;
|
||||
|
||||
// Overriding row view display characteristics...
|
||||
NSColor *_backgroundColor;
|
||||
|
||||
BOOL _nextRowSelected;
|
||||
BOOL _previousRowSelected;
|
||||
}
|
||||
|
||||
- (BOOL) isEmphasized;
|
||||
- (void) setEmphasized: (BOOL)flag;
|
||||
|
||||
- (NSBackgroundStyle) interiorBackgroundStyle;
|
||||
|
||||
- (BOOL) isFloating;
|
||||
- (void) setFloating: (BOOL)flag;
|
||||
|
||||
- (BOOL) isSelected;
|
||||
- (void) setSelected: (BOOL)flag;
|
||||
|
||||
- (NSTableViewSelectionHighlightStyle) selectionHighlightStyle;
|
||||
- (void) setSelectionHighlightStyle: (NSTableViewSelectionHighlightStyle) selectionHighlightStyle;
|
||||
|
||||
- (NSTableViewDraggingDestinationFeedbackStyle) draggingDestinationFeedbackStyle;
|
||||
- (void) setTableViewDraggingDestinationFeedbackStyle: (NSTableViewDraggingDestinationFeedbackStyle) draggingDestinationFeedbackStyle;
|
||||
|
||||
- (CGFloat) indentationForDropOperation;
|
||||
- (void) setIndentationForDropOperation: (CGFloat)indentationForDropOperation;
|
||||
|
||||
- (BOOL) targetForDropOperation;
|
||||
- (void) setTargetForDropOperation: (BOOL)flag;
|
||||
|
||||
- (BOOL) groupRowStyle;
|
||||
- (void) setGroupRowStyle: (BOOL)flag;
|
||||
|
||||
- (NSInteger) numberOfColumns;
|
||||
|
||||
- (NSColor *) backgroundColor;
|
||||
- (void) setBackgroundColor: (NSColor *)color;
|
||||
|
||||
- (void) drawBackgroundInRect: (NSRect)dirtyRect;
|
||||
|
||||
- (void) drawDraggingDestinationFeedbackInRect: (NSRect)dirtyRect;
|
||||
|
||||
- (void) drawSelectionInRect: (NSRect)dirtyRect;
|
||||
|
||||
- (void) drawSeparatorInRect: (NSRect)dirtyRect;
|
||||
|
||||
- (id) viewAtColumn: (NSInteger)column;
|
||||
|
||||
- (BOOL) isNextRowSelected;
|
||||
- (void) setNextRowSelected: (BOOL)flag;
|
||||
|
||||
- (BOOL) isPreviousRowSelected;
|
||||
- (void) setPreviousRowSelected: (BOOL)flag;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -102,6 +102,15 @@ typedef enum _NSTableViewRowSizeStyle
|
|||
} NSTableViewRowSizeStyle;
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
|
||||
typedef enum _NSTableViewDraggingDestinationFeedbackStyle
|
||||
{
|
||||
NSTableViewDraggingDestinationFeedbackStyleNone = 0,
|
||||
NSTableViewDraggingDestinationFeedbackStyleRegular,
|
||||
NSTableViewDraggingDestinationFeedbackStyleSourceList,
|
||||
NSTableViewDraggingDestinationFeedbackStyleGap,
|
||||
} NSTableViewDraggingDestinationFeedbackStyle;
|
||||
#endif
|
||||
|
||||
APPKIT_EXPORT_CLASS
|
||||
@interface NSTableView : NSControl <NSUserInterfaceValidations>
|
||||
|
@ -195,6 +204,9 @@ APPKIT_EXPORT_CLASS
|
|||
NSMapTable *_pathsToViews;
|
||||
NSMutableDictionary *_registeredNibs;
|
||||
NSMutableDictionary *_registeredViews;
|
||||
|
||||
/* NSTableRowView support */
|
||||
NSMutableDictionary *_rowViews;
|
||||
}
|
||||
|
||||
/* Data Source */
|
||||
|
@ -402,6 +414,8 @@ APPKIT_EXPORT_CLASS
|
|||
- (void) removeRowsAtIndexes: (NSIndexSet*)indexes withAnimation: (NSTableViewAnimationOptions)animationOptions;
|
||||
- (NSInteger) rowForView: (NSView*)view;
|
||||
- (NSView *) makeViewWithIdentifier: (NSUserInterfaceItemIdentifier)identifier owner: (id)owner;
|
||||
- (NSTableRowView *) rowViewAtRow: (NSInteger)row makeIfNecessary: (BOOL)flag;
|
||||
- (NSView *) viewAtColumn: (NSInteger)column row: (NSInteger)row makeIfNecessary: (BOOL)flag;
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_8, GS_API_LATEST)
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
28
INSTALL
|
@ -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.
|
||||
|
|
|
@ -90,6 +90,7 @@ Images_RESOURCE_FILES = \
|
|||
common_Info.tiff\
|
||||
common_LeftTabStop.tiff \
|
||||
common_LibraryFolder.tiff \
|
||||
common_MenuToolbarItem.tiff \
|
||||
common_MiniWindowTile.tiff \
|
||||
common_Miniaturize.tiff \
|
||||
common_MiniaturizeH.tiff \
|
||||
|
|
BIN
Images/common_MenuToolbarItem.tiff
Normal file
BIN
Images/common_MenuToolbarItem.tiff
Normal file
Binary file not shown.
|
@ -45,7 +45,8 @@ common_ToolbarShowColorsItem = NSToolbarShowColors;
|
|||
common_ToolbarShowFontsItem = NSToolbarShowFonts;
|
||||
common_RecyclerEmpty = NSImageTrashEmpty;
|
||||
common_RecyclerFull = NSImageTrashFull;
|
||||
|
||||
common_MenuToolbarItem = NSMenuToolbarItem;
|
||||
|
||||
/* Misc. */
|
||||
|
||||
common_MultipleSelection = NSImageNameMultipleDocuments;
|
||||
|
|
1
MISSING
1
MISSING
|
@ -7,7 +7,6 @@ MISSING HEADERS ( * = difficult, - = quick, + = placeholder, x = won't do )
|
|||
> NSFilePromiseProvider.h -
|
||||
> NSFilePromiseReceiver.h -
|
||||
> NSItemProvider.h +
|
||||
> NSMenuToolbarItem.h -
|
||||
> NSOpenGLLayer.h +
|
||||
> NSTypesetter.h +
|
||||
> NSUserActivity.h -
|
||||
|
|
|
@ -105,19 +105,19 @@ tFile=- -; else cat; fi"
|
|||
*CloseUI: *PageRegion
|
||||
|
||||
*DefaultImageableArea: Letter
|
||||
*ImageableArea Letter/US Letter: "0 0 612 792"
|
||||
*ImageableArea A4/A4: "0 0 595 842"
|
||||
*ImageableArea 11x17/11x17: "0 0 792 1224"
|
||||
*ImageableArea A3/A3: "0 0 842 1191"
|
||||
*ImageableArea A5/A5: "0 0 421 595"
|
||||
*ImageableArea B5/B5 (JIS): "0 0 516 729"
|
||||
*ImageableArea Env10/Envelope #10: "0 0 297 684"
|
||||
*ImageableArea EnvC5/Envelope C5: "0 0 459 649"
|
||||
*ImageableArea EnvDL/Envelope DL: "0 0 312 624"
|
||||
*ImageableArea EnvISOB5/Envelope B5: "0 0 499 709"
|
||||
*ImageableArea EnvMonarch/Envelope Monarch: "0 0 279 540"
|
||||
*ImageableArea Executive/Executive: "0 0 522 756"
|
||||
*ImageableArea Legal/US Legal: "0 0 612 1008"
|
||||
*ImageableArea Letter/US Letter: "25 25 587 767"
|
||||
*ImageableArea A4/A4: "25 25 570 817"
|
||||
*ImageableArea 11x17/11x17: "30 30 762 1194"
|
||||
*ImageableArea A3/A3: "25 25 817 1166"
|
||||
*ImageableArea A5/A5: "25 25 396 587"
|
||||
*ImageableArea B5/B5 (JIS): "20 20 496 709"
|
||||
*ImageableArea Env10/Envelope #10: "20 20 277 664"
|
||||
*ImageableArea EnvC5/Envelope C5: "20 20 439 629"
|
||||
*ImageableArea EnvDL/Envelope DL: "20 20 292 604"
|
||||
*ImageableArea EnvISOB5/Envelope B5: "20 20 479 689"
|
||||
*ImageableArea EnvMonarch/Envelope Monarch: "20 20 259 526"
|
||||
*ImageableArea Executive/Executive: "20 20 502 736"
|
||||
*ImageableArea Legal/US Legal: "25 25 587 983"
|
||||
|
||||
*DefaultPaperDimension: Letter
|
||||
*PaperDimension Letter/US Letter: "612 792"
|
||||
|
|
|
@ -51,7 +51,7 @@ Please log bug reports on the [GitHub issues page][2].
|
|||
|
||||
Happy hacking!
|
||||
|
||||
Copyright (C) 2005 Free Software Foundation
|
||||
Copyright (C) 2005, 2024 Free Software Foundation
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -180,6 +180,7 @@ NSStoryboardSegue.m \
|
|||
NSMagnificationGestureRecognizer.m \
|
||||
NSMatrix.m \
|
||||
NSMenu.m \
|
||||
NSMenuToolbarItem.m \
|
||||
NSMenuView.m \
|
||||
NSMenuItem.m \
|
||||
NSMenuItemCell.m \
|
||||
|
@ -303,6 +304,7 @@ NSWindowController.m \
|
|||
NSWorkspace.m \
|
||||
GSAnimator.m \
|
||||
GSAutocompleteWindow.m \
|
||||
GSControllerTreeProxy.m \
|
||||
GSDisplayServer.m \
|
||||
GSHelpManagerPanel.m \
|
||||
GSInfoPanel.m \
|
||||
|
@ -371,7 +373,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
|
||||
|
@ -496,6 +499,7 @@ NSMediaLibraryBrowserController.h \
|
|||
NSMenu.h \
|
||||
NSMenuItem.h \
|
||||
NSMenuItemCell.h \
|
||||
NSMenuToolbarItem.h \
|
||||
NSMenuView.h \
|
||||
NSMovie.h \
|
||||
NSMovieView.h \
|
||||
|
|
|
@ -1280,7 +1280,7 @@ typedef NSInteger GSLayoutViewAttribute;
|
|||
RELEASE(_viewAlignmentRectByViewIndex);
|
||||
RELEASE(_viewIndexByViewHash);
|
||||
RELEASE(_constraintsByViewIndex);
|
||||
RELEASE(_constraintsByViewIndex);
|
||||
RELEASE(_layoutConstraintsBySolverConstraint);
|
||||
RELEASE(_supportingConstraintsByConstraint);
|
||||
RELEASE(_constraintsByAutoLayoutConstaintHash);
|
||||
RELEASE(_internalConstraintsByViewIndex);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <AppKit/NSSliderCell.h>
|
||||
|
||||
APPKIT_EXPORT_CLASS
|
||||
@interface GSColorSliderCell : NSSliderCell
|
||||
{
|
||||
int mode;
|
|
@ -1,4 +1,4 @@
|
|||
/* GSStandardColorPicker.m
|
||||
/* GSColorSliderCell.m
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
|
59
Source/GSControllerTreeProxy.h
Normal file
59
Source/GSControllerTreeProxy.h
Normal 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 */
|
||||
|
90
Source/GSControllerTreeProxy.m
Normal file
90
Source/GSControllerTreeProxy.m
Normal 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
|
||||
|
|
@ -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.
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
|
||||
Written By: <author name="Enrico Sersale"><email>enrico@imago.ro</email></author>
|
||||
Written By: Enrico Sersale
|
||||
Date: Jan 2002
|
||||
|
||||
This file is part of the GNU Objective C User Interface library.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
Created by: Enrico Sersale <enrico@imago.ro>
|
||||
Created by: Enrico Sersale
|
||||
Date: Jan 2002
|
||||
Author: Fred Kiefer <fredkiefer@gmx.de>
|
||||
Date: Jan 2003
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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) */
|
||||
|
@ -82,12 +84,9 @@
|
|||
row: (NSInteger)index;
|
||||
- (id)_objectValueForTableColumn: (NSTableColumn *)tb
|
||||
row: (NSInteger)index;
|
||||
- (NSView *) _renderedViewForPath: (NSIndexPath *)path;
|
||||
- (void) _setRenderedView: (NSView *)view forPath: (NSIndexPath *)path;
|
||||
@end
|
||||
|
||||
@interface NSTableColumn (Private)
|
||||
- (NSArray *) _prototypeCellViews;
|
||||
- (void) _calculatedStartingColumn: (NSInteger *)startingColumn
|
||||
endingColumn: (NSInteger *)endingColumn
|
||||
inClipRect: (NSRect)clipRect;
|
||||
@end
|
||||
|
||||
@interface NSCell (Private)
|
||||
|
@ -3287,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);
|
||||
|
@ -3320,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];
|
||||
|
@ -3384,45 +3383,6 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
}
|
||||
}
|
||||
|
||||
- (void) _calculatedStartingColumn: (NSInteger *)startingColumn
|
||||
endingColumn: (NSInteger *)endingColumn
|
||||
withTableView: (NSTableView *)tableView
|
||||
inClipRect: (NSRect)clipRect
|
||||
|
||||
{
|
||||
CGFloat x_pos = 0.0;
|
||||
NSInteger i = 0;
|
||||
NSInteger numberOfColumns = [tableView numberOfColumns];
|
||||
CGFloat *columnOrigins = [tableView _columnOrigins];
|
||||
|
||||
/* Using columnAtPoint: here would make it called twice per row per drawn
|
||||
rect - so we avoid it and do it natively */
|
||||
|
||||
/* Determine starting column as fast as possible */
|
||||
x_pos = NSMinX (clipRect);
|
||||
i = 0;
|
||||
while ((i < numberOfColumns) && (x_pos > columnOrigins[i]))
|
||||
{
|
||||
i++;
|
||||
}
|
||||
*startingColumn = (i - 1);
|
||||
|
||||
if (*startingColumn == -1)
|
||||
*startingColumn = 0;
|
||||
|
||||
/* Determine ending column as fast as possible */
|
||||
x_pos = NSMaxX (clipRect);
|
||||
// Nota Bene: we do *not* reset i
|
||||
while ((i < numberOfColumns) && (x_pos > columnOrigins[i]))
|
||||
{
|
||||
i++;
|
||||
}
|
||||
*endingColumn = (i - 1);
|
||||
|
||||
if (*endingColumn == -1)
|
||||
*endingColumn = numberOfColumns - 1;
|
||||
}
|
||||
|
||||
- (void) drawTableViewRow: (NSInteger)rowIndex
|
||||
clipRect: (NSRect)clipRect
|
||||
inView: (NSTableView *)tableView
|
||||
|
@ -3441,16 +3401,16 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
NSColor *selectedTextColor = [self colorNamed: @"highlightedTableRowTextColor"
|
||||
state: GSThemeNormalState];
|
||||
|
||||
[self _calculatedStartingColumn: &startingColumn
|
||||
endingColumn: &endingColumn
|
||||
withTableView: tableView
|
||||
inClipRect: clipRect];
|
||||
[tableView _calculatedStartingColumn: &startingColumn
|
||||
endingColumn: &endingColumn
|
||||
inClipRect: clipRect];
|
||||
|
||||
/* Draw the row between startingColumn and endingColumn */
|
||||
for (i = startingColumn; i <= endingColumn; i++)
|
||||
{
|
||||
const BOOL columnSelected = [tableView isColumnSelected: i];
|
||||
const BOOL cellSelected = (rowSelected || columnSelected);
|
||||
|
||||
tb = [tableColumns objectAtIndex: i];
|
||||
cell = [tb dataCellForRow: rowIndex];
|
||||
[tableView _willDisplayCell: cell
|
||||
|
@ -3495,11 +3455,11 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
}
|
||||
}
|
||||
|
||||
- (NSRect) _drawOutlineTableColumn: (NSTableColumn *)tb
|
||||
outlineView: (NSOutlineView *)outlineView
|
||||
item: (id)item
|
||||
drawingRect: (NSRect)inputRect
|
||||
rowIndex: (NSInteger)rowIndex
|
||||
- (NSRect) drawOutlineCell: (NSTableColumn *)tb
|
||||
outlineView: (NSOutlineView *)outlineView
|
||||
item: (id)item
|
||||
drawingRect: (NSRect)inputRect
|
||||
rowIndex: (NSInteger)rowIndex
|
||||
{
|
||||
NSRect drawingRect = inputRect;
|
||||
NSImage *image = nil;
|
||||
|
@ -3519,17 +3479,17 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
{
|
||||
image = [NSImage imageNamed: @"common_ArrowRightH"];
|
||||
}
|
||||
|
||||
|
||||
if (![outlineView isExpandable: item])
|
||||
{
|
||||
image = AUTORELEASE([[NSImage alloc] initWithSize: NSMakeSize(14.0,14.0)]);
|
||||
}
|
||||
|
||||
|
||||
level = [outlineView levelForItem: item];
|
||||
indentationFactor = indentationPerLevel * level;
|
||||
imageCell = [[NSCell alloc] initImageCell: image];
|
||||
imageRect = [outlineView frameOfOutlineCellAtRow: rowIndex];
|
||||
|
||||
|
||||
if ([delegate respondsToSelector: @selector(outlineView:willDisplayOutlineCell:forTableColumn:item:)])
|
||||
{
|
||||
[delegate outlineView: outlineView
|
||||
|
@ -3537,7 +3497,7 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
forTableColumn: tb
|
||||
item: item];
|
||||
}
|
||||
|
||||
|
||||
/* Do not indent if the delegate set the image to nil. */
|
||||
if ([imageCell image])
|
||||
{
|
||||
|
@ -3554,7 +3514,7 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
drawingRect.origin.x += indentationFactor;
|
||||
drawingRect.size.width -= indentationFactor;
|
||||
}
|
||||
|
||||
|
||||
RELEASE(imageCell);
|
||||
|
||||
return drawingRect;
|
||||
|
@ -3572,13 +3532,7 @@ 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 */
|
||||
|
@ -3588,10 +3542,9 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
return;
|
||||
}
|
||||
|
||||
[self _calculatedStartingColumn: &startingColumn
|
||||
endingColumn: &endingColumn
|
||||
withTableView: outlineView
|
||||
inClipRect: clipRect];
|
||||
[outlineView _calculatedStartingColumn: &startingColumn
|
||||
endingColumn: &endingColumn
|
||||
inClipRect: clipRect];
|
||||
|
||||
/* Draw the row between startingColumn and endingColumn */
|
||||
for (i = startingColumn; i <= endingColumn; i++)
|
||||
|
@ -3610,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
|
||||
|
@ -3620,13 +3573,13 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
|
||||
if (tb == outlineTableColumn)
|
||||
{
|
||||
drawingRect = [self _drawOutlineTableColumn: tb
|
||||
outlineView: outlineView
|
||||
item: item
|
||||
drawingRect: drawingRect
|
||||
rowIndex: rowIndex];
|
||||
drawingRect = [self drawOutlineCell: tb
|
||||
outlineView: outlineView
|
||||
item: item
|
||||
drawingRect: drawingRect
|
||||
rowIndex: rowIndex];
|
||||
}
|
||||
|
||||
|
||||
[cell drawWithFrame: drawingRect inView: outlineView];
|
||||
if (i == editedColumn && rowIndex == editedRow)
|
||||
{
|
||||
|
@ -3636,130 +3589,6 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
}
|
||||
}
|
||||
|
||||
- (id) _prototypeCellViewFromTableColumn: (NSTableColumn *)tb
|
||||
{
|
||||
NSArray *protoCellViews = [tb _prototypeCellViews];
|
||||
id view = nil;
|
||||
|
||||
// it seems there is always one prototype...
|
||||
if ([protoCellViews count] > 0)
|
||||
{
|
||||
view = [protoCellViews objectAtIndex: 0];
|
||||
view = [view copy]; // instantiate the prototype...
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
- (void) drawCellViewRow: (NSInteger)rowIndex
|
||||
clipRect: (NSRect)clipRect
|
||||
inView: (NSTableView *)v
|
||||
{
|
||||
NSArray *tableColumns = [v tableColumns];
|
||||
NSInteger numberOfRows = [v numberOfRows];
|
||||
NSInteger startingColumn;
|
||||
NSInteger endingColumn;
|
||||
NSInteger i;
|
||||
id dataSource = [v dataSource];
|
||||
id delegate = [v delegate];
|
||||
BOOL hasMethod = NO;
|
||||
NSTableColumn *outlineTableColumn = nil;
|
||||
NSOutlineView *ov = nil;
|
||||
|
||||
// If we have no data source, there is nothing to do...
|
||||
if (dataSource == nil)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// If the rowIndex is greater than the numberOfRows, done...
|
||||
if (rowIndex >= numberOfRows)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Check the delegate method...
|
||||
hasMethod = [delegate respondsToSelector: @selector(outlineView:viewForTableColumn:item:)];
|
||||
if (hasMethod)
|
||||
{
|
||||
ov = (NSOutlineView *)v;
|
||||
outlineTableColumn = [ov outlineTableColumn];
|
||||
}
|
||||
else
|
||||
{
|
||||
hasMethod = [delegate respondsToSelector: @selector(tableView:viewForTableColumn:row:)];
|
||||
}
|
||||
|
||||
[self _calculatedStartingColumn: &startingColumn
|
||||
endingColumn: &endingColumn
|
||||
withTableView: v
|
||||
inClipRect: clipRect];
|
||||
|
||||
/* Draw the row between startingColumn and endingColumn */
|
||||
for (i = startingColumn; i <= endingColumn; i++)
|
||||
{
|
||||
NSRect drawingRect = [v frameOfCellAtColumn: i
|
||||
row: rowIndex];
|
||||
NSTableColumn *tb = [tableColumns objectAtIndex: i];
|
||||
NSIndexPath *path = [NSIndexPath indexPathForItem: i
|
||||
inSection: rowIndex];
|
||||
NSView *view = [v _renderedViewForPath: path];
|
||||
|
||||
if (ov != nil)
|
||||
{
|
||||
id item = [ov itemAtRow: rowIndex];
|
||||
|
||||
if (tb == outlineTableColumn)
|
||||
{
|
||||
drawingRect = [self _drawOutlineTableColumn: tb
|
||||
outlineView: ov
|
||||
item: item
|
||||
drawingRect: drawingRect
|
||||
rowIndex: rowIndex];
|
||||
}
|
||||
|
||||
if (view == nil)
|
||||
{
|
||||
if (hasMethod)
|
||||
{
|
||||
view = [delegate outlineView: ov
|
||||
viewForTableColumn: tb
|
||||
item: item];
|
||||
}
|
||||
else
|
||||
{
|
||||
view = [self _prototypeCellViewFromTableColumn: tb];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the view has been stored use it, if not
|
||||
// then grab it.
|
||||
if (view == nil)
|
||||
{
|
||||
if (hasMethod)
|
||||
{
|
||||
view = [delegate tableView: v
|
||||
viewForTableColumn: tb
|
||||
row: rowIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
view = [self _prototypeCellViewFromTableColumn: tb];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Store the object...
|
||||
[v _setRenderedView: view forPath: path];
|
||||
[v addSubview: view];
|
||||
|
||||
// Place the view...
|
||||
[view setFrame: drawingRect];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) isBoxOpaque: (NSBox *)box
|
||||
{
|
||||
if ([box boxType] == NSBoxCustom)
|
||||
|
|
|
@ -418,5 +418,11 @@
|
|||
[[menu menuRepresentation] update];
|
||||
[menu sizeToFit];
|
||||
}
|
||||
|
||||
- (BOOL) proposedVisibility: (BOOL)visible
|
||||
forMenu: (NSMenu *) menu
|
||||
{
|
||||
return visible;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -330,6 +330,9 @@ static NSArray *XmlBoolDefaultYes = nil;
|
|||
@"shadow", @"NSViewShadow",
|
||||
@"blurRadius", @"NSShadowBlurRadius",
|
||||
@"color", @"NSShadowColor",
|
||||
@"childrenKeyPath", @"NSTreeContentChildrenKey", // NSTreeController
|
||||
@"countKeyPath", @"NSTreeContentCountKey",
|
||||
@"leafKeyPath", @"NSTreeContentLeafKey",
|
||||
nil];
|
||||
RETAIN(XmlKeyMapTable);
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -147,6 +147,7 @@
|
|||
if (self == [NSArrayController class])
|
||||
{
|
||||
[self exposeBinding: NSContentArrayBinding];
|
||||
[self exposeBinding: NSSelectionIndexesBinding];
|
||||
[self setKeys: [NSArray arrayWithObjects: NSContentBinding, NSContentObjectBinding, nil]
|
||||
triggerChangeNotificationsForDependentKey: @"arrangedObjects"];
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Copyright (C) 1999, 2005 Free Software Foundation, Inc.
|
||||
|
||||
Author: Enrico Sersale <enrico@imago.ro>
|
||||
Author: Enrico Sersale
|
||||
Date: Dec 1999
|
||||
Modified: Fred Kiefer <FredKiefer@gmx.de>
|
||||
Date: January 2001
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
1766
Source/NSBrowser.m
1766
Source/NSBrowser.m
File diff suppressed because it is too large
Load diff
|
@ -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]];
|
||||
|
|
|
@ -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"])
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -122,6 +122,7 @@ static NSNotificationCenter *nc;
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
[GSKeyValueBinding unbindAllForObject: self];
|
||||
RELEASE(_cell);
|
||||
[super dealloc];
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -213,62 +213,82 @@
|
|||
|
||||
if ([viewer isEqual: @"NSHelpPanel"] == NO)
|
||||
{
|
||||
if (viewer && [viewer length] > 0)
|
||||
{
|
||||
NSDictionary *apps = [ws infoForExtension: ext];
|
||||
NSDictionary *appInfo;
|
||||
|
||||
// Let's try to be lenient if Viewer was set instead of Viewer.app
|
||||
if ([[viewer pathExtension] length] == 0)
|
||||
viewer = [viewer stringByAppendingPathExtension: @"app"];
|
||||
appInfo = [apps objectForKey: viewer];
|
||||
|
||||
// We ingore the role, supposing both Editor and Viewer are fine
|
||||
if (nil == appInfo)
|
||||
{
|
||||
NSWarnLog(@"Designated viewer %@ is not registered for %@", viewer, ext);
|
||||
viewer = nil;
|
||||
}
|
||||
}
|
||||
if ([viewer length] == 0)
|
||||
{
|
||||
viewer = [ws getBestAppInRole: @"Viewer" forExtension: ext];
|
||||
}
|
||||
if (viewer != nil)
|
||||
{
|
||||
result = [[NSWorkspace sharedWorkspace] openFile: file
|
||||
withApplication: viewer];
|
||||
return;
|
||||
result = [ws openFile: file
|
||||
withApplication: viewer];
|
||||
}
|
||||
}
|
||||
|
||||
if (result == NO)
|
||||
{
|
||||
NSHelpPanel *panel;
|
||||
NSTextView *tv;
|
||||
id object = nil;
|
||||
// external viewer succeeded
|
||||
if (result)
|
||||
return;
|
||||
|
||||
panel = [NSHelpPanel sharedHelpPanel];
|
||||
tv = [(NSScrollView*)[panel contentView] documentView];
|
||||
if (ext == nil
|
||||
// fallback to internal viewer
|
||||
{
|
||||
NSHelpPanel *panel;
|
||||
NSTextView *tv;
|
||||
id object = nil;
|
||||
|
||||
panel = [NSHelpPanel sharedHelpPanel];
|
||||
tv = [(NSScrollView*)[panel contentView] documentView];
|
||||
if (ext == nil
|
||||
|| [ext isEqualToString: @""]
|
||||
|| [ext isEqualToString: @"txt"]
|
||||
|| [ext isEqualToString: @"text"])
|
||||
{
|
||||
object = [NSString stringWithContentsOfFile: file];
|
||||
}
|
||||
else if ([ext isEqualToString: @"rtf"])
|
||||
{
|
||||
NSData *data = [NSData dataWithContentsOfFile: file];
|
||||
{
|
||||
object = [NSString stringWithContentsOfFile: file];
|
||||
}
|
||||
else if ([ext isEqualToString: @"rtf"])
|
||||
{
|
||||
NSData *data = [NSData dataWithContentsOfFile: file];
|
||||
|
||||
object = [[NSAttributedString alloc] initWithRTF: data
|
||||
documentAttributes: 0];
|
||||
AUTORELEASE (object);
|
||||
}
|
||||
else if ([ext isEqualToString: @"rtfd"])
|
||||
{
|
||||
NSFileWrapper *wrapper;
|
||||
object = [[NSAttributedString alloc] initWithRTF: data
|
||||
documentAttributes: 0];
|
||||
AUTORELEASE (object);
|
||||
}
|
||||
else if ([ext isEqualToString: @"rtfd"])
|
||||
{
|
||||
NSFileWrapper *wrapper;
|
||||
|
||||
wrapper = [[NSFileWrapper alloc] initWithPath: file];
|
||||
AUTORELEASE (wrapper);
|
||||
object = [[NSAttributedString alloc]
|
||||
initWithRTFDFileWrapper: wrapper
|
||||
documentAttributes: 0];
|
||||
AUTORELEASE (object);
|
||||
}
|
||||
wrapper = [[NSFileWrapper alloc] initWithPath: file];
|
||||
AUTORELEASE (wrapper);
|
||||
object = [[NSAttributedString alloc]
|
||||
initWithRTFDFileWrapper: wrapper
|
||||
documentAttributes: 0];
|
||||
AUTORELEASE (object);
|
||||
}
|
||||
|
||||
if (object != nil)
|
||||
{
|
||||
[[tv textStorage] setAttributedString: object];
|
||||
[tv sizeToFit];
|
||||
}
|
||||
[tv setNeedsDisplay: YES];
|
||||
[panel makeKeyAndOrderFront: self];
|
||||
return;
|
||||
}
|
||||
if (object != nil)
|
||||
{
|
||||
[[tv textStorage] setAttributedString: object];
|
||||
[tv sizeToFit];
|
||||
}
|
||||
[tv setNeedsDisplay: YES];
|
||||
[panel makeKeyAndOrderFront: self];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
86
Source/NSMenuToolbarItem.m
Normal file
86
Source/NSMenuToolbarItem.m
Normal file
|
@ -0,0 +1,86 @@
|
|||
/* Implementation of class NSMenuToolbarItem
|
||||
Copyright (C) 2024 Free Software Foundation, Inc.
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: 03-05-2024
|
||||
|
||||
This file is part of the GNUstep Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110 USA.
|
||||
*/
|
||||
|
||||
#import "AppKit/NSMenuToolbarItem.h"
|
||||
#import "AppKit/NSMenu.h"
|
||||
#import "AppKit/NSImage.h"
|
||||
|
||||
#import "GNUstepGUI/GSTheme.h"
|
||||
|
||||
@implementation NSMenuToolbarItem
|
||||
|
||||
- (instancetype) initWithItemIdentifier: (NSString *)identifier
|
||||
{
|
||||
self = [super initWithItemIdentifier: identifier];
|
||||
if (self != nil)
|
||||
{
|
||||
[self setImage: [NSImage imageNamed: @"NSMenuToolbarItem"]];
|
||||
[self setTarget: self];
|
||||
[self setAction: @selector(_showMenu:)];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(_menu);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (BOOL) showsIndicator
|
||||
{
|
||||
return _showsIndicator;
|
||||
}
|
||||
|
||||
- (void) setShowsIndicator: (BOOL)flag
|
||||
{
|
||||
_showsIndicator = flag;
|
||||
|
||||
if (_showsIndicator == YES)
|
||||
{
|
||||
[self setImage: [NSImage imageNamed: @"NSMenuToolbarItem"]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self setImage: nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSMenu *) menu
|
||||
{
|
||||
return _menu;
|
||||
}
|
||||
|
||||
- (void) setMenu: (NSMenu *)menu
|
||||
{
|
||||
ASSIGN(_menu, menu);
|
||||
}
|
||||
|
||||
- (void) _showMenu: (id)sender
|
||||
{
|
||||
[[GSTheme theme] rightMouseDisplay: _menu
|
||||
forEvent: nil];
|
||||
}
|
||||
|
||||
@end
|
|
@ -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];
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -133,6 +133,20 @@ static NSPrintInfo *sharedPrintInfo = nil;
|
|||
[[principalClass printInfoClass] setDefaultPrinter: printer];
|
||||
}
|
||||
|
||||
- (void) _updateMargins
|
||||
{
|
||||
NSPrinter *printer = [self printer];
|
||||
NSRect imageableRect;
|
||||
NSSize paperSize;
|
||||
|
||||
paperSize = [printer pageSizeForPaper: [self paperName]];
|
||||
imageableRect = [printer imageRectForPaper: [self paperName]];
|
||||
[self setRightMargin: (paperSize.width - NSMaxX(imageableRect))];
|
||||
[self setLeftMargin: imageableRect.origin.y];
|
||||
[self setTopMargin: (paperSize.height - NSMaxY(imageableRect))];
|
||||
[self setBottomMargin: imageableRect.origin.x];
|
||||
}
|
||||
|
||||
//
|
||||
// Instance methods
|
||||
//
|
||||
|
@ -143,8 +157,6 @@ static NSPrintInfo *sharedPrintInfo = nil;
|
|||
{
|
||||
NSPrinter *printer;
|
||||
NSString *pageSize;
|
||||
NSRect imageRect;
|
||||
NSSize paperSize;
|
||||
|
||||
if (!(self = [super init]))
|
||||
{
|
||||
|
@ -174,14 +186,10 @@ static NSPrintInfo *sharedPrintInfo = nil;
|
|||
[self setPaperName: pageSize];
|
||||
|
||||
/* Set default margins. */
|
||||
paperSize = [printer pageSizeForPaper: pageSize];
|
||||
imageRect = [printer imageRectForPaper: pageSize];
|
||||
[self setRightMargin: (paperSize.width - NSMaxX(imageRect))];
|
||||
[self setLeftMargin: imageRect.origin.y];
|
||||
[self setTopMargin: (paperSize.height - NSMaxY(imageRect))];
|
||||
[self setBottomMargin: imageRect.origin.x];
|
||||
[self setOrientation: NSPortraitOrientation];
|
||||
|
||||
[self _updateMargins];
|
||||
|
||||
[self setOrientation: NSPortraitOrientation];
|
||||
|
||||
if (aDict != nil)
|
||||
{
|
||||
[_info addEntriesFromDictionary: aDict];
|
||||
|
@ -293,6 +301,7 @@ static NSPrintInfo *sharedPrintInfo = nil;
|
|||
[_info setObject: [NSValue valueWithSize:
|
||||
[NSPrintInfo sizeForPaperName: name]]
|
||||
forKey: NSPrintPaperSize];
|
||||
[self _updateMargins];
|
||||
}
|
||||
|
||||
- (void) setPaperSize: (NSSize)size
|
||||
|
|
|
@ -658,6 +658,11 @@ double _doubleValueForMousePoint (NSPoint point, NSRect knobRect,
|
|||
}
|
||||
}
|
||||
|
||||
- (NSInteger) integerValue
|
||||
{
|
||||
return (NSInteger)_value;
|
||||
}
|
||||
|
||||
- (id) objectValue
|
||||
{
|
||||
return [NSNumber numberWithDouble: _value];
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
Copyright (C) 2002, 2009 Free Software Foundation, Inc.
|
||||
|
||||
Author: Enrico Sersale <enrico@imago.ro>,
|
||||
Stefan Bidigaray <stefanbidi@gmail.com>
|
||||
Author: Enrico Sersale
|
||||
Stefan Bidigaray <stefanbidi@gmail.com>
|
||||
Date: Jul 2002, Jul 2009
|
||||
|
||||
This file is part of the GNUstep GUI Library.
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/* Implementation of class NSTableRowView
|
||||
Copyright (C) 2022 Free Software Foundation, Inc.
|
||||
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: 03-09-2022
|
||||
|
||||
This file is part of the GNUstep Library.
|
||||
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
|
@ -26,5 +26,145 @@
|
|||
|
||||
@implementation NSTableRowView
|
||||
|
||||
@end
|
||||
- (BOOL) isEmphasized
|
||||
{
|
||||
return _emphasized;
|
||||
}
|
||||
|
||||
- (void) setEmphasized: (BOOL)flag
|
||||
{
|
||||
_emphasized = flag;
|
||||
}
|
||||
|
||||
- (NSBackgroundStyle) interiorBackgroundStyle
|
||||
{
|
||||
return _interiorBackgroundStyle;
|
||||
}
|
||||
|
||||
- (BOOL) isFloating
|
||||
{
|
||||
return _floating;
|
||||
}
|
||||
|
||||
- (void) setFloating: (BOOL)flag
|
||||
{
|
||||
_floating = flag;
|
||||
}
|
||||
|
||||
- (BOOL) isSelected
|
||||
{
|
||||
return _selected;
|
||||
}
|
||||
|
||||
- (void) setSelected: (BOOL)flag
|
||||
{
|
||||
_selected = flag;
|
||||
}
|
||||
|
||||
- (NSTableViewSelectionHighlightStyle) selectionHighlightStyle
|
||||
{
|
||||
return _selectionHighlightStyle;
|
||||
}
|
||||
|
||||
- (void) setSelectionHighlightStyle: (NSTableViewSelectionHighlightStyle) selectionHighlightStyle
|
||||
{
|
||||
_selectionHighlightStyle = selectionHighlightStyle;
|
||||
}
|
||||
|
||||
- (NSTableViewDraggingDestinationFeedbackStyle) draggingDestinationFeedbackStyle
|
||||
{
|
||||
return _draggingDestinationFeedbackStyle;
|
||||
}
|
||||
|
||||
- (void) setTableViewDraggingDestinationFeedbackStyle: (NSTableViewDraggingDestinationFeedbackStyle) draggingDestinationFeedbackStyle
|
||||
{
|
||||
_draggingDestinationFeedbackStyle = draggingDestinationFeedbackStyle;
|
||||
}
|
||||
|
||||
- (CGFloat) indentationForDropOperation
|
||||
{
|
||||
return _indentationForDropOperation;
|
||||
}
|
||||
|
||||
- (void) setIndentationForDropOperation: (CGFloat)indentationForDropOperation
|
||||
{
|
||||
_indentationForDropOperation = indentationForDropOperation;
|
||||
}
|
||||
|
||||
- (BOOL) targetForDropOperation
|
||||
{
|
||||
return _targetForDropOperation;
|
||||
}
|
||||
|
||||
- (void) setTargetForDropOperation: (BOOL)flag
|
||||
{
|
||||
_targetForDropOperation = flag;
|
||||
}
|
||||
|
||||
- (BOOL) groupRowStyle
|
||||
{
|
||||
return _groupRowStyle;
|
||||
}
|
||||
|
||||
- (void) setGroupRowStyle: (BOOL)flag
|
||||
{
|
||||
_groupRowStyle = flag;
|
||||
}
|
||||
|
||||
- (NSInteger) numberOfColumns
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (NSColor *) backgroundColor
|
||||
{
|
||||
return _backgroundColor;
|
||||
}
|
||||
|
||||
- (void) setBackgroundColor: (NSColor *)color
|
||||
{
|
||||
ASSIGN(_backgroundColor, color);
|
||||
}
|
||||
|
||||
- (void) drawBackgroundInRect: (NSRect)dirtyRect
|
||||
{
|
||||
}
|
||||
|
||||
- (void) drawDraggingDestinationFeedbackInRect: (NSRect)dirtyRect
|
||||
{
|
||||
}
|
||||
|
||||
- (void) drawSelectionInRect: (NSRect)dirtyRect
|
||||
{
|
||||
}
|
||||
|
||||
- (void) drawSeparatorInRect: (NSRect)dirtyRect
|
||||
{
|
||||
}
|
||||
|
||||
- (id) viewAtColumn: (NSInteger)column
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL) isNextRowSelected
|
||||
{
|
||||
return _nextRowSelected;
|
||||
}
|
||||
|
||||
- (void) setNextRowSelected: (BOOL)flag
|
||||
{
|
||||
_nextRowSelected = flag;
|
||||
}
|
||||
|
||||
- (BOOL) isPreviousRowSelected
|
||||
{
|
||||
return _previousRowSelected;
|
||||
}
|
||||
|
||||
- (void) setPreviousRowSelected: (BOOL)flag
|
||||
{
|
||||
_previousRowSelected = flag;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
2297
Source/NSTableView.m
2297
Source/NSTableView.m
File diff suppressed because it is too large
Load diff
|
@ -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];
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -5172,6 +5172,8 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level)
|
|||
|
||||
- (void) layout
|
||||
{
|
||||
_needsLayout = NO;
|
||||
|
||||
GSAutoLayoutEngine *engine = [self _layoutEngine];
|
||||
if (!engine)
|
||||
{
|
||||
|
@ -5307,7 +5309,6 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level)
|
|||
if (_needsLayout)
|
||||
{
|
||||
[self layout];
|
||||
_needsLayout = NO;
|
||||
}
|
||||
|
||||
NSArray *subviews = [self subviews];
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -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";
|
||||
|
|
45
Tests/gui/GSCodingFlags/GSCellFlags.m
Normal file
45
Tests/gui/GSCodingFlags/GSCellFlags.m
Normal 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;
|
||||
}
|
0
Tests/gui/GSCodingFlags/TestInfo
Normal file
0
Tests/gui/GSCodingFlags/TestInfo
Normal file
|
@ -10,49 +10,60 @@
|
|||
|
||||
int main()
|
||||
{
|
||||
START_SET("GSXib5KeyedUnarchiver NSButtonCell tests")
|
||||
START_SET("GSXib5KeyedUnarchiver NSButtonCell tests")
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
[NSApplication sharedApplication];
|
||||
}
|
||||
{
|
||||
[NSApplication sharedApplication];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
if ([[localException name] isEqualToString: NSInternalInconsistencyException ])
|
||||
SKIP("It looks like GNUstep backend is not yet installed")
|
||||
}
|
||||
{
|
||||
if ([[localException name]
|
||||
isEqualToString: NSInternalInconsistencyException ])
|
||||
{
|
||||
SKIP("It looks like GNUstep backend is not yet installed")
|
||||
}
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
|
||||
NSData* data = [NSData dataWithContentsOfFile:@"ButtonCell.xib"];
|
||||
GSXibKeyedUnarchiver* unarchiver = [GSXibKeyedUnarchiver unarchiverForReadingWithData:data];
|
||||
NSData *data;
|
||||
GSXibKeyedUnarchiver *unarchiver;
|
||||
NSArray *rootObjects;
|
||||
NSEnumerator *enumerator;
|
||||
NSMatrix *matrix;
|
||||
id element;
|
||||
|
||||
NSArray *rootObjects;
|
||||
data = [NSData dataWithContentsOfFile: @"ButtonCell.xib"];
|
||||
unarchiver = [GSXibKeyedUnarchiver unarchiverForReadingWithData:data];
|
||||
rootObjects = [unarchiver decodeObjectForKey: @"IBDocument.RootObjects"];
|
||||
|
||||
NSMatrix* matrix;
|
||||
|
||||
for (id element in rootObjects) {
|
||||
if ([element isKindOfClass:[NSMatrix class]]) {
|
||||
enumerator = [rootObjects objectEnumerator];
|
||||
while ((element = [enumerator nextObject]) != nil)
|
||||
{
|
||||
if ([element isKindOfClass: [NSMatrix class]])
|
||||
{
|
||||
matrix = (NSMatrix*)element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PASS(matrix != nil, "Top-level NSMatrix was found");
|
||||
PASS(matrix != nil, "Top-level NSMatrix was found")
|
||||
|
||||
NSArray* cells = [matrix cells];
|
||||
NSArray *cells = [matrix cells];
|
||||
|
||||
// <modifierMask key="keyEquivalentModifierMask" shift="YES"/> node
|
||||
PASS_MODIFIER(0, NSShiftKeyMask);
|
||||
PASS_MODIFIER(0, NSShiftKeyMask)
|
||||
|
||||
// <modifierMask key="keyEquivalentModifierMask" command="YES"/> node
|
||||
PASS_MODIFIER(1, NSCommandKeyMask);
|
||||
PASS_MODIFIER(1, NSCommandKeyMask)
|
||||
|
||||
// <modifierMask key="keyEquivalentModifierMask" />
|
||||
PASS_MODIFIER(2, 0);
|
||||
PASS_MODIFIER(2, 0)
|
||||
|
||||
// Unlike NSMenuItem, the default for NSButtonCell is 0
|
||||
PASS_MODIFIER(3, 0);
|
||||
PASS_MODIFIER(3, 0)
|
||||
|
||||
END_SET("GSXib5KeyedUnarchiver NSButtonCell tests")
|
||||
END_SET("GSXib5KeyedUnarchiver NSButtonCell tests")
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -9,56 +9,67 @@
|
|||
|
||||
int main()
|
||||
{
|
||||
START_SET("GSXib5KeyedUnarchiver NSMenu tests")
|
||||
START_SET("GSXib5KeyedUnarchiver NSMenu tests")
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
[NSApplication sharedApplication];
|
||||
}
|
||||
{
|
||||
[NSApplication sharedApplication];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
if ([[localException name] isEqualToString: NSInternalInconsistencyException ])
|
||||
SKIP("It looks like GNUstep backend is not yet installed")
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
{
|
||||
if ([[localException name]
|
||||
isEqualToString: NSInternalInconsistencyException ])
|
||||
{
|
||||
SKIP("It looks like GNUstep backend is not yet installed")
|
||||
}
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
|
||||
NSData *data;
|
||||
GSXibKeyedUnarchiver *unarchiver;
|
||||
NSArray *rootObjects;
|
||||
NSEnumerator *enumerator;
|
||||
id element;
|
||||
NSMenu *menu;
|
||||
|
||||
NSData* data = [NSData dataWithContentsOfFile:@"Menu.xib"];
|
||||
GSXibKeyedUnarchiver* unarchiver = [GSXibKeyedUnarchiver unarchiverForReadingWithData:data];
|
||||
|
||||
NSArray *rootObjects;
|
||||
data = [NSData dataWithContentsOfFile:@"Menu.xib"];
|
||||
unarchiver = [GSXibKeyedUnarchiver unarchiverForReadingWithData:data];
|
||||
rootObjects = [unarchiver decodeObjectForKey: @"IBDocument.RootObjects"];
|
||||
enumerator = [rootObjects objectEnumerator];
|
||||
|
||||
NSMenu* menu;
|
||||
|
||||
for (id element in rootObjects) {
|
||||
if ([element isKindOfClass:[NSMenu class]]) {
|
||||
while ((element = [enumerator nextObject]) != nil)
|
||||
{
|
||||
if ([element isKindOfClass: [NSMenu class]])
|
||||
{
|
||||
menu = (NSMenu*)element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PASS(menu != nil, "Top-level NSMenu was found");
|
||||
PASS(menu != nil, "Top-level NSMenu was found")
|
||||
|
||||
|
||||
// Empty <modifierMask key="keyEquivalentModifierMask"/> node
|
||||
PASS_MODIFIER(0, 0);
|
||||
PASS_MODIFIER(0, 0)
|
||||
// <modifierMask key="keyEquivalentModifierMask" shift="YES"/>
|
||||
PASS_MODIFIER(1, NSShiftKeyMask);
|
||||
PASS_MODIFIER(1, NSShiftKeyMask)
|
||||
// <modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
PASS_MODIFIER(2, NSCommandKeyMask);
|
||||
PASS_MODIFIER(2, NSCommandKeyMask)
|
||||
// <modifierMask key="keyEquivalentModifierMask" option="YES"/>
|
||||
PASS_MODIFIER(3, NSAlternateKeyMask);
|
||||
PASS_MODIFIER(3, NSAlternateKeyMask)
|
||||
// No modifierMask element
|
||||
PASS_MODIFIER(4, NSCommandKeyMask);
|
||||
PASS_MODIFIER(4, NSCommandKeyMask)
|
||||
// No modifierMask element and no keyEquivalent attribute
|
||||
PASS_MODIFIER(5, NSCommandKeyMask);
|
||||
PASS_MODIFIER(5, NSCommandKeyMask)
|
||||
|
||||
// no modfierMask
|
||||
PASS_MODIFIER(6, NSCommandKeyMask);
|
||||
PASS_MODIFIER(6, NSCommandKeyMask)
|
||||
// empty modifierMask
|
||||
PASS_MODIFIER(7, 0);
|
||||
PASS_MODIFIER(7, 0)
|
||||
// explicit modifier mask
|
||||
PASS_MODIFIER(8, NSCommandKeyMask);
|
||||
PASS_MODIFIER(8, NSCommandKeyMask)
|
||||
|
||||
END_SET("GSXib5KeyedUnarchiver NSMenu tests")
|
||||
END_SET("GSXib5KeyedUnarchiver NSMenu tests")
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -11,159 +11,159 @@ copyright 2004 Alexander Malmberg <alexander@malmberg.org>
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSBezierPath *p=[[NSBezierPath alloc] init];
|
||||
NSRect r;
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSBezierPath *p=[[NSBezierPath alloc] init];
|
||||
NSRect r;
|
||||
|
||||
pass(NSIsEmptyRect([p bounds]),"empty path gives empty bounds");
|
||||
pass(NSIsEmptyRect([p bounds]),"empty path gives empty bounds");
|
||||
|
||||
[p moveToPoint: NSMakePoint(100,100)];
|
||||
[p lineToPoint: NSMakePoint(150,150)];
|
||||
[p moveToPoint: NSMakePoint(100,100)];
|
||||
[p lineToPoint: NSMakePoint(150,150)];
|
||||
|
||||
pass(NSEqualRects([p bounds],NSMakeRect(100,100,50,50)),"bounds accuracy (1)");
|
||||
pass(NSEqualRects([p controlPointBounds],NSMakeRect(100,100,50,50)),"control-point bounds accuracy (1)");
|
||||
pass(NSEqualRects([p bounds],NSMakeRect(100,100,50,50)),"bounds accuracy (1)");
|
||||
pass(NSEqualRects([p controlPointBounds],NSMakeRect(100,100,50,50)),"control-point bounds accuracy (1)");
|
||||
|
||||
[p removeAllPoints];
|
||||
pass(NSIsEmptyRect([p bounds]),"empty path gives empty bounds (2)");
|
||||
[p removeAllPoints];
|
||||
pass(NSIsEmptyRect([p bounds]),"empty path gives empty bounds (2)");
|
||||
|
||||
[p moveToPoint: NSMakePoint(100,100)];
|
||||
[p curveToPoint: NSMakePoint(200,100)
|
||||
controlPoint1: NSMakePoint(125,50)
|
||||
controlPoint2: NSMakePoint(175,150)];
|
||||
[p moveToPoint: NSMakePoint(100,100)];
|
||||
[p curveToPoint: NSMakePoint(200,100)
|
||||
controlPoint1: NSMakePoint(125,50)
|
||||
controlPoint2: NSMakePoint(175,150)];
|
||||
|
||||
/* Basic checking Y. */
|
||||
r=[p bounds];
|
||||
if (fabs(r.origin.x - 100.0000) > 0.001 ||
|
||||
fabs(r.origin.y - 85.5662) > 0.001 ||
|
||||
fabs(r.size.width - 100.0000) > 0.001 ||
|
||||
fabs(r.size.height - 28.8678) > 0.001)
|
||||
{
|
||||
pass(0,"bounds accuracy (2)");
|
||||
printf("expected %s, got %s\n",
|
||||
[NSStringFromRect(NSMakeRect(100.0000, 85.5662, 100.0000, 28.8678)) lossyCString],
|
||||
[NSStringFromRect(r) lossyCString]);
|
||||
}
|
||||
else
|
||||
pass(1,"bounds accuracy (2)");
|
||||
/* Basic checking Y. */
|
||||
r=[p bounds];
|
||||
if (fabs(r.origin.x - 100.0000) > 0.001 ||
|
||||
fabs(r.origin.y - 85.5662) > 0.001 ||
|
||||
fabs(r.size.width - 100.0000) > 0.001 ||
|
||||
fabs(r.size.height - 28.8678) > 0.001)
|
||||
{
|
||||
pass(0,"bounds accuracy (2)");
|
||||
printf("expected %s, got %s\n",
|
||||
[NSStringFromRect(NSMakeRect(100.0000, 85.5662, 100.0000, 28.8678)) lossyCString],
|
||||
[NSStringFromRect(r) lossyCString]);
|
||||
}
|
||||
else
|
||||
pass(1,"bounds accuracy (2)");
|
||||
|
||||
pass(NSEqualRects([p controlPointBounds],NSMakeRect(100,50,100,100)),"control-point bounds accuracy (2)");
|
||||
pass(NSEqualRects([p controlPointBounds],NSMakeRect(100,50,100,100)),"control-point bounds accuracy (2)");
|
||||
|
||||
/* Basic checking X. */
|
||||
[p removeAllPoints];
|
||||
[p moveToPoint: NSMakePoint(100,100)];
|
||||
[p curveToPoint: NSMakePoint(100,200)
|
||||
controlPoint1: NSMakePoint(50,125)
|
||||
controlPoint2: NSMakePoint(150,175)];
|
||||
/* Basic checking X. */
|
||||
[p removeAllPoints];
|
||||
[p moveToPoint: NSMakePoint(100,100)];
|
||||
[p curveToPoint: NSMakePoint(100,200)
|
||||
controlPoint1: NSMakePoint(50,125)
|
||||
controlPoint2: NSMakePoint(150,175)];
|
||||
|
||||
r=[p bounds];
|
||||
if (fabs(r.origin.y - 100.0000) > 0.001 ||
|
||||
fabs(r.origin.x - 85.5662) > 0.001 ||
|
||||
fabs(r.size.height - 100.0000) > 0.001 ||
|
||||
fabs(r.size.width - 28.8678) > 0.001)
|
||||
{
|
||||
pass(0,"bounds accuracy (3)");
|
||||
printf("expected %s, got %s\n",
|
||||
[NSStringFromRect(NSMakeRect(85.5662, 100.0000, 28.8678, 100.0000)) lossyCString],
|
||||
[NSStringFromRect(r) lossyCString]);
|
||||
}
|
||||
else
|
||||
pass(1,"bounds accuracy (3)");
|
||||
r=[p bounds];
|
||||
if (fabs(r.origin.y - 100.0000) > 0.001 ||
|
||||
fabs(r.origin.x - 85.5662) > 0.001 ||
|
||||
fabs(r.size.height - 100.0000) > 0.001 ||
|
||||
fabs(r.size.width - 28.8678) > 0.001)
|
||||
{
|
||||
pass(0,"bounds accuracy (3)");
|
||||
printf("expected %s, got %s\n",
|
||||
[NSStringFromRect(NSMakeRect(85.5662, 100.0000, 28.8678, 100.0000)) lossyCString],
|
||||
[NSStringFromRect(r) lossyCString]);
|
||||
}
|
||||
else
|
||||
pass(1,"bounds accuracy (3)");
|
||||
|
||||
|
||||
/* A bit of both, and extreme values beyond the initial points. */
|
||||
[p removeAllPoints];
|
||||
[p moveToPoint: NSMakePoint(-100,0)];
|
||||
[p curveToPoint: NSMakePoint(100,0)
|
||||
controlPoint1: NSMakePoint(-118.2, 10.393)
|
||||
controlPoint2: NSMakePoint( 118.2,-10.393)];
|
||||
/* A bit of both, and extreme values beyond the initial points. */
|
||||
[p removeAllPoints];
|
||||
[p moveToPoint: NSMakePoint(-100,0)];
|
||||
[p curveToPoint: NSMakePoint(100,0)
|
||||
controlPoint1: NSMakePoint(-118.2, 10.393)
|
||||
controlPoint2: NSMakePoint( 118.2,-10.393)];
|
||||
|
||||
r=[p bounds];
|
||||
if (fabs(r.origin.x + 101.0) > 0.001 ||
|
||||
fabs(r.origin.y + 3.0) > 0.001 ||
|
||||
fabs(r.size.width - 202.0) > 0.001 ||
|
||||
fabs(r.size.height - 6.0) > 0.001)
|
||||
{
|
||||
pass(0,"bounds accuracy (4)");
|
||||
printf("expected %s, got %s\n",
|
||||
[NSStringFromRect(NSMakeRect(-101.0, -3.0, 202.0, 6.0)) lossyCString],
|
||||
[NSStringFromRect(r) lossyCString]);
|
||||
}
|
||||
else
|
||||
pass(1,"bounds accuracy (4)");
|
||||
r=[p bounds];
|
||||
if (fabs(r.origin.x + 101.0) > 0.001 ||
|
||||
fabs(r.origin.y + 3.0) > 0.001 ||
|
||||
fabs(r.size.width - 202.0) > 0.001 ||
|
||||
fabs(r.size.height - 6.0) > 0.001)
|
||||
{
|
||||
pass(0,"bounds accuracy (4)");
|
||||
printf("expected %s, got %s\n",
|
||||
[NSStringFromRect(NSMakeRect(-101.0, -3.0, 202.0, 6.0)) lossyCString],
|
||||
[NSStringFromRect(r) lossyCString]);
|
||||
}
|
||||
else
|
||||
pass(1,"bounds accuracy (4)");
|
||||
|
||||
|
||||
/* Check the control-point bounding box. */
|
||||
r=[p controlPointBounds];
|
||||
if (fabs(r.origin.x + 118.2 ) > 0.001 ||
|
||||
fabs(r.origin.y + 10.393) > 0.001 ||
|
||||
fabs(r.size.width - 236.4 ) > 0.001 ||
|
||||
fabs(r.size.height - 20.786) > 0.001)
|
||||
{
|
||||
pass(0,"control-point bounds accuracy (3)");
|
||||
printf("expected %s, got %s\n",
|
||||
[NSStringFromRect(NSMakeRect(-118.2, -10.393, 236.4, 20.786)) lossyCString],
|
||||
[NSStringFromRect(r) lossyCString]);
|
||||
}
|
||||
else
|
||||
pass(1,"control-point bounds accuracy (3)");
|
||||
/* Check the control-point bounding box. */
|
||||
r=[p controlPointBounds];
|
||||
if (fabs(r.origin.x + 118.2 ) > 0.001 ||
|
||||
fabs(r.origin.y + 10.393) > 0.001 ||
|
||||
fabs(r.size.width - 236.4 ) > 0.001 ||
|
||||
fabs(r.size.height - 20.786) > 0.001)
|
||||
{
|
||||
pass(0,"control-point bounds accuracy (3)");
|
||||
printf("expected %s, got %s\n",
|
||||
[NSStringFromRect(NSMakeRect(-118.2, -10.393, 236.4, 20.786)) lossyCString],
|
||||
[NSStringFromRect(r) lossyCString]);
|
||||
}
|
||||
else
|
||||
pass(1,"control-point bounds accuracy (3)");
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
|
||||
p=(1-t)^3*a + 3*(1-t)^2*t*b + 3*(1-t)*t^2*c + t^3*d
|
||||
p=(1-t)^3*a + 3*(1-t)^2*t*b + 3*(1-t)*t^2*c + t^3*d
|
||||
|
||||
c-2b+a +- sqrt(a(d-c)+b(-d-c)+c^2+b^2)
|
||||
t= --------------------------------------
|
||||
-d+3c-3b+a
|
||||
c-2b+a +- sqrt(a(d-c)+b(-d-c)+c^2+b^2)
|
||||
t= --------------------------------------
|
||||
-d+3c-3b+a
|
||||
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
if (0)
|
||||
{
|
||||
NSPoint a,b,c,d;
|
||||
double t1,t2;
|
||||
double t,ti;
|
||||
NSPoint p;
|
||||
if (0)
|
||||
{
|
||||
NSPoint a,b,c,d;
|
||||
double t1,t2;
|
||||
double t,ti;
|
||||
NSPoint p;
|
||||
|
||||
a=NSMakePoint(-100,0);
|
||||
b=NSMakePoint(-118.2,10.39);
|
||||
c=NSMakePoint(118.2,-10.39);
|
||||
d=NSMakePoint(100,0);
|
||||
a=NSMakePoint(-100,0);
|
||||
b=NSMakePoint(-118.2,10.39);
|
||||
c=NSMakePoint(118.2,-10.39);
|
||||
d=NSMakePoint(100,0);
|
||||
|
||||
#define D \
|
||||
ti=1.0-t; \
|
||||
p.x=ti*ti*ti*a.x + 3*ti*ti*t*b.x + 3*ti*t*t*c.x + t*t*t*d.x; \
|
||||
p.y=ti*ti*ti*a.y + 3*ti*ti*t*b.y + 3*ti*t*t*c.y + t*t*t*d.y; \
|
||||
printf(" t=%15.7f (%15.7f %15.7f)\n",t,p.x,p.y);
|
||||
ti=1.0-t; \
|
||||
p.x=ti*ti*ti*a.x + 3*ti*ti*t*b.x + 3*ti*t*t*c.x + t*t*t*d.x; \
|
||||
p.y=ti*ti*ti*a.y + 3*ti*ti*t*b.y + 3*ti*t*t*c.y + t*t*t*d.y; \
|
||||
printf(" t=%15.7f (%15.7f %15.7f)\n",t,p.x,p.y);
|
||||
|
||||
t=0; D
|
||||
t=1; D
|
||||
t=0.5; D
|
||||
t=0; D
|
||||
t=1; D
|
||||
t=0.5; D
|
||||
|
||||
t1=(c.x-2*b.x+a.x + sqrt(a.x*(d.x-c.x)+b.x*(-d.x-c.x)+c.x*c.x+b.x*b.x)) / (-d.x+3*c.x-3*b.x+a.x);
|
||||
t2=(c.x-2*b.x+a.x - sqrt(a.x*(d.x-c.x)+b.x*(-d.x-c.x)+c.x*c.x+b.x*b.x)) / (-d.x+3*c.x-3*b.x+a.x);
|
||||
printf("x:\n");
|
||||
t1=(c.x-2*b.x+a.x + sqrt(a.x*(d.x-c.x)+b.x*(-d.x-c.x)+c.x*c.x+b.x*b.x)) / (-d.x+3*c.x-3*b.x+a.x);
|
||||
t2=(c.x-2*b.x+a.x - sqrt(a.x*(d.x-c.x)+b.x*(-d.x-c.x)+c.x*c.x+b.x*b.x)) / (-d.x+3*c.x-3*b.x+a.x);
|
||||
printf("x:\n");
|
||||
|
||||
|
||||
t=t1;
|
||||
D
|
||||
t=t2;
|
||||
D
|
||||
t=t1;
|
||||
D
|
||||
t=t2;
|
||||
D
|
||||
|
||||
t1=(c.y-2*b.y+a.y + sqrt(a.y*(d.y-c.y)+b.y*(-d.y-c.y)+c.y*c.y+b.y*b.y)) / (-d.y+3*c.y-3*b.y+a.y);
|
||||
t2=(c.y-2*b.y+a.y - sqrt(a.y*(d.y-c.y)+b.y*(-d.y-c.y)+c.y*c.y+b.y*b.y)) / (-d.y+3*c.y-3*b.y+a.y);
|
||||
printf("y:\n");
|
||||
t=t1;
|
||||
D
|
||||
t=t2;
|
||||
D
|
||||
}
|
||||
t1=(c.y-2*b.y+a.y + sqrt(a.y*(d.y-c.y)+b.y*(-d.y-c.y)+c.y*c.y+b.y*b.y)) / (-d.y+3*c.y-3*b.y+a.y);
|
||||
t2=(c.y-2*b.y+a.y - sqrt(a.y*(d.y-c.y)+b.y*(-d.y-c.y)+c.y*c.y+b.y*b.y)) / (-d.y+3*c.y-3*b.y+a.y);
|
||||
printf("y:\n");
|
||||
t=t1;
|
||||
D
|
||||
t=t2;
|
||||
D
|
||||
}
|
||||
|
||||
// printf("bounds=%@\n",NSStringFromRect([p bounds]));
|
||||
DESTROY(p);
|
||||
DESTROY(arp);
|
||||
|
||||
DESTROY(arp);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -700,6 +700,7 @@ int main(int argc, char **argv)
|
|||
PAUSE
|
||||
}
|
||||
|
||||
DESTROY(p);
|
||||
DESTROY(arp);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -82,4 +82,6 @@ int main()
|
|||
found, expect);
|
||||
|
||||
END_SET("NSButtonCell encoding tests")
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
|
@ -62,4 +63,6 @@ int main()
|
|||
[encodedKeyMask intValue], NSShiftKeyMask)
|
||||
|
||||
END_SET("NSMenuItem key equivalent mask")
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
/* This tool opens the appropriate application from the command line
|
||||
based on what type of file is being accessed.
|
||||
|
||||
Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001-2025 Software Foundation, Inc.
|
||||
|
||||
Written by: Gregory Casamento <greg_casamento@yahoo.com>
|
||||
Written by: Gregory Casamento <greg.casamento@gmail.com>
|
||||
Riccardo Mottola <rm@gnu.org>
|
||||
Created: November 2001
|
||||
|
||||
This file is part of the GNUstep Project
|
||||
|
@ -45,11 +46,12 @@
|
|||
static NSString*
|
||||
absolutePath(NSFileManager *fm, NSString *path)
|
||||
{
|
||||
if (nil == path || [path length] == 0)
|
||||
return path;
|
||||
|
||||
if (![path isAbsolutePath])
|
||||
path = [[fm currentDirectoryPath] stringByAppendingPathComponent: path] ;
|
||||
path = [path stringByStandardizingPath];
|
||||
if ([path isAbsolutePath] == NO)
|
||||
{
|
||||
path = [[fm currentDirectoryPath] stringByAppendingPathComponent: path];
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
|
@ -100,7 +102,8 @@ main(int argc, char** argv, char **env_c)
|
|||
|
||||
if (filetoopen)
|
||||
{
|
||||
exists = [fm fileExistsAtPath: arg isDirectory: &isDir];
|
||||
filetoopen = absolutePath(fm, filetoopen);
|
||||
exists = [fm fileExistsAtPath: filetoopen isDirectory: &isDir];
|
||||
if (exists == NO)
|
||||
{
|
||||
if ([filetoopen hasPrefix: @"/"] == NO
|
||||
|
@ -111,7 +114,6 @@ main(int argc, char** argv, char **env_c)
|
|||
}
|
||||
else
|
||||
{
|
||||
filetoopen = absolutePath(fm, filetoopen);
|
||||
[workspace openFile: filetoopen
|
||||
withApplication: application];
|
||||
}
|
||||
|
|
8
Version
8
Version
|
@ -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}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue