Compare commits

...

265 commits

Author SHA1 Message Date
Riccardo
4f255d2750
Merge pull request #343 from gnustep/margin_fix
Margin fix
2025-04-13 17:19:24 +02:00
Riccardo Mottola
15de9c7eb3 further tweak margins 2025-04-11 15:34:15 +02:00
Riccardo Mottola
4f54f4d6cf recalculate margins every time the paper type changes, do not stick to thos calculated on the default in init 2025-04-11 09:24:28 +02:00
Riccardo Mottola
2e5f204d6a imageable area is usually smaller than the full page, don't provide a edge-to-edge printer as default dummy 2025-04-11 09:23:39 +02:00
Riccardo Mottola
fcfc643e3c Merge branch 'master' of https://github.com/gnustep/libs-gui 2025-04-02 01:48:03 +02:00
Riccardo Mottola
a4da1a1b5a Fix standardizing absolute paths: first check for them, then add CWD
then standardize the path.
As we are, add a nil/empty string check for path.
2025-04-02 01:46:40 +02:00
Riccardo
0421737ed5
Merge pull request #341 from gnustep/improve_helpviewer_check
Use NSWorkspace inforForExcetsion to check if current registred HelpViewer is capable of showing the Help File, otherwise fall-back to NSWorkspace open as if no HelpViewer is set
2025-04-01 16:17:15 +02:00
Riccardo Mottola
3c83194b7b fix missing space 2025-04-01 14:41:38 +02:00
Riccardo Mottola
e3da52aae3 Normalize path always and use it to check if it exists, not argc. 2025-04-01 01:34:27 +02:00
Riccardo Mottola
0db5a24849 Use NSWorkspace inforForExcetsion to check if current registred HelpViewer is capable of showing the Help File, otherwise fall-back to NSWorkspace open as if no HelpViewer is set 2025-04-01 00:29:15 +02:00
Riccardo Mottola
4faee2de0b before using designated HelpViewer check if it is capable of opening the extension 2025-03-25 01:06:28 +01:00
Riccardo Mottola
2cd675f736 fix typo 2025-03-25 00:10:37 +01:00
Riccardo Mottola
c00d5beaf8 use existing ws local variable work shared NSWorkspace 2025-03-25 00:00:18 +01:00
Riccardo Mottola
60aca74336 improve handling of external viewer success or failure, return early in case of success 2025-03-24 23:58:04 +01:00
Riccardo
62a162ed99
Merge pull request #340 from gnustep/339-crash-in-gslayoutengine
fix copy&paste error in release which caused crash
2025-03-06 00:01:08 +01:00
Riccardo Mottola
07f2213285 fix copy&paste error in release which caused crash 2025-03-05 16:08:10 +01:00
Riccardo
d7b54f7a76
Merge pull request #338 from gnustep/fix_needsLayout
always reset _needsLayout in -layout and not only
-layoutSubtreeIfNeeded via layoutViewAndSubvies.

Apple states for -(void) layout:

Override this method if your custom view needs to perform custom layout not expressible using the constraint-based layout system. In this case you are responsible for setting needsLayout to true when something that impacts your custom layout changes.

Which seems to suggest that layout does the reset of needsLayout, since
setting it is up to programmer.
2025-03-05 15:50:43 +01:00
Riccardo Mottola
5917f0519b always reset _needsLayout in -layout and not only
-layoutSubtreeIfNeeded via layoutViewAndSubvies.

Apple states for -(void) layout:

Override this method if your custom view needs to perform custom layout not expressible using the constraint-based layout system. In this case you are responsible for setting needsLayout to true when something that impacts your custom layout changes.

Which seems to suggest that layout does the reset of needsLayout, since
setting it is up to programmer.
2025-03-04 23:56:39 +01:00
rfm
4c1687d2b4 New release 2025-02-11 18:44:11 +00:00
Fred Kiefer
f63152d5b9 Update news.texi for upcoming release. 2025-02-10 22:41:51 +01:00
Riccardo
18175a38d2
Merge pull request #332 from gnustep/FolderIcon_Fix
Some checks failed
CI / Ubuntu x64 Clang gnustep-1.9 (push) Has been cancelled
CI / Ubuntu x64 Clang gnustep-2.0 (push) Has been cancelled
CI / Ubuntu x64 GCC (push) Has been cancelled
Fix display of icons in GWorkspace if the home is a symlink
2025-02-09 00:02:31 +01:00
Riccardo Mottola
bb2c4f4978 resolve links, so that e.g /home/xxx /usr/home/xxx match 2025-02-07 03:14:49 +01:00
Riccardo
44e7af6704
Merge pull request #330 from gnustep/NSView_protected
Some checks failed
CI / Ubuntu x64 Clang gnustep-1.9 (push) Has been cancelled
CI / Ubuntu x64 Clang gnustep-2.0 (push) Has been cancelled
CI / Ubuntu x64 GCC (push) Has been cancelled
protect ivars described as protected
2025-02-06 09:14:14 +01:00
Riccardo
04538546d4
Merge pull request #331 from gnustep/master
Some checks failed
CI / Ubuntu x64 Clang gnustep-1.9 (push) Has been cancelled
CI / Ubuntu x64 Clang gnustep-2.0 (push) Has been cancelled
CI / Ubuntu x64 GCC (push) Has been cancelled
Update main.yml
2025-02-06 02:20:57 +01:00
Gregory Casamento
16b311f12e
Update main.yml
Some checks are pending
CI / Ubuntu x64 Clang gnustep-1.9 (push) Waiting to run
CI / Ubuntu x64 Clang gnustep-2.0 (push) Waiting to run
CI / Ubuntu x64 GCC (push) Waiting to run
2025-02-05 20:07:42 -05:00
Riccardo Mottola
d25d0ad027 protect ivars described as portected 2025-02-04 12:27:30 +01:00
Gregory Casamento
c28695dd4a
Merge pull request #284 from gnustep/NSBrowser_bindings_branch 2025-01-26 08:46:43 -05:00
Riccardo
efb587850b
Merge pull request #328 from gnustep/fix_TextObject_properties
revert part of TestPlant imports. The _updateFieldEditor method is
2025-01-25 22:55:21 +01:00
Riccardo Mottola
7855b12d6a revert part of TestPlant imports. The _updateFieldEditor method is
called *after* setUpFieldEditorAttributes so it reset attributes set to
NSText text object.
2025-01-24 01:38:09 +01:00
Gregory John Casamento
86f97ac54d Clean up comments 2025-01-18 22:42:46 -05:00
Gregory John Casamento
fbb22c07bf Fix handling of leaf nodes 2025-01-18 21:04:27 -05:00
Gregory John Casamento
4bb57d4af5 Merge branch 'master' into NSBrowser_bindings_branch 2025-01-18 12:03:00 -05:00
Gregory Casamento
f63f89dd05
Merge pull request #327 from gnustep/fix_dependencies_branch
Update dependencies.sh
2025-01-18 09:07:20 -05:00
Gregory Casamento
b75d59a5b9
Update dependencies.sh 2025-01-18 09:02:29 -05:00
Gregory Casamento
f1a94d94b5
Update dependencies.sh
Fix spaces
2025-01-18 09:00:47 -05:00
Gregory Casamento
b19c9052a7
Update dependencies.sh
Re-add build for libdispatch
2025-01-18 08:45:59 -05:00
Gregory Casamento
ddd239d702
Update dependencies.sh
Switch back to canonical source for libdispatch
2025-01-18 08:44:57 -05:00
Gregory Casamento
df9f4560c6
Update dependencies.sh 2025-01-18 07:52:25 -05:00
Gregory Casamento
989d3aacd6
Update dependencies.sh 2025-01-18 07:49:39 -05:00
Gregory John Casamento
fbd539ad24 Merge branch 'master' into NSBrowser_bindings_branch 2025-01-10 10:36:52 -05:00
Gregory Casamento
b68ddb27b9
Update main.yml
Add dependencies to fix CI issue.
2025-01-08 12:15:23 -05:00
Gregory John Casamento
08163b48f1 Merge branch 'master' into NSBrowser_bindings_branch 2025-01-05 04:55:21 -05:00
McLaren Labs
a8018d6c8e
Fix computation (#325)
- start of string is (name+9)
  - 'ptr' is the end of the desired substring, so the length
    should be (ptr - (name + 9))  which is (ptr - name) - 9)

