Commit graph

7040 commits

Author SHA1 Message Date
Gregory John Casamento
0276e307cc Fix compile error, add new class 2024-04-22 09:00:53 -04:00
Gregory John Casamento
20a08a894f Minor updates 2024-04-22 09:00:53 -04:00
Gregory John Casamento
1b467763bc Rebased to master 2024-04-22 09:00:53 -04:00
Gregory John Casamento
cad79f2e0e Add non-keyed coding 2024-04-22 09:00:53 -04:00
Gregory John Casamento
b895ffe953 Add NSTableCellView class header and simple implementation 2024-04-22 09:00:53 -04:00
Gregory John Casamento
4800a950ef Add new classes 2024-04-22 09:00:53 -04:00
Gregory John Casamento
3acf49a33d Fix compile error, add new class 2024-04-22 09:00:53 -04:00
Gregory John Casamento
a7a7a1e691 Minor updates 2024-04-22 09:00:53 -04:00
Gregory John Casamento
d939fdfd1e Add objectValue accessors 2024-04-22 09:00:53 -04:00
Gregory John Casamento
edb517ceca Initial skeleton for NSTableCellView 2024-04-22 09:00:53 -04:00
Gregory John Casamento
968e78ab34 Add initial versions of NSTableCellView.[hm] and NSTableRowView.[hm] 2024-04-22 09:00:53 -04:00
williameveretteggplant
d1562a37cd
Left shift key equivalent modifier mask in xib unarchiver (#259)
* Left shift key equivalent modifier mask in xib unarchiver

This is necessary to offset the 8 bit right shift that occurs in the initWithCoder: method in NSButtonCell

* Shift modifier mask in xib unarchiver
2024-04-19 18:58:00 +02:00
williameveretteggplant
192c121a9d
Set editable property in NSCell default to false (#257)
Unarchiving a NSCell element from a xib will have the editable property set to false unless explicitly set to true.
2024-04-09 17:26:30 +02:00
williameveretteggplant
7b8c02182e
Fix NSImageView intercepting mouse events when not editable (#256)
* Update NSImageView.m

* Refactor editable condition

* Remove empty line, left over from previous changes

---------

Co-authored-by: Fred Kiefer <fredkiefer@gmx.de>
2024-04-08 20:54:47 +02:00
Frederik Carlier
892ed4877e
NSBox: (re-)implement isOpaque (#254)
This (re-)implements logic where a box is marked
as opaque if it is a custom box which is not
transparent, but moves the logic to `GSTheme`,
allowing themes to override this loggic.

This fixes the rendering of custom boxes with a
custom fill color; the current implementation
would mark them as non-opaque and hence the fill
color would not be rendered.

- The original implementation (from 1999) always
  returned `YES`
  (53bcb50240)
- A more complete implementation was backported
  from the Testplant branch in 2012
  (e85b16bc05, by
  @fredkiefer, upstream commit
  36e77b95f7)
- More recently, the a return value of `NO` was
  hardcoded
  (02bc49e2d5, by
  @ericwa)
2024-04-04 22:23:14 +02:00
Frederik Carlier
95f302442c
NSBox: decode NSBorderColor2 and NSFillColor2 (#255) 2024-04-04 20:34:42 +02:00
Frederik Carlier
85b8a3e495
[NSTableView initWithCoder]: Read alternatingRowBackgroundColors, from tableViewFlags (#252)
* [NSTableView initWithCoder]: Read alternatingRowBackgroundColors,  from tableViewFlags

* [NSTableView _numRows]: Check _tableColumns is not empty

* [NSTableView encodeWithCoder]: add autosaveTableColumns, usesAlternatingRowBackgroundColors
2024-04-03 23:54:10 +02:00
Frederik Carlier
059d13f5ab
highlightTableViewSelection: Always use default selection color if not set. (#253)
The current implementation will attempt to assign a default value for selectionColor if backgroundColor is white.  There's two issues with that:

1. `backgroundColor` is likely in the `NSNamedColorSpace`,  whereas it is being compared to `[NSColor whiteColor]`, which is in the `NSCalibratedWhiteColorSpace`. That comparision will always return false.
2. Users will probably expect the selected item to be highlighted in a different color even if the background color is not white.  For example, the consider a scenario where the default background color is white, and the alternate background color is grey.  It makes sense to always highlight the selected row in blue.  This aligns with the behavior when `highlightedTableRowBackgroundColor` is defined.
2024-04-03 23:43:33 +02:00
Frederik Carlier
f46accfa9c
GSXib5KeyedUnarchiver: Add mapping for NSSegmentItemLabel, NSSegmentItemImage (#251) 2024-04-03 23:24:22 +02:00
Frederik Carlier
c6082e31db
NSGraphicsContext: Suppress incompatible pointer type warning (#250)
```
NSGraphicsContext.m:349:50: warning: incompatible pointer types sending 'Class' to parameter of type 'id<NSCopying>' [-Wincompatible-pointer-types]
      methods = [[classMethodTable objectForKey: [self class]] pointerValue];
                                                 ^~~~~~~~~~~~
/usr/local/include/Foundation/NSDictionary.h:115:26: note: passing argument to parameter 'aKey' here
  (GS_GENERIC_TYPE(KeyT))aKey;                          // Primitive
                         ^
NSGraphicsContext.m:354:37: warning: incompatible pointer types sending 'Class' to parameter of type 'id<NSCopying>' [-Wincompatible-pointer-types]
                            forKey: [self class]];
                                    ^~~~~~~~~~~~
```
2024-04-01 22:54:57 +02:00
Frederik Carlier
c50123f870
GSTextStorage: Add function prototypes (#249)
Add a function prototype for:
- `addImp` (`(void)addObject:(ObjectType)anObject`)
- `insImp` (`(void)insertObject:(ObjectType)anObject atIndex:(NSUInteger)index`)
- `remImp` (`(void)removeObject:(ObjectType)anObject`)
-  cntImp (`count`)

Fixes warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
2024-04-01 22:53:23 +02:00
Frederik Carlier
4470a157d7
Remove unused variables (#247)
Fixes a compiler warnings
2024-04-01 21:05:46 +02:00
Frederik Carlier
1c26da1f27
NSInterfaceStyle: Fix void-pointer-to-enum-cast warning (#248)
Cast to `uintptr_t` before casting to `enum` to suppress warning.

```
NSInterfaceStyle.m:134:15: warning: cast to smaller integer type 'NSInterfaceStyle' from 'void *' [-Wvoid-pointer-to-enum-cast]
      style = (NSInterfaceStyle)NSMapGet(styleMap, key);
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NSInterfaceStyle.m:234:24: warning: cast to smaller integer type 'NSInterfaceStyle' from 'void *' [-Wvoid-pointer-to-enum-cast]
      if (newStyle != ((NSInterfaceStyle)val))
                       ^~~~~~~~~~~~~~~~~~~~~
```
2024-04-01 16:49:46 +02:00
Frederik Carlier
2372b76cc8
This commits updates the libs-gui build process to generate a gnustep-gui.pc file which is installed in /lib/pkgconfig and contains the GNUstep gui version number, the libraries to link (equivalent to gnustep-config --gui-libs) with and the C flags to use (equivalent to gnustep-config --objc-flags). (#246)
This can be useful when linking with libs-gui in projects which don't use the GNUstep build system.
2024-03-27 23:39:23 +01:00
Fred Kiefer
c12fdd26f7 Set delegate of NSTextView to nil in dealloc. 2024-03-26 22:53:44 +01:00
Fred Kiefer
a054b21355 * Source/NSTextView.m: Add support for NSFilenamenPboardType.
Change by OnFlApp (https://githup.com/onflapp)
2024-03-18 22:53:46 +01:00
OnFlApp
1e956c96df
NSTextView: support drop for NSFilenamesPboardType (#156)
* NSTextView: support drop for NSFilenamesPboardType

* code cleanup

* code fixes
2024-03-18 22:35:29 +01:00
rfm
324308b4e8 fixup error in pasteboard types provided when png is available 2024-03-04 22:08:00 +00:00
Riccardo
7a215fcb01
Magick fix (#244)
* Fix include for ImageMagick 7

* add version test for MagickCore and conditionally include the path to MagickCore.h

* autoreconf with 2.69
2024-02-29 09:26:24 +01:00
rfm
cff4f39db3 Set timeout for pasteboard to 30 seconds rather than 2 (for slow providers). 2024-02-20 10:10:32 +00:00
ethanc8
9202dfeece Implement -appearannce, -setAppearance: and -effectiveApperance for NSView 2024-02-10 12:25:59 -06:00
ethanc8
12ca9f6996 Stylistic fixes for -[NSAppearance effectiveAppearance] 2024-02-05 15:27:03 -06:00
ethanc8
9db91f702e Rename the new NSScroller methods to the names used by Apple 2024-02-05 15:26:42 -06:00
ethanc8
61c9699021 Re-add layout code that was mistakenly removed 2024-02-05 14:43:31 -06:00
ethanc8
a91815f70a Add scroller styling options. 2023-12-31 20:05:11 -06:00
ethanc8
2303052e50 Add NSAppearanceCustomization to NSApplication and NSView 2023-12-31 20:03:21 -06:00
ethanc8
6aff0bd0f8 Add -[NSMenu popUpMenuPositioningItem:atLocation:inView:] 2023-12-31 19:27:38 -06:00
ethanc8
ea6c43911f Add beginSheet:completionHandler:-related methods:
-[NSWindow beginSheet:completionHandler:]
-[NSAlert beginSheetModalForWindow:completionHandler:]
2023-12-31 17:37:07 -06:00
Gregory John Casamento
969fe4c870 Add getting, additional change from branch, quick fix 2023-12-28 11:20:12 -05:00
Gregory Casamento
a5f92ecb8b
Merge pull request #233 from gnustep/NSShadow_issue217_nsgraphicscontext 2023-12-28 11:18:14 -05:00
Fred Kiefer
3a6dce02be Remove some gcc compiler warnings 2023-12-28 14:45:16 +01:00
Gregory John Casamento
9fab419042 Add shadow method to NSGraphicsContext and add set method to NSShadow 2023-12-28 06:47:25 -05:00
Gregory John Casamento
345b1b4065 Add call to setter as suggested by @fredkiefer 2023-12-27 12:37:33 -05:00
Gregory John Casamento
7be6c722e4 Add RETAIN, per review from @fredkiefer 2023-12-27 12:20:54 -05:00
Gregory John Casamento
874515c5b7 Add RETAIN, per review from @fredkiefer 2023-12-27 12:19:48 -05:00
Gregory John Casamento
ff90453263 Fix indentation issue and remove uneeded local var, per review from @fredkiefer 2023-12-27 12:17:48 -05:00
Gregory John Casamento
4e4755c533 Remove uneeded comments 2023-12-26 11:53:38 -05:00
Gregory John Casamento
cb4987ff47 Minor cleanup in NSView, add code to get NSShadowHoriz, NSShadowVert 2023-12-26 11:43:33 -05:00
Gregory John Casamento
702f7bb9af Untabify, add shadow keys for vert, color, horiz 2023-12-26 10:32:46 -05:00
Gregory John Casamento
468030a982 Add correct key for the NSShadow object which is NSViewShadow 2023-12-24 16:48:41 -05:00
Gregory John Casamento
70019a695a Add decoding logic for shadow to NSView 2023-12-24 16:16:52 -05:00
Gregory John Casamento
9cb00ba871 Add ivar for shadow 2023-12-24 13:59:12 -05:00
Gregory John Casamento
33d66e0ddc Update NSView with setShadow:/shadow methods 2023-12-24 13:28:08 -05:00
Gregory John Casamento
3f30d139bc Quick fix, resolves issue #153: Remove incorrect decoding of constraint 2023-12-22 16:47:40 -05:00
Gregory John Casamento
d9fa73870a Fix handling of custom classes for XIB v5. This corrects an issue in Gorm as well 2023-12-16 08:00:33 -05:00
Riccardo Mottola
e5c346351c doc fixes 2023-12-12 21:37:09 +01:00
Gregory John Casamento
3efb4ce9f3 Update per comments by @fredkiefer 2023-11-27 06:58:43 -05:00
Gregory John Casamento
87a73db572 Update calls to awakeFromNib and add call to prepareForInterfaceBuilder if we are in Gorm 2023-11-27 02:26:16 -05:00
Gregory John Casamento
8c421a3c8e Add method -prepareForInterfaceBuilder since it is in the same place as awakeFromNib and is trivial to add, this method will be useful in Gorm in the future 2023-11-24 22:22:14 -05:00
Gregory John Casamento
4b3014922c Move awakeFromNib implementation to NSObject instead of NSView, as discussed in the documentation 2023-11-24 21:32:15 -05:00
Riccardo Mottola
bdcced992c fix redundant semicolons 2023-11-20 22:43:49 +01:00
Riccardo Mottola
35aa22588a add IBOutlet and IBAction to doc WordList 2023-11-20 22:25:37 +01:00
Riccardo Mottola
08411ea68f fix some trailing semicolons 2023-11-17 16:53:43 +01:00
rfm
fb358c3b03 Fix missing semicolon 2023-11-14 21:36:12 +00:00
Riccardo Mottola
aa36664153 fix various autogsdoc warnings and issues 2023-11-14 01:29:01 +01:00
Kyle J Cardoza
dfa829bf38
Merge pull request #201 from KyleCardoza/add-gstheme-hooks
add gstheme hooks
2023-11-09 15:42:50 -05:00
Riccardo Mottola
34c5a5e841 use defined() to check if a variable is defined, also, rename it to be clearer about a feature availability and not enabling one 2023-10-26 02:38:29 +02:00
Frederik Carlier
31a71a1090
NSWorkspace: Throw a descriptive exception when make_services could not be found (#208)
`[NSTask launchPathForTool: @"make_services"]; can return nil when the tool is not found. In this case, [NSTask launchedTaskWithLaunchPath] would raise a NSInvalidArgumentException with error message "NSTask - no launch path set" which is not very descriptive.
2023-10-11 17:54:38 +02:00
Frederik Carlier
8619fe33c2
GifQuantizeBuffer is considered private API in libgif 5.2 and later (#207)
See befe188771/
2023-10-09 19:35:37 +02:00
Gregory John Casamento
2ac57c147f Remove uneeded calls to orderOut: and setDelegate: as this is done in the close method 2023-10-08 06:23:26 -04:00
Gregory John Casamento
a4beb1266f Fix spaces / formatting issue for return types 2023-10-08 05:43:18 -04:00
Gregory John Casamento
791a5d0aaf Cleanup classes. 2023-10-08 04:44:31 -04:00
Gregory John Casamento
4bb0270759 Update NSViewController with lifeCycle methods 2023-10-08 04:44:31 -04:00
Gregory John Casamento
24eee8e7dd Allow popover to be dismissed 2023-10-08 04:44:31 -04:00
Frederik Carlier
bcc8011580
Avoid accessing instance variables in inline functions when compiling with msvc (#205)
* Rename `DPSshfill` to `DPSshfill_`

This method takes one argument, so by convention, the name of the variable in the method table should end with a single underscore

* DPSOperators.h: Use macros to define inline functions

* Don't access instance variables when compiling with Visual Studio
2023-10-01 22:56:02 +02:00
Kyle J Cardoza
7f70818be2 Added the ability for GSTheme subclasses to provide custom implementations of GSWindowDecorator. 2023-09-22 21:17:15 -04:00
Kyle J Cardoza
225eea02d5 Addressed request for change in NSMenu.m, and moved function of
-[_organizeMenu] to GSTheme-[organizeMenu:isHorizontal].
2023-09-22 18:57:15 -04:00
Kyle J Cardoza
096327e87b Addressed changes requested in PR 201 2023-09-22 15:20:23 -04:00
Kyle J Cardoza
07f1b8759a Added window titlebar GSTheme hooks. 2023-09-22 01:42:47 -04:00
Kyle J Cardoza
a9f33627f1 Added menu organization hooks 2023-09-20 12:52:01 -04:00
Kyle J Cardoza
81b59ad0a0 Initial implementation of new GSTheme hooks and default implementations. 2023-09-19 22:20:12 -04:00
Riccardo Mottola
9faf904349 Merge branch 'warningfix' of https://github.com/gnustep/libs-gui into warningfix 2023-09-18 18:05:35 +02:00
Riccardo Mottola
670a86bb59 cleanup trailing backslash 2023-09-18 18:02:28 +02:00
Riccardo Mottola
5e68ebec91 fix warning, comparison with NULL 2023-09-13 01:11:48 +02:00
Riccardo Mottola
88a0e1e390 use destroy instead of assigning nil, avoids warnings and make smore sense anyway 2023-09-13 00:40:58 +02:00
Riccardo Mottola
a3117e5598 Put in methd in a private category to silence warning. Apple doesn't expose the method in its header, but we don't we don't know if it has it private. In case it is a GS extension, perhaps we should name it private with an _. 2023-09-12 23:49:05 +02:00
Riccardo Mottola
9e0685b315 do not install private headers 2023-09-12 23:19:06 +02:00
Riccardo Mottola
1815556e4e remove unused functions 2023-09-12 23:09:08 +02:00
Richard Frith-Macdonald
2e4af41c70 Fixup for APPKIT_EXPORT_CLASS 2023-09-05 17:02:06 +01:00
Gregory Casamento
3575f0af77 Add implementation of removeAllItems 2023-09-01 17:12:05 +00:00
Gregory Casamento
3f35da7860
Update code in GSXib5KeyedUnarchiver.m to read alternative toolTip format (#193)
* Update code in GSXib5KeyedUnarchiver.m to read alternative toolTip format

* Update to make the code a bit tighter, per suggestion by @fredkiefer
2023-08-31 23:46:34 +02:00
Gregory Casamento
629d065b91
Add dummy awakeFromNib dummy method (#195) 2023-08-31 23:41:46 +02:00
d99c96efcc
* Source/NSMenuItemCell.m (-_keyEquivalentString): Fix the 'and' check so that shiftKeyString can display (#190) 2023-08-26 11:32:30 +02:00
Fred Kiefer
570f2b4d2a * Source/NSSwitch.m (-drawRect:): Correct drawing as suggested by Austin Clow (dr_clow@me.com). 2023-08-13 20:27:48 +02:00
Benjamin Johnson
305bcd56a3
Implement GSCSTableau, GSCSEditInfo, GSCSEditVariableManager (#186)
* Implement GSCSTableau, GSCSEditInfo, GSCSEditVariableManager

* Update GSTableau based on feedback

* Remove adding expression term variable to external parameteric variables
2023-08-05 10:26:22 +02:00
Frederik Carlier
eb480b7748
NSGraphicsContext: Add methods method (#179)
gnustep-back uses the `NSGraphicsContext->methods` _variable_, but using an instance variable across module boundaries is not supported when building with Visual Studio.

This commits adds a `[NSGraphicsContext methods]` _method_, which can be accessed across module boundaries (and hence when building with Visual Studio).
2023-08-01 22:39:46 +02:00
Riccardo Mottola
0b9924e094 reduce scope of _imageRep from ivar to local to init 2023-07-27 14:35:25 +02:00
Gregory Casamento
f2b79365f4
NSDockTile - Implement methods to update the icon and show badge (#185)
NSDockTile - Implement methods to update the icon and show badge using a NSCustomImageRep. Link the NSDockTile view with the AppIcon window contentView.
GSTheme - add badgeColor color and corresponding methods to theme background, decoration and text color
2023-07-27 09:17:18 +02:00
Gregory Casamento
a34867faee
Merge pull request #184 from gnustep/gsdisplayserver_cleanup 2023-05-31 17:10:55 -04:00
Riccardo Mottola
3341f6f149 Remove now unused NSCurrentServerThreadKey key, previously it was used tor GSCurrentServer(), but it it is not needed anymore. Please use the function directly. 2023-05-30 00:15:47 +02:00