Co-authored-by: Tom Sheffler <tom.sheffler@gmail.com>
2025-01-03 10:31:59 +01:00
Gregory John Casamento
a3ebaf2630 Merge branch 'master' of github.com:gnustep/libs-gui into NSBrowser_bindings_branch 2025-01-01 16:42:03 -05:00
rfm
3a3a8c47c9 Fix a few testcase leaks 2025-01-01 15:03:52 +00:00
rfm
96a719ae20 Fix trival leaks 2024-12-31 08:21:15 +00:00
Riccardo
e489d43ef1
Merge pull request #324 from gnustep/nilfilename_fix
Don't attempt to load representations if the filename is nil.
2024-12-16 16:05:33 +01:00
Riccardo Mottola
74b5836b19 Don't attempt to load representations if the filename is nil. 2024-12-16 01:09:54 +01:00
Gregory John Casamento
1a74cb6435 Cleanup code whitespace 2024-12-12 13:35:43 -05:00
Gregory John Casamento
2bcc354972 Merge branch 'master' into NSBrowser_bindings_branch 2024-12-09 19:36:20 -05:00
williameveretteggplant
7855252df0
Only trigger NSClipView changes when setting new frame (#313) 2024-11-19 19:32:55 +01:00
Riccardo
4da0ca66a0
simplify ICU configure, remove icu-config parameter and cascade with pkg-config check as in base, also add pkg-config program check to be able to use it (!) (#320) 2024-11-19 18:04:29 +01:00
Frederik Carlier
68e2716626
GSColorSliderCell: Move to libs-gui (#321)
This class is shared between the StandardPicker bundle and the WheelPicker bundles.  Exposing a class with the same name in two separate bundles results in undefined behavior.  Move this class to a shared module (libs-gui in this case) to resolve that.
2024-11-19 18:02:25 +01:00
johnathan-becker
82717eefec
fix issue with nsmenu items (#315) 2024-11-18 19:43:58 +01:00
Gregory Casamento
bc53ea0ecf
Merge pull request #319 from johnathan-becker/johnb-fix-textbox
Fix issue with NSCollectionView and single column views
2024-11-17 08:46:36 -05:00
rfm
f7fd33a746 When we allocate objects in a given zone, we are not guaranteed to get back something actually allocated in that zone (eg the runtime might use a common heap) so if we are creating/destroying other heap memory based on zone we need to make sure we are consistently using the same zone info. 2024-11-16 11:15:49 +00:00
Fred Kiefer
87e132ca82 Fix test GSCellFlags.
Make NSBezierPath -dealloc a bit saver.
2024-11-15 22:10:29 +01:00
Johnathan Becker
c80105a312
try this 2024-11-15 12:39:29 -07:00
Johnathan Becker
299af29885
try this 2024-11-15 12:36:08 -07:00
Johnathan Becker
7d477230ec
try this 2024-11-15 12:32:31 -07:00
Gregory John Casamento
aac04a1a03 Comment unneeded code as discussed with @fredkiefer 2024-11-11 08:27:28 -05:00
Gregory John Casamento
041b8fda1f Fix call to rootItemForBrowser as discussed with @fredkiefer 2024-11-11 08:17:59 -05:00
Gregory John Casamento
5580e464d2 Update ChangeLog to show NSBrowser changes 2024-11-08 22:25:34 -05:00
Gregory John Casamento
557796af5d Merge branch 'master' of github.com:gnustep/libs-gui into NSBrowser_bindings_branch 2024-11-06 09:39:30 -05:00
Frederik Carlier
c89d7432a4
Expose additional GSTheme method(s) for adding NSTabView theming to WinUXTheme (#308)
Co-authored-by: Marcian Lytwyn <marcian.lytwyn@eggplant.io>
2024-11-05 09:00:07 +01:00
williameveretteggplant
c71f9dd715
modify NSComboBox to handle attributed strings (#314)
* modify NSComboBox to handle attributed strings

* formatting
2024-11-05 00:12:37 +01:00
Gregory John Casamento
70cdc3c908 Merge branch 'master' of github.com:gnustep/libs-gui into NSBrowser_bindings_branch 2024-11-03 15:47:54 -05:00
Frederik Carlier
ec89d161b0
NSTextFieldCell: Decode placeholder string (#310) 2024-11-02 17:50:48 +01:00
Sergii Stoian
42a79060b9
Make white as default selection highlight color for NSTableView (#312) 2024-11-02 00:03:20 +01:00
johnathan-becker
820492495a
implement showsresizeindicator (#311) 2024-11-01 20:10:29 +01:00
Sergii Stoian
5cd432374c
Merge pull request #302 from trunkmaster/menu-unhide
NSApplication: toggle menu item "Hide" title and action on user click.
2024-11-01 15:22:18 +02:00
Sergii Stoian
c5754158c5 NSApplication: use "Show" menu item title instead of "Unhide". 2024-11-01 12:53:19 +00:00
Sergii Stoian
9d419c9116 NSApplication.m: handle Hide/Unhide menu item title and action by changing
title and action of NSMenuItem object.
2024-11-01 11:35:26 +00:00
Gregory John Casamento
59f91c21cd Merge branch 'master' of github.com:gnustep/libs-gui into NSBrowser_bindings_branch 2024-10-31 16:34:14 -04:00
rfm
3879f8e909 Fix logic of test for changed information for tidy object dates. 2024-10-31 19:04:45 +00:00
Gregory John Casamento
10256c9a60 Merge branch 'master' of github.com:gnustep/libs-gui into NSBrowser_bindings_branch 2024-10-30 19:10:04 -04:00
Fred Kiefer
349dc21144 * Headers/AppKit/NSLayoutAnchor.h: Add missing include that is required after a change in base.
* Source/NSTableView.m: Forward declare new methods.
2024-10-29 22:42:06 +01:00
Frederik Carlier
a32741a5d7
Add NSCellHitResult typedef, introduced in OSX 10.10 (#309) 2024-10-28 18:14:24 +01:00
Frederik Carlier
acf00ce5d2
Allow themes to override [NSMenu _isVisible] (#307)
The default implementation of `[NSMenu]` uses `_aWindow` and `_bWindow` to determine the visibility of the menu.  Not all themes use these windows to build a menu.  For example, the WinUXTheme will use Win32 APIs to build a menu.

Allow themes to override the value of `[NSMenu _isVisible]` by introducing a `[GSTheme proposedVisibility: (BOOL)visible forMenu: (NSMenu *) menu]` method.  The default implementation simply eturns the proposed visibility.
2024-10-27 22:02:20 +01:00
Gregory John Casamento
56d6fa064f Use better variable name for value key 2024-10-18 20:11:16 -04:00
williameveretteggplant
9901bbcb4c
Fix alternateContents in NSButtonCell (#305) 2024-10-17 08:23:02 +02:00
johnathan-becker
55ef9f465f
Add Tests for GSCodingFlags (#303)
* add test

* remove backend call

* fix this

* fix =
2024-10-14 22:34:51 +02:00
Gregory John Casamento
5fd4ff0ffe Merge branch 'master' into NSBrowser_bindings_branch 2024-10-13 21:47:54 -04:00
Gregory John Casamento
5a169767ff Simplify NSContentBinding/NSContentValuesBindings in setValue:forKey: and valueForKey: 2024-10-13 21:47:33 -04:00
Gregory John Casamento
664fdada0c Cleanup setValue:forKey: and valueForKey: 2024-10-11 14:59:04 -04:00
Gregory John Casamento
c3146bae6b Clean up white space 2024-10-11 01:08:49 -04:00
Gregory John Casamento
427b9af224 Update code to pull the column and selected row properly 2024-10-11 00:49:22 -04:00
Gregory John Casamento
245ec265f8 Fixed issue with getting value and initial item 2024-10-10 00:15:56 -04:00
Sergii Stoian
afe151aaaf NSApplication: toggle title of menu item "Hide" to "Unhide" and vice versa.
Right-click app menu on hidden app icon should show "Unhide" on menu item and behave respectively.
2024-10-09 11:02:26 +00:00
Sergii Stoian
40fc3ab2ec
Merge pull request #299 from trunkmaster/fontpanel-autosizing
Font Panel autosizing fix - Fix autosizing of "Family" and "Typeface" browsers using different approach to NSView's default.
2024-10-09 01:20:20 +03:00
Gregory John Casamento
417a33de27 Merge branch 'master' into NSBrowser_bindings_branch 2024-10-08 12:52:35 -04:00
Gregory John Casamento
16ed635cd4 Merge branch 'master' of github.com:gnustep/libs-gui 2024-10-08 12:50:36 -04:00
Gregory John Casamento
c2324e102d Minor cleanup in NSOutlineView code 2024-10-08 12:49:59 -04:00
johnathan-becker
4d50863275
apply fix (#300) 2024-10-08 17:59:23 +02:00
johnathan-becker
fb1472ad3b
make nsmenu extensible (#301) 2024-10-07 22:58:42 +02:00
Gregory John Casamento
2916a92bf7 Add code to get node data from NSTreeController 2024-10-07 16:04:08 -04:00
Gregory John Casamento
d04a1b8291 Add code to handle bindings in NSBrowser, skeletal implementation, avoids exception 2024-10-07 13:59:29 -04:00
Sergii Stoian
59381a7803 Merge branch 'master' into fontpanel-autosizing 2024-10-04 23:05:46 +03:00
Sergii Stoian
04e6cf804d NSFOntPanel: remove extra check while autosizing. 2024-10-04 23:05:23 +03:00
Sergii Stoian
64c5bb581d NSFontPanel: implement alternative method for autozing of browsers. 2024-10-03 16:21:53 +00:00
williameveretteggplant
3b02ac1d9d
implement integerValue method in NSSliderCell (#296)
the superclass method integerValue: method in NSCell uses the _object_value to retrieve the result, but the implementation of setObjectValue: in NSSliderCell sets _value. So integerValue: needs to return _value.
2024-10-03 09:14:45 +02:00
Gregory John Casamento
fbad48733d Merge branch 'master' of github.com:gnustep/libs-gui into NSBrowser_bindings_branch 2024-09-28 09:03:35 -04:00
Riccardo
fb61a0f287
use macro to decode NSInteger into enum - fixes 64Bit Big Endian (#292) 2024-09-19 08:29:36 +02:00
Frederik Carlier
22e5304a7b
Fall back to pkgconfig for resolving libtiff (#290)
In certain configurations (e.g. when built in debug mode using the msvc compiler), the libtiff link library may have a 'd' suffix -- 'tiffd'. `AC_CHECK_LIB(tiff, TIFFReadScanline)` will fail because it doesn't search for `tiffd`.

Rather than hardcoding the `tiffd` variant, use pkg-config to find libtiff.
2024-09-15 10:54:50 +02:00
Frederik Carlier
3784462321
GSMemoryPanel: Only call GSDebug* in debug mode (#289)
The GSDebug* methods are conditional on NDEBUG not being defined; so do not attempt to call these methods if this variable is not set.
2024-09-14 10:31:42 +02:00
Frederik Carlier
6a3681aa82
Add APPKIT_EXPORT_CLASS, APPKIT_EXPORT annotations (#288)
Some GS* classes and methods are used by the ColorPicker or Printing bundles.  That means that they are referenced from an external module.  For this module to be able to resolve these symbols, on Windows, they need to be exported.

This commit adds `APPKIT_EXPORT_CLASS` and `APPKIT_EXPORT` annotations, allowing ColorPickers to compile on Windows.
2024-09-12 22:45:55 +02:00
Gregory John Casamento
35fb894ecc Update bindings handlng in NSBrowser, NSTextFieldCell 2024-09-09 09:23:35 -04:00
Gregory John Casamento
f6231b841d Revert temporary experimental change (for now) 2024-09-09 09:23:35 -04:00
Gregory John Casamento
691bf4391b NSTableView experimental changes to improve bindings 2024-09-09 09:23:35 -04:00
rfm
3c160c9bb8 for documentation, ignore DPS macros 2024-09-03 11:30:18 +01:00
Gregory John Casamento
530dee1e2f Minor fix in NSNib to use NULL, quick fix in NSBundleAdditions to fix issue with model not returning top-level objects 2024-08-29 16:16:43 -04:00
Gregory Casamento
b003db284e
Merge pull request #277 from gnustep/NSTreeController_branch2
Updated PR for NSOutlineView/NSTreeController due to refactor
2024-08-23 03:25:51 -04:00
Gregory John Casamento
e1f3109c94 Fix issues with setting editable property on NSTableColumn and call _keyPathForValueBinding 2024-08-21 00:12:03 -04:00
Gregory John Casamento
8ed8754b2a Correction compile error 2024-08-20 23:43:30 -04:00
Gregory John Casamento
068684d6d3 Add method _keyPathForValueBinding in _setObjectValue for table view 2024-08-20 23:00:16 -04:00
Gregory John Casamento
1a188b7eb7 Add method _keyPathForValueBinding in _setObjectValue for Outline view 2024-08-20 22:56:18 -04:00
Gregory John Casamento
27d57fe5eb Add method _keyPathForValueBinding to encapsulate the code for getting the path 2024-08-20 22:53:31 -04:00
Gregory John Casamento
4b380ab272 Merge conflic fixes 2024-08-18 22:11:42 -04:00
Gregory Casamento
97ea7c5cc5
Merge pull request #281 from gnustep/NSBrowser_branch
Add new 10.6 delegate methods to NSBrowserDelegate
2024-08-18 21:08:54 -04:00
Gregory John Casamento
4813800ac8 Final fixes per discussion with @fredkiefer 2024-08-18 21:04:22 -04:00
Gregory John Casamento
5befed5855 Fix a number of issues pointed out by @fredkiefer 2024-08-18 17:25:47 -04:00
Gregory John Casamento
fbc0cd160b Fix issues mentioned by @fredkiefer as well as some addiutional cleanup 2024-08-12 14:44:13 -04:00
Gregory John Casamento
ddf6546c37 Release selection_index_paths in -dealloc method, per discussion with @fredkiefer 2024-08-11 17:06:49 -04:00
Gregory John Casamento
118eb26a5f Fix issues mentioned by @fredkiefer 2024-08-11 16:40:37 -04:00
Gregory John Casamento
bb2c12d74a Merge branch 'master' of github.com:gnustep/libs-gui into NSTreeController_branch2 2024-08-09 14:27:23 -04:00
Gregory Casamento
ac56a0fe29
Merge pull request #282 from williameveretteggplant/modal_linux_fix 2024-08-09 12:12:30 -04:00
Gregory Casamento
6474e53fb6
Update NSOutlineView.m - remove unbind per discussion with @fredkiefer 2024-08-09 02:28:29 -04:00
Gregory John Casamento
5d9e49a2ff Remove both instances where we get properties from the binding where it is not needed during the loading process, per discussion with @fredkiefer 2024-08-08 18:20:00 -04:00
Gregory John Casamento
854af0901e Cleanup of unused or commented out methods 2024-08-08 17:48:16 -04:00
Gregory John Casamento
0ab960e6fc Remove uneeded outside iteration and get the lastIndex more efficiently, also cleanup NSLog per @fredkiefer 2024-08-08 17:44:04 -04:00
williameveretteggplant
dd67057784
push modal window to top later in process 2024-08-08 10:16:27 -06:00
William Everett
8760810340
Revert "Force modal to front"
This reverts commit 1fd80dabc2.
2024-08-08 10:02:52 -06:00
Gregory John Casamento
d8c4c14018 Move _applyBindingsToCell:atRow: to NSTableColumn 2024-08-07 22:55:14 -04:00
williameveretteggplant
1fd80dabc2
Force modal to front 2024-08-07 16:48:39 -06:00
Gregory John Casamento
21d0bc906e Fix issues pointed out by @fredkiefer 2024-08-04 18:44:01 -04:00
Gregory John Casamento
c85e4fcf37 Merge branch 'master' into NSBrowser_branch 2024-08-03 22:26:49 -04:00
Gregory John Casamento
329553c196 Merge branch 'master' into NSTreeController_branch2 2024-08-03 22:20:42 -04:00
Gregory John Casamento
d694efc941 Fix compilation error 2024-08-03 21:44:02 -04:00
Gregory John Casamento
a1b9dc546e Eliminate category, move logic for prepend inline 2024-08-03 21:40:04 -04:00
Gregory John Casamento
300a84c493 Improve adding a child, also do whitespace-cleanup 2024-08-03 21:02:33 -04:00
Gregory John Casamento
13f86ebfa9 Add child index, add category that properly prepends the index to the NSIndexPath 2024-08-03 20:48:09 -04:00
Gregory John Casamento
8059cdadd0 Slight improvements 2024-08-03 20:05:23 -04:00
Gregory John Casamento
27718ee794 Slightly better attempt at getting the index path 2024-08-03 15:05:44 -04:00
Gregory John Casamento
1a8f0fa8e6 First cut at recursive method to find NSIndexPath for non NSTreeNode items 2024-08-03 14:31:51 -04:00
Gregory John Casamento
fbee6dce81 If no indexPaths are found, return the root 2024-08-02 11:20:58 -04:00
Gregory John Casamento
8935a2d2da Fix compilation issue 2024-07-28 21:05:22 -04:00
Gregory John Casamento
ad75804102 Remove method, minor cleanup, per discussion with @fredkiefer 2024-07-28 20:49:18 -04:00
Gregory John Casamento
52eef305b0 Use FOR_IN instead of while loop 2024-07-27 19:46:51 -04:00
Gregory John Casamento
6f2c542b46 Move handling of dictionary creation into GSControllerTreeProxy class, per discussion with @fredkiefer 2024-07-27 18:51:59 -04:00
Gregory John Casamento
abfc782a6c Move check for dataSource or binding into NSOutlineView before calling method to draw the row per discussion with @fredkiefer 2024-07-27 18:29:00 -04:00
Gregory John Casamento
3d59afd2c9 Improvements, per discussion with @fredkiefer 2024-07-27 17:37:04 -04:00
Gregory John Casamento
7b78d9b64e Check for methods for an item-based delegate, per discussion with @fredkiefer 2024-07-27 17:19:16 -04:00
Gregory John Casamento
4e95021973 Update to simplify code per discussion with @fredkiefer 2024-07-27 16:59:05 -04:00
Gregory John Casamento
ddc47652ec Fix indentation, per discussion with @fredkiefer 2024-07-27 16:46:04 -04:00
Gregory John Casamento
1d266d7a9b Add back informational comments 2024-07-27 13:49:24 -04:00
Gregory John Casamento
4f9889bbe4 Fix selector issue: quick fix 2024-07-26 23:31:46 -04:00
Gregory John Casamento
9712490625 Minor cleanup 2024-07-26 21:24:21 -04:00
Gregory John Casamento
71304617b2 Move logic for finding the item for a given column to a private method, call method to get a view controller from the delegate 2024-07-26 10:56:52 -04:00
Gregory John Casamento
b77c7052e6 Update changelog with NSBrowser change details 2024-07-25 10:18:59 -04:00
Gregory John Casamento
3ae1a4b41d Minor whitespace cleanup 2024-07-25 08:39:21 -04:00
Gregory John Casamento
ab737b81d5 Get the previous column when loading a column in item-based mode in _performLoadOfColumn 2024-07-25 08:23:06 -04:00
Gregory John Casamento
782321e063 Consolidate _performLoad methods, get the last item selected 2024-07-25 08:12:49 -04:00
Gregory John Casamento
f5decac3ba Add code to reset column if the delegate is item-based 2024-07-24 11:28:51 -04:00
Gregory John Casamento
ffdf8fb6da Partially correct implementation 2024-07-23 13:08:35 -04:00
Gregory John Casamento
a1dd317d29 Add delegate calls to method _performLoadOfItem:forColumn: 2024-07-22 18:48:54 -04:00
Gregory Casamento
f55d937ab2
Update NSTreeController.m
Remove NSLog from initWithContent:
2024-07-20 12:27:00 -04:00
Gregory John Casamento
1df45b788e Initial changes to start loading each column based on items 2024-07-20 12:11:47 -04:00
Gregory John Casamento
b1d0ecc21b Add new 10.6 delegate methods to NSBrowserDelegate 2024-07-19 12:04:24 -04:00
Gregory John Casamento
d22d839b0c Correct minor formatting issues 2024-07-19 11:12:24 -04:00
Gregory John Casamento
dc78b11291 Add code to handle insertion methods that are based on selection 2024-07-19 10:14:18 -04:00
Gregory John Casamento
cd41f301a8 Add selection logic for computing indexPaths 2024-07-19 08:04:13 -04:00
Riccardo Mottola
b32f21e549 Merge branch 'master' of https://github.com/gnustep/libs-gui 2024-07-18 13:17:14 +02:00
Riccardo Mottola
da2803481b Pietas, Enrico passed way, remove email 2024-07-18 13:17:06 +02:00
Gregory John Casamento
c68c459584 Add code to set selection indexes on the controller 2024-07-16 18:03:30 -04:00
Gregory John Casamento
c39095cd61 Add comment/documentation 2024-07-15 07:06:49 -04:00
Gregory John Casamento
74e0c19503 Add bindigns to NSTableColumn and handle font bindings in _applyBindingsToCell:... method 2024-07-15 06:50:20 -04:00
Gregory John Casamento
766a358fb7 Move code to handle enabled/editable bindings to a common method in the parent class 2024-07-14 16:00:18 -04:00
Gregory John Casamento
ca4fe0e078 Add code to get the value of the NSEnabledBinding 2024-07-14 15:40:47 -04:00
Gregory John Casamento
45c0368602 Add code to get the value of the NSEditableBinding 2024-07-14 15:14:07 -04:00
Gregory John Casamento
f253f3fa0e Formatting fixes.. add space before * in return value 2024-07-12 10:39:47 -04:00
Gregory John Casamento
2ba9843537 Add removeSelectionIndexPaths: 2024-07-12 09:42:26 -04:00
Gregory John Casamento
4ddce03859 Add removeObjects... methods 2024-07-12 08:49:52 -04:00
Gregory John Casamento
9b481f10b3 Correctly refresh after adding an item at an index path 2024-07-12 08:11:23 -04:00
Gregory John Casamento
e6f86a5a9e Add NSNibDeclarations.h to the header to correct compilation error 2024-07-12 06:35:31 -04:00
Gregory John Casamento
90b3913a1f Add implementation for methods that add nodes at a given indexPath or set of indexPaths 2024-07-12 06:22:56 -04:00
Gregory John Casamento
bbbe9d00b4 Update _setObjectValue:... to update items in arrangedObjects when there is a binding 2024-07-11 12:18:52 -04:00
Gregory John Casamento
8da3d0afb7 Update to use NSObservedKeyPathKey instead of string, add code to _setObjectValue:... in NSTableView to set the value when we have a binding 2024-07-10 07:06:08 -04:00
Gregory John Casamento
aa86a96c55 Update to use NSObservedKeyPathKey instead of string, add code to _setObjectValue:... in NSTableView to set the value when we have a binding 2024-07-10 06:31:55 -04:00
Gregory John Casamento
060b27a854 Update _setObjectValue:... 2024-07-06 23:44:31 -04:00
Gregory John Casamento
fdb35eb869 Add value/setValue: 2024-07-06 23:06:26 -04:00
Gregory John Casamento
435ccfb2c7 Add value/setValue: 2024-07-06 23:03:31 -04:00
Gregory John Casamento
23bcb99166 Initial changes to NSBrowser for NSTreeController/binding integration 2024-07-06 22:02:10 -04:00
Gregory John Casamento
20b8f2402b Merge branch 'master' of github.com:gnustep/libs-gui into NSTreeController_branch2 2024-07-06 13:38:47 -04:00
Gregory Casamento
6b238f504c
Update README.md
Fix date.  :/
2024-07-06 01:54:10 -04:00
Gregory Casamento
1d46aae920
Update README.md
update date
2024-07-06 01:53:33 -04:00
Gregory John Casamento
8fbcbdb380 Changes to allow editing 2024-07-05 01:57:09 -04:00
Gregory John Casamento
90d94fea22 Add unbind call to dealloc methods, add children method to proxy class, cleanup 2024-07-05 01:40:51 -04:00
Gregory John Casamento
7aee7f6667 Use ...ForNode: methods so that the path is dependent on the kind of node 2024-07-03 04:08:43 -04:00
Gregory John Casamento
ebf6bdb8d2 Update add method, fix white space issue, remove duplicate methods 2024-07-02 04:05:53 -04:00
Gregory Casamento
5c9ffa3929
Update gnustep-gui.spec.in
Updating description.
2024-07-02 03:12:00 -04:00
Gregory John Casamento
ba9c12ddf8 Improve documentation regarding 'object' mode and key specification 2024-06-30 22:21:04 -04:00
Gregory John Casamento
860e1863da Minor correction to spelling 2024-06-30 22:07:54 -04:00
Gregory John Casamento
765160fdac Merge branch 'NSTreeController_branch2' of github.com:gnustep/libs-gui into NSTreeController_branch2 2024-06-30 21:58:45 -04:00
Gregory John Casamento
6b2bddab4c Add code to determine if a node has children and the number if the count key is not specified 2024-06-30 21:58:37 -04:00
Gregory Casamento
963572f5c4
Merge branch 'master' into NSTreeController_branch2 2024-06-29 22:07:20 -04:00
Gregory John Casamento
ff97a5bbe2 Remove private method entirely, per discussion with @fredkiefer 2024-06-29 22:06:09 -04:00
Gregory John Casamento
aa4f9b5dbf Remove NSString category per discussion with @fredkiefer 2024-06-29 21:48:27 -04:00
Gregory Casamento
efe925cf38
Update ChangeLog
Minor update... fix date in ChangeLog
2024-06-29 03:24:42 -04:00
Gregory John Casamento
9a91d04bc0 Merge ChangeLog 2024-06-29 01:48:43 -04:00
Gregory Casamento
9a28851a3f
Merge pull request #268 from gnustep/NSMenuToolbarItem_branch
Add NSMenuToolbarItem implementation
2024-06-29 01:46:50 -04:00
Gregory John Casamento
ab2de84a90 Remove unneeded method, per discussion with @fredkiefer 2024-06-28 19:39:10 -04:00
Gregory John Casamento
786b48dd1b Remove unneeded method 2024-06-28 09:45:41 -04:00
Gregory John Casamento
647076cb8a Update copyWithZone: method, provide simple implementation of addSelectionIndexPaths: 2024-06-28 08:39:39 -04:00
Gregory Casamento
b0d02aa7e8
Merge branch 'master' into NSMenuToolbarItem_branch 2024-06-28 08:31:11 -04:00
Gregory John Casamento
0f4e1711d0 Update changelog 2024-06-27 06:12:07 -04:00
Gregory John Casamento
6b808f2d24 Whitespace cleanup, remove unneeded methods, remove NSLogs 2024-06-27 05:54:06 -04:00
Gregory John Casamento
930e3b6c0f Update isExpandable: to be used either in the case where we have a dataSource or if we have a binding, also use it in the loadItem... method so the logic for this is in ONE place 2024-06-27 05:37:01 -04:00
Gregory John Casamento
fb2f605e18 Update drawing code to handle binding, add NSString private method to helpers, remove debugging code from binding connector and outline 2024-06-26 18:17:21 -04:00
Gregory John Casamento
340b95c9fa Limit the items we grab from the binding. Check if item is expanded, etc 2024-06-25 19:43:12 -04:00
Gregory John Casamento
3dfcdf6570 Update loading mechanism and add new proxy class for tree node 2024-06-25 17:11:57 -04:00
Gregory John Casamento
f7afc331eb Interim changes before refactor of NSTreeController 2024-06-24 08:50:22 -04:00
Gregory John Casamento
1d29613491 Progress, thusfar... 2024-06-19 03:28:39 -04:00
Gregory John Casamento
bfb33156cf Move code over from old branch, startint new branch since NSOutlineView was refactored 2024-06-19 01:46:27 -04:00
Gregory Casamento
422649ae5b
Merge pull request #265 from gnustep/NSTableRowView_branch
NSTableRowView class implementation
2024-06-16 21:09:39 -04:00
Gregory John Casamento
baca2ae98a Minor cleanup, move storage of view code to conditional where it is created, suggested by @fredkiefer 2024-06-16 21:01:41 -04:00
Gregory John Casamento
cf7b9ebd39 Final changes suggested by @fredkiefer and some small fixes before merge 2024-06-16 20:52:06 -04:00
Gregory John Casamento
f9b89c41e6 Correct minor theme drawing issues, fix issue pointed out by @fredkiefer to address out of order row fetching 2024-06-16 17:36:15 -04:00
Gregory John Casamento
77bf2f823b Move method back, eliminate possible duplicate call to render outline cell, changes suggested by review with @fredkiefer 2024-06-16 16:25:00 -04:00
Gregory John Casamento
f8fca4e162 Update changelog date 2024-06-16 08:46:48 -04:00
Gregory John Casamento
b4c98b329b Move method that renders the outline icon per discussion with @fredkiefer, also includes some whitespace fixes 2024-06-16 08:38:12 -04:00
Gregory John Casamento
a815ad5bb8 Edits suggested by @fredkiefer during review 2024-06-16 07:25:44 -04:00
Gregory John Casamento
1d6a850081 Make correctiongs as suggested by @fredkiefer 2024-06-16 07:12:32 -04:00
Gregory John Casamento
8162920eea Update and merge from master 2024-06-16 07:03:09 -04:00
Gregory John Casamento
f83098bd8d Update changelog 2024-06-16 07:02:13 -04:00
Gregory Casamento
44c0836bd9
Merge branch 'master' into NSTableRowView_branch 2024-06-11 02:08:53 -04:00
rfm
c93ee13f57 Fix missing return (suggested by Yavor Doganov) 2024-06-06 16:25:43 +01:00
rfm
c9a0e74437 Fixup bad testcases with non-portable code 2024-06-06 12:33:05 +01:00
rfm
a5410d9dc6 Ready for bugfix release 2024-06-06 10:38:15 +01:00
rfm
71b82ee7a2 Fixup testcase to actually work on gcc systems etc 2024-06-05 12:14:42 +01:00
rfm
d312fbe168 Fix for #276 2024-06-03 16:55:33 +01:00
rfm
51ed6a9608 Fix to work without fast enumeration, also fix codign style errors and compiler warnings about operator precedence. 2024-06-03 16:06:00 +01:00
Gregory Casamento
d3e2d8c348
Merge branch 'master' into NSTableRowView_branch 2024-06-02 00:23:59 -04:00
rfm
f93ca6eeb6 Don't use lazy locks any more 2024-05-30 11:15:19 +01:00
rfm
7a98157dc7 gnustep_global_lock is removed 2024-05-30 10:35:02 +01:00
Gregory Casamento
33a4e297b1
Merge branch 'master' into NSTableRowView_branch 2024-05-16 13:47:16 -04:00
Gregory John Casamento
27c9dc9207 Fix whitespace in NSTableRowView.[hm] 2024-05-06 10:09:39 -04:00
Gregory John Casamento
8fc0bffc5c Eliminate white-space 2024-05-06 09:49:19 -04:00
Gregory John Casamento
615b3e9b27 Update changelog 2024-05-04 09:51:56 -04:00
Gregory John Casamento
d3f05037eb Finish implementation of NSMenuToolbarItem 2024-05-04 09:27:05 -04:00
Gregory Casamento
52423a430c Revert questionable change to NSTextView 2024-05-04 06:26:19 -04:00
Gregory Casamento
61ff6962df Add common_MenuToolbarItem.tiff and corresponding mapping 2024-05-04 06:21:28 -04:00
Gregory John Casamento
5ab8768283 Add code to show image for NSMenuToolbarItem 2024-05-03 16:28:24 -04:00
Gregory John Casamento
842b0d8014 Update changelog 2024-05-03 14:02:46 -04:00
Gregory John Casamento
bd4e093bad Add NSMenuToolbarItem skeleton 2024-05-03 13:52:23 -04:00
Gregory John Casamento
b7bea0213b Fix issue with view refresh/editability, refactor so that view sizing happens in the correct place 2024-05-03 10:40:08 -04:00
Gregory John Casamento
bec2392e33 Fix to NSTextView issue where it goes into an infinite loop if the event is returned as nil 2024-05-01 19:19:45 -04:00
Gregory John Casamento
b9c5ba35be Rename variables to be a bit more meaningful 2024-04-30 04:38:41 -04:00
Gregory John Casamento
9070a9d30f Move view rendering to viewAtColumn:row:makeIfNecessary: and eliminate uneeded private method 2024-04-28 15:04:29 -04:00
Gregory John Casamento
4d5957eaf7 Fully refactor delegate calls into NSTableView/NSOutlineView and move outlineColumn drawing to a public method 2024-04-28 09:49:19 -04:00
Gregory John Casamento
77ce97c266 Update to use NSTableRowView 2024-04-28 07:17:43 -04:00
Gregory John Casamento
f7e4b70f54 Return the NSTableRowView for the current row 2024-04-27 09:07:56 -04:00
Gregory John Casamento
d3a0dd23c0 Add 10.7 methods to NSTableView, implement viewAtColumn:row:makeIfnecessary: 2024-04-26 13:08:35 -04:00
Gregory John Casamento
41c7257d4b Add 10.7 methods and add next/prev row selected ivars 2024-04-26 13:08:35 -04:00
Gregory John Casamento
dfef9c9e1f Finish skeleton 2024-04-26 13:08:35 -04:00
Gregory John Casamento
4d2dcb9e04 Add skeleton for NSTableRowView class that includes set/get methods 2024-04-26 13:08:35 -04:00
108 changed files with 6295 additions and 3498 deletions

View file

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

View file

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

View file

@ -1,13 +1,13 @@
1 Announcement
**************
This is version 0.31.0 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?
====================================
It is a library of graphical user interface classes written completely
in the Objective-C language; the classes are based upon Apples Cocoa
in the Objective-C language; the classes are based upon Apple's Cocoa
framework. The library has been enhanced in a number of ways to take
advantage of the GNU system. These classes include graphical objects
such as buttons, text fields, popup lists, browser lists, and windows;
@ -25,65 +25,68 @@ systems.
The GNUstep GUI Library requires the GNU Objective-C compiler, the
GNUstep Base Library, the TIFF Graphics library, Independent JPEG
Groups libjpeg library, and a back-end component from the GNUstep
Back library.
Group's libjpeg library, and a back-end component from the GNUstep
'Back' library.
Additional functionality may be enabled by installing additional
libraries. For example, to build the Cairo backend in the GNUstep Back
library, you will need to install Cairo.
1.2 Noteworthy changes in version 0.31.0
1.2 Noteworthy changes in version 0.32.0
==========================================
This version adds view based cell support for NSTableView and
NSOutlineView. Plus the usual bunch of bug fixes.
This version adds binding support for NSBrowser, NSOutlineView and
NSTableView. Plus the usual bunch of bug fixes.
• Add TGA detection for ImageMagick extension.
• Correct endianess swapping for saving 16 and 32 bit TIFF images.
• NSParagraphStyle restore old behaviour to have default tab stops.
• Documentation updates.
• A fix for autogsdoc documentation creation.
• Improve theming for many classes.
• Correct keyEquivalentModifierMask decoding in XIB files.
• Add imageViewWithImage: to NSImageView.
• Add implementation of NSUserInterfaceItemIdentifier to NSView.
• Fix NSImageView intercepting mouse events when not editable
• Move NSBox method isOpaque to GSTheme.
• Many decoding improvements.
• Fix compiler warnings.
• Generate and install a gnustep-gui.pc file.
• Add support for NSFilenamenPboardType in NSTextView.
• Add support for NSPasteboardTypePNG in NSBitmapImageRep if the
libpng is present.
• Add support for ImageMagick >= 7.0
• Increase pasteboard timeout to 30 seconds.
• Add NSAppearance implementation.
• Make PACKAGE_SCOPE public on MinGW.
• Started implementing NSShadow.
• Move awakeFromNib implementation to NSObject instead of NSView.
• Changes for libGIF 5.2 and later.
• Update NSViewController with lifeCycle methods.
• Avoid accessing instance variables in inline functions when
compiling with MSVC.
• Add method removeAllItems to NSMenu.
• Add badge handling to NSDockTile.
• More improvements to layout constraints.
• Add implementation of NSDictionaryController.
• Add implementation of the NSCollectionView classes.
• Improve NSDrawer opening.
• Improver CI pipeline.
• 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.0.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.0.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.0.tar.gz.sig
gpg --verify gnustep-gui-0.32.0.tar.gz.sig
Signature has been created using the key with the following
fingerprint:

12
BUGS
View file

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

109
ChangeLog
View file

@ -1,8 +1,115 @@
2024-05-26 Fred Kiefer <FredKiefer@gmx.de>
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
* ANNOUNCE:
* NEWS:
* Documentation/news.texi: Update of release notes for 0.31.1.
* Version: bump to 0.31.1
2024-06-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSMenuitem.m:
Fix bug in decoding of archived menu item modifier mask.
2024-05-30 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSDisplayServer.m:
* Source/NSGraphicsContext.m:
* Source/NSWorkspace.m:
Avoid using old gnustep_global_lock (removed from base)
2024-05-26 Fred Kiefer <FredKiefer@gmx.de>
* ChangeLog: Update for new release
* ANNOUNCE:
* NEWS:
* Documentation/news.texi: Update of release notes for 0.31.0.
* Version: bump to 0.31.0

View file

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

View file

@ -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.

View file

@ -9,6 +9,60 @@
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
@itemize @bullet
@item Fix bug decoding menu items (breaking archive)
@item Remove use of deprecated lock from base library
@end itemize
@section Noteworthy changes in version @samp{0.31.0}
This version adds view based cell support for NSTableView and NSOutlineView.
@ -49,8 +103,6 @@ Plus the usual bunch of bug fixes.
@item Improver CI pipeline.
@end itemize
@ifclear ANNOUNCE-ONLY
@section Noteworthy changes in version @samp{0.30.0}
This version adds parsing support for layout constraints, compilation with MSVC

View file

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

View file

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

View file

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

View file

@ -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)

View file

@ -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>

View file

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

View file

@ -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.

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,60 @@
/* Definition of class NSMenuToolbarItem
Copyright (C) 2024 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: 03-05-2024
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110 USA.
*/
#ifndef _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE
#define _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE
#import <AppKit/NSToolbarItem.h>
#import <AppKit/AppKitDefines.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_15, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {
#endif
@class NSMenu;
APPKIT_EXPORT_CLASS
@interface NSMenuToolbarItem : NSToolbarItem
{
BOOL _showsIndicator;
NSMenu *_menu;
}
- (BOOL) showsIndicator;
- (void) setShowsIndicator: (BOOL)flag;
- (NSMenu *) menu;
- (void) setMenu: (NSMenu *)menu;
@end
#if defined(__cplusplus)
}
#endif
#endif /* GS_API_MACOSX */
#endif /* _NSMenuToolbarItem_h_GNUSTEP_GUI_INCLUDE */

View file

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

View file

@ -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.

View file

@ -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

View file

@ -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)

View file

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

View file

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

View file

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

28
INSTALL
View file

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

View file

@ -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 \

Binary file not shown.

View file

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

View file

@ -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 -

198
NEWS
View file

@ -1,9 +1,61 @@
1 NEWS
******
The currently released version of the library is 0.31.0.
The currently released version of the library is 0.32.0.
1.1 Noteworthy changes in version 0.31.0
1.1 Noteworthy changes in version 0.32.0
==========================================
This version adds binding support for NSBrowser, NSOutlineView and
NSTableView. Plus the usual bunch of bug fixes.
• 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.2 Noteworthy changes in version 0.31.1
==========================================
This is a bugfix release
• Fix bug decoding menu items (breaking archive)
• Remove use of deprecated lock from base library
1.3 Noteworthy changes in version 0.31.0
==========================================
This version adds view based cell support for NSTableView and
@ -44,7 +96,7 @@ NSOutlineView. Plus the usual bunch of bug fixes.
• Improve NSDrawer opening.
• Improver CI pipeline.
1.2 Noteworthy changes in version 0.30.0
1.4 Noteworthy changes in version 0.30.0
==========================================
This version adds parsing support for layout constraints, compilation
@ -52,7 +104,7 @@ with MSVC and many new classes. Plus the usual bunch of bug fixes.
• Add classes NSStackView, NSGlyphInfo.
• Add more formal protocols to headers.
• Add extra pixels so that tool tip doesnt overrun the window.
• Add extra pixels so that tool tip doesn't overrun the window.
• More improvements from Testplant.
• NSSplitView support different divider styles.
• Improve on Wayland support.
@ -86,7 +138,7 @@ with MSVC and many new classes. Plus the usual bunch of bug fixes.
• Add github workflow.
• Add icon for speech synthesizer.
1.3 Noteworthy changes in version 0.29.0
1.5 Noteworthy changes in version 0.29.0
==========================================
This version adds support for storyboard files and many new classes.
@ -120,7 +172,7 @@ Plus the usual bunch of bug fixes.
returned by a slow window manager.
• Fix NSTableView/NSTableColumn bindings.
1.4 Noteworthy changes in version 0.28.0
1.6 Noteworthy changes in version 0.28.0
==========================================
This version adds support for modern XIB files and many new classes.
@ -158,7 +210,7 @@ Plus the usual bunch of bug fixes.
• Lowered NSFloatingWindowLevel by one to distinguish floating panels
from menus.
1.5 Noteworthy changes in version 0.27.0
1.7 Noteworthy changes in version 0.27.0
==========================================
This version includes numerous bugfixes, compatibility improvements and
@ -181,7 +233,7 @@ be done on integrating NSViews with a Core Animation renderer.
• Japanese translations.
• Lots of bug fixes.
1.6 Noteworthy changes in version 0.26.2
1.8 Noteworthy changes in version 0.26.2
==========================================
This version is a small, but important bugfix release.
@ -189,7 +241,7 @@ This version is a small, but important bugfix release.
• printing: Fix allocation of the CUPS printing classes.
• installation: Fix the configure script.
1.7 Noteworthy changes in version 0.26.1
1.9 Noteworthy changes in version 0.26.1
==========================================
This version is released to conincide with version 1.25.1 of
@ -200,7 +252,7 @@ gnustep-gui and gnustep-back.
Runtime (libobjc2) and non-fragile ABI to avoid a bug in interaction
between the clang compiler and the runtime when non-fragile ABI is in
use. Specifically, Clang and the runtime may disagree on what is the
offset of an ivar in a classs RAM. This manifested in a crash at
offset of an ivar in a class's RAM. This manifested in a crash at
application startup due to misalignment of _gcontext inside NSThread.
See the mailing list discussion
(http://lists.gnu.org/archive/html/discuss-gnustep/2017-12/msg00129.html)
@ -216,8 +268,8 @@ for more information.
• graphics context: Workaround for Clang+libobjc2+nonfragile ABI
issue.
1.8 Noteworthy changes in version 0.26.0
==========================================
1.10 Noteworthy changes in version 0.26.0
===========================================
This version was bumped due to previous binary incompatibilities between
0.25.0 and 0.25.1. This version also includes numerous compatibility
@ -247,8 +299,8 @@ system.
and methods to improve source-level compatibility.
• other bugfixes
1.9 Noteworthy changes in version 0.25.1
==========================================
1.11 Noteworthy changes in version 0.25.1
===========================================
• JPEG (saving) alpha channel fixes and size with resolution != 72
• JPEG resolution read support
@ -258,7 +310,7 @@ system.
• Corrected layout of empty strings
• Only update visible menus
1.10 Noteworthy changes in version 0.25.0
1.12 Noteworthy changes in version 0.25.0
===========================================
• Fixes for new GIF library versions
@ -273,14 +325,14 @@ system.
• Numerous theme tweaks
• Spanish locale
1.11 Noteworthy changes in version 0.24.1
1.13 Noteworthy changes in version 0.24.1
===========================================
From a look through ChangeLog, we can see a lot of bugfixes for this
release, with the main focus on avoiding display glitches and improving
OSX compatibility.
1.12 Noteworthy changes in version 0.24.0
1.14 Noteworthy changes in version 0.24.0
===========================================
New features include:
@ -292,13 +344,13 @@ New features include:
Many bugfixes.
1.13 Noteworthy changes in version 0.23.1
1.15 Noteworthy changes in version 0.23.1
===========================================
This is a bugfix release, primarily to deal with coding/archiving
issues.
1.14 Noteworthy changes in version 0.22.0
1.16 Noteworthy changes in version 0.22.0
===========================================
New features include:
@ -307,26 +359,26 @@ New features include:
• Support for drawing the GUI with a scale factor, for high-DPI
monitors.
• Character panel
• Color picker “Magnifier” tool, for grabbing the color of arbitrary
• Color picker "Magnifier" tool, for grabbing the color of arbitrary
parts of the screen
Many NSImage improvements (Mac OS X 10.6 drawing methods, better
selection of image reps, better support for icons). Many bugfixes,
including in Xib loading, printing, and NSView geometry.
1.15 Noteworthy changes in version 0.20.0
1.17 Noteworthy changes in version 0.20.0
===========================================
A new stable release. Many improvments with Nib loading, documents and
document controllers. Fixed many drawing issues, particularly ones
related to flipping. Much improved theming.
1.16 Noteworthy changes in version 0.19.0
1.18 Noteworthy changes in version 0.19.0
===========================================
This is an (unstable) copy of the 0.18.0 release
1.17 Noteworthy changes in version 0.18.0
1.19 Noteworthy changes in version 0.18.0
===========================================
A new stable release that has had many improvements. Many new Mac OS X
@ -335,20 +387,20 @@ were made (particularly with the use of the Windows theme). There is
also better compatibility with Mac OS X in terms of usage of NSInteger
and other definitions.
1.18 Noteworthy changes in version 0.17.1
1.20 Noteworthy changes in version 0.17.1
===========================================
• New Mac OS X 10.5 methods in NSFont
• Add live resize in NSSplitView
1.19 Noteworthy changes in version 0.17.0
1.21 Noteworthy changes in version 0.17.0
===========================================
• New Mac OS X 10.5 methods in many classes
• Toolbars have been completely rewritten and improved.
• Several improvements for Garbage Collection
1.20 Noteworthy changes in version 0.16.0
1.22 Noteworthy changes in version 0.16.0
===========================================
• Nib loading refractored and improved.
@ -356,7 +408,7 @@ and other definitions.
• NSWindowController made a subclass of NSResponder
• NSTokenField and netokenFiledCell classes added.
1.21 Noteworthy changes in version 0.14.0
1.23 Noteworthy changes in version 0.14.0
===========================================
• New class NSGlyphGenerator for glyph generation
@ -364,7 +416,7 @@ and other definitions.
• NSOpenGLView added some Mac OS X 10.3 methods
• Manu bug fixes.
1.22 Noteworthy changes in version 0.13.2
1.24 Noteworthy changes in version 0.13.2
===========================================
• Printing works a little better now.
@ -375,7 +427,7 @@ and other definitions.
• New class NSSegmentedCell.
• NSDrawer was implemented.
1.23 Noteworthy changes in version 0.13.1
1.25 Noteworthy changes in version 0.13.1
===========================================
• NSMenu - Added more MacOS X methods and an ivar.
@ -385,7 +437,7 @@ and other definitions.
• Added some MacOS X 10.4 methods to NSTableView.
• Changed the NSCursor hot point to 0,0 for MacOS X compatibility.
1.24 Noteworthy changes in version 0.13.0
1.26 Noteworthy changes in version 0.13.0
===========================================
This is an unstable release. There may be backward compatibility issues
@ -412,7 +464,7 @@ with previous releases of the gui library.
• Implementation of special connectors for Key-Value binding.
• Base library version 1.15.1 is required for this release
1.25 Noteworthy changes in version 0.12.0
1.27 Noteworthy changes in version 0.12.0
===========================================
It has been a long time since the last release and many things have been
@ -432,7 +484,7 @@ added and changed, including new classes, new ivars, and new methods.
• NSSpellServer and NSAffineTransform was moved to GNUstep base for
Mac OS X compatibility.
1.26 Noteworthy changes in version 0.11.0
1.28 Noteworthy changes in version 0.11.0
===========================================
• Added support for keyed encoding in all gui classes.
@ -441,25 +493,25 @@ added and changed, including new classes, new ivars, and new methods.
• Implemented glue code in GSNibCompatibility for classes such as
NSIBObjectData, NSClassSwapper, etc. to facilitate nib loading.
1.27 Noteworthy changes in version 0.10.3
1.29 Noteworthy changes in version 0.10.3
===========================================
• Horizontal menus now work
• Better support for tracking active applications.
1.28 Noteworthy changes in version 0.10.2
1.30 Noteworthy changes in version 0.10.2
===========================================
Mostly bug fixes.
1.29 Noteworthy changes in version 0.10.1
1.31 Noteworthy changes in version 0.10.1
===========================================
GNUstep now uses v19 of portaudio for the sound daemon. Version v19
hasnt been officially released, but it is still used in several
hasn't been officially released, but it is still used in several
distributions (SuSE, etc) as v18 is very old.
1.30 Noteworthy changes in version 0.10.0
1.32 Noteworthy changes in version 0.10.0
===========================================
This release is binary incompatible with previous releases. The
@ -470,16 +522,16 @@ new version.
• Model loading supports window auto-positioning
• Keyed encoding is supported in many classes.
1.31 Noteworthy changes in version 0.9.5
1.33 Noteworthy changes in version 0.9.5
==========================================
• Beginnings of CUPS interface were added.
• Added new control colors and methods from 10.3 version of Cocoa.
• Added new font methods from 10.3 version of Cocoa.
• NSApplication -runModalSession behavior changed.
• You can find the GUI librarys version using the Info.plist
• You can find the GUI library's version using the Info.plist
1.32 Noteworthy changes in version 0.9.4
1.34 Noteworthy changes in version 0.9.4
==========================================
• The printing classes have been completely reorganized to
@ -490,7 +542,7 @@ new version.
• NSScroller, NSScrollView has a new ivar.
• Some improvement of NSDataLink classes.
1.33 Noteworthy changes in version 0.9.3
1.35 Noteworthy changes in version 0.9.3
==========================================
• Spell checker reimplemented using libaspell
@ -499,7 +551,7 @@ new version.
• Binary incompatibilites from ivar additions in NSView and
subclasses.
1.34 Noteworthy changes in version 0.9.2
1.36 Noteworthy changes in version 0.9.2
==========================================
• Working NSToolbar implementation
@ -511,21 +563,21 @@ new version.
• NSStringDrawing redesigned.
• Much improved loading of gorm files
1.35 Noteworthy changes in version 0.9.1
1.37 Noteworthy changes in version 0.9.1
==========================================
• NSWindow - DnD works on whole window and events are propogated up
to first DnD aware view.
• Absolute paths and DnD works in OpenPanels.
1.36 Noteworthy changes in version 0.9.0
1.38 Noteworthy changes in version 0.9.0
==========================================
Improvements in various classes, include NSPopUpButton,
NSBitmapImageRep, NSMenu, NSToolbar. Added support for thumbnail images
in NSWorkspace.
1.37 Noteworthy changes in version 0.8.9
1.39 Noteworthy changes in version 0.8.9
==========================================
Note that many headers have moved to new locations (both in the package
@ -534,13 +586,13 @@ applications may not compile because they cannot find the right header.
• New Language Setup documentation.
1.38 Noteworthy changes in version 0.8.8
1.40 Noteworthy changes in version 0.8.8
==========================================
• Updated LanguageSetup documentation
• Improved RTF reader (unicode support, etc).
1.39 Noteworthy changes in version 0.8.7
1.41 Noteworthy changes in version 0.8.7
==========================================
• NSBezierPath glyph methods implemented (depends on backend).
@ -548,7 +600,7 @@ applications may not compile because they cannot find the right header.
• Added default to load user-defined bundles (GSAppKitUserBundles
default).
1.40 Noteworthy changes in version 0.8.6
1.42 Noteworthy changes in version 0.8.6
==========================================
Updated to install in new locations based on changes in gnustep-make
@ -558,12 +610,12 @@ Updated to install in new locations based on changes in gnustep-make
• Speed improvements, especially in tracking mouses movements.
• Lots of menu improvements.
1.41 Noteworthy changes in version 0.8.5
1.43 Noteworthy changes in version 0.8.5
==========================================
Bug fixes. NSStringDrawing now uses text system implementation.
1.42 Noteworthy changes in version 0.8.4
1.44 Noteworthy changes in version 0.8.4
==========================================
This release features a brand new text and layout system thanks to
@ -574,7 +626,7 @@ Alexander Malmberg. Other improvements include:
• Printing fixes.
• NSToolbar partially implemented.
1.43 Noteworthy changes in version 0.8.3
1.45 Noteworthy changes in version 0.8.3
==========================================
• Additions for Gorm support.
@ -585,10 +637,10 @@ Alexander Malmberg. Other improvements include:
• Window focus fixes
• Key view handling rewritten.
1.44 Noteworthy changes in version 0.8.2
1.46 Noteworthy changes in version 0.8.2
==========================================
• Handle fonts that arent found better.
• Handle fonts that aren't found better.
• Implement pageUp/Down.
• Some window focusing problems fixed.
• Quartz-like interface partially implemented.
@ -596,7 +648,7 @@ Alexander Malmberg. Other improvements include:
• NSBrowser: implement non-separate columns
• Fix firstResponder status in text fields.
1.45 Noteworthy changes in version 0.8.1
1.47 Noteworthy changes in version 0.8.1
==========================================
• Handle scaled curves correctly.
@ -605,23 +657,23 @@ Alexander Malmberg. Other improvements include:
• NSSound implemented. gssnd sound server.
• Spell checker starts correctly now.
1.46 Noteworthy changes in version 0.8.0
1.48 Noteworthy changes in version 0.8.0
==========================================
1.47 Noteworthy changes in version 0.7.9
1.49 Noteworthy changes in version 0.7.9
==========================================
• NSTableView, NSOutlineView improvements.
• Menus no longer work in modal loop.
• Skeleton implementation of NSToolBar
1.48 Noteworthy changes in version 0.7.8
1.50 Noteworthy changes in version 0.7.8
==========================================
• Wheel color picker, standard color picker (bundles) added.
• System colors now use named colors. Easier configuration
1.49 Noteworthy changes in version 0.7.7
1.51 Noteworthy changes in version 0.7.7
==========================================
The graphics/window interface was completely revamped. Window functions
@ -643,7 +695,7 @@ computers, although it is in a very alpha state.
• Better autolayout with GSTable and subclasses.
• NSOutlineView much improved.
1.50 Noteworthy changes in version 0.7.6
1.52 Noteworthy changes in version 0.7.6
==========================================
• NSOutlineView implemented.
@ -652,7 +704,7 @@ computers, although it is in a very alpha state.
• Fully-functional keybindings, including multi-stroke keybindings.
• Memory panel available from Info Panel.
1.51 Noteworthy changes in version 0.7.5
1.53 Noteworthy changes in version 0.7.5
==========================================
• Drag and drop and image sliding much improved.
@ -670,7 +722,7 @@ computers, although it is in a very alpha state.
• Near rewrite of Menu handling code.
• Gmodel code compiled as a separate bundle.
1.52 Noteworthy changes in version 0.7.0
1.54 Noteworthy changes in version 0.7.0
==========================================
• Much improvement in NSBrowser, NSMatrix, NSPopUpButton, combo
@ -681,7 +733,7 @@ computers, although it is in a very alpha state.
• simpler, faster compilation and installation.
• NSColorWell works.
1.53 Noteworthy changes in version 0.6.7
1.55 Noteworthy changes in version 0.6.7
==========================================
• App Icons can support documents dropped using DnD.
@ -697,7 +749,7 @@ computers, although it is in a very alpha state.
• Implemented object value and formatter support in NSCell
• Support middle mouse button.
1.54 Noteworthy changes in version 0.6.6
1.56 Noteworthy changes in version 0.6.6
==========================================
• Window hints for motif and generic window managers.
@ -723,7 +775,7 @@ however, that the xdps backend is still considered experimental and you
may have to deal with many problems in order to get it working. We
recommend sticking with the xgps backend (the default) for now.
1.55 Noteworthy changes in version 0.6.5
1.57 Noteworthy changes in version 0.6.5
==========================================
Many of the basic GUI classes have been vastly improved or rewritten,
@ -747,10 +799,10 @@ thanks to Nicola Pero <n.pero@mi.flashnet.it> and many others.
been written, thanks to Richard Frith-Macdonald
<richard@brainstorm.co.uk>
1.56 Noteworthy changes in version 0.6.0
1.58 Noteworthy changes in version 0.6.0
==========================================
A Huge amount of progress, although a lot still needs to be done. Its
A Huge amount of progress, although a lot still needs to be done. It's
usable for a large base of moderately simple apps. Several
NeXT/OpenStep apps and libraries have been ported with little changes.
@ -768,7 +820,7 @@ NeXT/OpenStep apps and libraries have been ported with little changes.
• Rewrite of NSSavePanel and NSOpenPanel
• Several fixes that at least double the speed of the gui.
1.57 Noteworthy changes in version 0.5.5
1.59 Noteworthy changes in version 0.5.5
==========================================
Too extensive to list.
@ -776,7 +828,7 @@ Too extensive to list.
• A lot of rewritting has been done to the classes, with general
cleanup of coordinate conversion code, etc.
1.58 Noteworthy changes in version 0.5.0
1.60 Noteworthy changes in version 0.5.0
==========================================
• NSBrowser and NSBrowserCell have been implemented. There is one
@ -811,7 +863,7 @@ Too extensive to list.
• NSBox has been implemented.
• The library has been ported to work under Solaris with the native
DPS and the NeXT/Apples Portable Distributed Objects (PDO)
DPS and the NeXT/Apple's Portable Distributed Objects (PDO)
environment.
• The library has been integrated with the makefile package so we now
@ -825,7 +877,7 @@ Too extensive to list.
• Several cleanups and as usual, many bug fixes.
1.59 Noteworthy changes in version 0.3.0
1.61 Noteworthy changes in version 0.3.0
==========================================
• Completely reworked the menu class. The NSMenu class is now
@ -856,7 +908,7 @@ Too extensive to list.
retain/release policy has been fixed, the cell classes correctly
implement the NSCopying protocol and many others.
1.60 Noteworthy changes in version 0.2.0
1.62 Noteworthy changes in version 0.2.0
==========================================
• Additional NSImage and NSImageRep class work. Incorporated common
@ -890,7 +942,7 @@ Too extensive to list.
• Many bug fixes and minor enhancements.
1.61 Noteworthy changes in version 0.1.1
1.63 Noteworthy changes in version 0.1.1
==========================================
• Almost complete implementation of the PXKMenu and PXKMenuCell
@ -913,7 +965,7 @@ Too extensive to list.
• Now requires the TIFF library for reading, writing, and
manipulating tiff files and images.
1.62 Noteworthy changes in version 0.1.0
1.64 Noteworthy changes in version 0.1.0
==========================================
• Integration of the GNUstep X/DPS GUI Backend. This has finally

View file

@ -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"

View file

@ -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

View file

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

View file

@ -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 \

View file

@ -1280,7 +1280,7 @@ typedef NSInteger GSLayoutViewAttribute;
RELEASE(_viewAlignmentRectByViewIndex);
RELEASE(_viewIndexByViewHash);
RELEASE(_constraintsByViewIndex);
RELEASE(_constraintsByViewIndex);
RELEASE(_layoutConstraintsBySolverConstraint);
RELEASE(_supportingConstraintsByConstraint);
RELEASE(_constraintsByAutoLayoutConstaintHash);
RELEASE(_internalConstraintsByViewIndex);

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,59 @@
/* Definition of class GSControllerTreeProxy
Copyright (C) 2024 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: 24-06-2024
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110 USA.
*/
#ifndef _GSControllerTreeProxy_h_GNUSTEP_GUI_INCLUDE
#define _GSControllerTreeProxy_h_GNUSTEP_GUI_INCLUDE
#import "AppKit/NSTreeNode.h"
@class NSTreeController;
#if defined(__cplusplus)
extern "C" {
#endif
@interface GSControllerTreeProxy : NSTreeNode
{
NSTreeController *_controller;
}
- (instancetype) initWithContent: (id)content
withController: (id)controller;
- (NSUInteger) count;
- (NSMutableArray *) children;
- (id) value;
- (void) setValue: (id)value;
@end
#if defined(__cplusplus)
}
#endif
#endif /* _GSControllerTreeProxy_h_GNUSTEP_GUI_INCLUDE */

View file

@ -0,0 +1,90 @@
/* Implementation of class GSControllerTreeProxy
Copyright (C) 2024 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: 24-06-2024
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110 USA.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSString.h>
#import "AppKit/NSTreeController.h"
#import "GSControllerTreeProxy.h"
#import "GSBindingHelpers.h"
@implementation GSControllerTreeProxy
- (instancetype) initWithContent: (id)content
withController: (id)controller
{
NSMutableDictionary *dict =
[NSMutableDictionary dictionaryWithObject:
[NSMutableArray arrayWithArray: content]
forKey: @"children"];
self = [super initWithRepresentedObject: dict];
if (self != nil)
{
ASSIGN(_controller, controller);
}
return self;
}
- (NSUInteger) count
{
NSArray *children = [[self representedObject] objectForKey: @"children"];
return [children count];
}
// This is here so that when the path is specified as "children" it responds
- (NSMutableArray *) children
{
NSDictionary *ro = [self representedObject];
NSMutableArray *children = [ro objectForKey: @"children"];
return children;
}
- (id) value
{
return [_representedObject objectForKey: @"value"];
}
- (void) setValue: (id)value
{
[_representedObject setObject: value
forKey: @"value"];
}
// These return the value in the cases where the parent class method is called...
- (NSArray *) childNodes
{
return [self children];
}
- (NSMutableArray *) mutableChildNodes
{
return [self children];
}
@end

View file

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

View file

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

View file

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

View file

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

View file

@ -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.

View file

@ -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

View file

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

View file

@ -44,6 +44,7 @@
#import "AppKit/NSGraphics.h"
#import "AppKit/NSImage.h"
#import "AppKit/NSImageView.h"
#import "AppKit/NSKeyValueBinding.h"
#import "AppKit/NSMenuView.h"
#import "AppKit/NSMenuItemCell.h"
#import "AppKit/NSOutlineView.h"
@ -70,6 +71,7 @@
#import "GNUstepGUI/GSToolbarView.h"
#import "GNUstepGUI/GSTitleView.h"
#import "GSBindingHelpers.h"
/* a border width of 5 gives a reasonable compromise between Cocoa metrics and looking good */
/* 7.0 gives us the NeXT Look (which is 8 pix wide including the shadow) */
@ -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)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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;
}

View file

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

File diff suppressed because it is too large Load diff

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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;
}
}
}

View file

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

View file

@ -40,7 +40,7 @@
#import <Foundation/NSMapTable.h>
#import <Foundation/NSValue.h>
#import <Foundation/NSValueTransformer.h>
#import <GNUstepBase/GSLock.h>
#import <Foundation/NSLock.h>
#import "AppKit/NSKeyValueBinding.h"
#import "GSBindingHelpers.h"
@ -145,7 +145,7 @@ void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey,
{
if (self == [GSKeyValueBinding class])
{
bindingLock = [GSLazyRecursiveLock new];
bindingLock = [NSRecursiveLock new];
classTable = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
NSObjectMapValueCallBacks, 128);
objectTable = NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks,
@ -192,8 +192,11 @@ void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey,
if (!objectTable)
return nil;
NSDebugLLog(@"NSBinding", @"+++ called with %@, %@", binding, anObject);
[bindingLock lock];
bindings = (NSMutableDictionary *)NSMapGet(objectTable, (void *)anObject);
NSDebugLLog(@"NSBinding", @"+++ Bindings found for %@ => %@", anObject, bindings);
if (bindings != nil)
{
theBinding = (GSKeyValueBinding*)[bindings objectForKey: binding];
@ -321,6 +324,11 @@ void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey,
[super dealloc];
}
- (id) observedObject
{
return [info objectForKey: NSObservedObjectKey];
}
- (id) destinationValue
{
id newValue;

View file

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

View file

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

View file

@ -0,0 +1,86 @@
/* Implementation of class NSMenuToolbarItem
Copyright (C) 2024 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: 03-05-2024
This file is part of the GNUstep Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110 USA.
*/
#import "AppKit/NSMenuToolbarItem.h"
#import "AppKit/NSMenu.h"
#import "AppKit/NSImage.h"
#import "GNUstepGUI/GSTheme.h"
@implementation NSMenuToolbarItem
- (instancetype) initWithItemIdentifier: (NSString *)identifier
{
self = [super initWithItemIdentifier: identifier];
if (self != nil)
{
[self setImage: [NSImage imageNamed: @"NSMenuToolbarItem"]];
[self setTarget: self];
[self setAction: @selector(_showMenu:)];
}
return self;
}
- (void) dealloc
{
RELEASE(_menu);
[super dealloc];
}
- (BOOL) showsIndicator
{
return _showsIndicator;
}
- (void) setShowsIndicator: (BOOL)flag
{
_showsIndicator = flag;
if (_showsIndicator == YES)
{
[self setImage: [NSImage imageNamed: @"NSMenuToolbarItem"]];
}
else
{
[self setImage: nil];
}
}
- (NSMenu *) menu
{
return _menu;
}
- (void) setMenu: (NSMenu *)menu
{
ASSIGN(_menu, menu);
}
- (void) _showMenu: (id)sender
{
[[GSTheme theme] rightMouseDisplay: _menu
forEvent: nil];
}
@end

View file

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

View file

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

View file

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

File diff suppressed because it is too large Load diff

View file

@ -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

View file

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

View file

@ -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.

View file

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

View file

@ -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

File diff suppressed because it is too large Load diff

View file

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

View file

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

View file

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

View file

@ -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];

View file

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

View file

@ -28,7 +28,7 @@
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
*/
#import "config.h"
@ -131,6 +131,7 @@ static NSImage *multipleFiles = nil;
static NSImage *unknownApplication = nil;
static NSImage *unknownTool = nil;
static NSLock *classLock = nil;
static NSLock *mlock = nil;
static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification";
@ -598,26 +599,22 @@ static NSDictionary *urlPreferences = nil;
{
if (self == [NSWorkspace class])
{
static BOOL beenHere = NO;
NSFileManager *mgr = [NSFileManager defaultManager];
NSString *service;
NSData *data;
NSDictionary *dict;
[self setVersion: 1];
[gnustep_global_lock lock];
if (beenHere == YES)
if (classLock)
{
[gnustep_global_lock unlock];
return;
}
beenHere = YES;
classLock = [NSLock new];
mlock = [NSLock new];
NS_DURING
{
NSFileManager *mgr = [NSFileManager defaultManager];
NSString *service;
NSData *data;
NSDictionary *dict;
service = [[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSUserDomainMask, YES) objectAtIndex: 0]
stringByAppendingPathComponent: @"Services"];
@ -675,12 +672,9 @@ static NSDictionary *urlPreferences = nil;
}
NS_HANDLER
{
[gnustep_global_lock unlock];
[localException raise];
}
NS_ENDHANDLER
[gnustep_global_lock unlock];
}
}
@ -698,14 +692,14 @@ static NSDictionary *urlPreferences = nil;
{
if (sharedWorkspace == nil)
{
[gnustep_global_lock lock];
[classLock lock];
if (sharedWorkspace == nil)
{
sharedWorkspace =
(NSWorkspace*)NSAllocateObject(self, 0, NSDefaultMallocZone());
[sharedWorkspace init];
}
[gnustep_global_lock unlock];
[classLock unlock];
}
return sharedWorkspace;
}
@ -800,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()];
@ -811,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];
@ -1520,13 +1514,13 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
if ([fileType isEqual: NSFileTypeDirectory] == YES)
{
NSString *iconPath = nil;
if ([pathExtension isEqualToString: @"app"]
|| [pathExtension isEqualToString: @"debug"]
|| [pathExtension isEqualToString: @"profile"])
{
image = [self appIconForApp: fullPath];
if (image == nil)
{
/*

View file

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

View file

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

View file

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

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

View file

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

View file

@ -8,44 +8,57 @@
int main()
{
START_SET("NSButtonCell encoding tests")
START_SET("NSButtonCell encoding tests")
NS_DURING
{
[NSApplication sharedApplication];
}
{
[NSApplication sharedApplication];
}
NS_HANDLER
{
if ([[localException name] isEqualToString: NSInternalInconsistencyException ])
SKIP("It looks like GNUstep backend is not yet installed")
}
{
if ([[localException name]
isEqualToString: NSInternalInconsistencyException ])
{
SKIP("It looks like GNUstep backend is not yet installed")
}
}
NS_ENDHANDLER
NSString* mask = @"NSButtonFlags2";
NSButtonCell* item = [[NSButtonCell alloc] init];
NSString *mask = @"NSButtonFlags2";
NSButtonCell *item = [[NSButtonCell alloc] init];
item.keyEquivalent = @"A";
item.keyEquivalentModifierMask = NSShiftKeyMask;
NSMutableData *data = [NSMutableData data];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
NSMutableData *data = [NSMutableData data];
NSKeyedArchiver *archiver;
[archiver encodeRootObject:item];
archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData: data];
[archiver encodeRootObject: item];
[archiver finishEncoding];
NSError* error;
NSDictionary* archive = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListImmutable format:nil error:&error];
NSError *error;
NSDictionary *archive;
NSArray* topLevelObjects = [archive objectForKey:@"$objects"];
archive = [NSPropertyListSerialization
propertyListWithData: data
options: NSPropertyListImmutable
format: nil
error: &error];
NSDictionary* dict;
NSArray *topLevelObjects = [archive objectForKey: @"$objects"];
NSEnumerator *enumerator = [topLevelObjects objectEnumerator];
NSDictionary *dict;
id element;
for (id element in topLevelObjects)
while ((element = [enumerator nextObject]) != nil)
{
if ([element isKindOfClass:[NSDictionary class]])
if ([element isKindOfClass: [NSDictionary class]])
{
dict = (NSDictionary*)element;
if ([[dict allKeys] containsObject:mask])
if ([[dict allKeys] containsObject: mask])
{
break;
}
@ -53,14 +66,22 @@ int main()
{
dict = nil;
}
}
}
}
}
PASS(dict != nil, "Found a dict with a NSButtonFlags2 entry");
NSNumber* encodedKeyMask = [dict valueForKey:mask];
NSNumber *encodedKeyMask = [dict valueForKey: mask];
int expect = (NSShiftKeyMask << 8);
int modMask = (NSEventModifierFlagDeviceIndependentFlagsMask << 8);
int found = [encodedKeyMask intValue] & modMask;
PASS(encodedKeyMask != nil, "Retrieved the NSButtonFlags2 value");
PASS([encodedKeyMask intValue] & NSEventModifierFlagDeviceIndependentFlagsMask << 8 == NSShiftKeyMask, "Encoded key mask 0x%x matches expected key mask 0x%x", [encodedKeyMask intValue] & NSEventModifierFlagDeviceIndependentFlagsMask << 8, NSShiftKeyMask << 8);
PASS(found == expect,
"Encoded key mask 0x%x matches expected key mask 0x%x",
found, expect);
END_SET("NSButtonCell encoding tests")
}
END_SET("NSButtonCell encoding tests")
return 0;
}

Some files were not shown because too many files have changed in this diff Show more