diff --git a/ChangeLog b/ChangeLog index 5ed1ae5d7..9d93a22cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2025-04-30 Gregory John Casamento + + * Headers/AppKit/NSColorSpace.h: Add NSColorSpaceModel* enumerated values. + 2025-02-11 Richard Frith-Macdonald * ANNOUNCE: diff --git a/Documentation/GuiUser/DefaultsSummary.gsdoc b/Documentation/GuiUser/DefaultsSummary.gsdoc index 8b4485a7d..f5fea817e 100644 --- a/Documentation/GuiUser/DefaultsSummary.gsdoc +++ b/Documentation/GuiUser/DefaultsSummary.gsdoc @@ -108,7 +108,7 @@ to be used to view application help.
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).
+ appropriate type ... usually rtf or rtfd files).
If this is set to NSHelpPanel 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. diff --git a/Headers/AppKit/NSColorSpace.h b/Headers/AppKit/NSColorSpace.h index e3fd7ad60..29eabebf5 100644 --- a/Headers/AppKit/NSColorSpace.h +++ b/Headers/AppKit/NSColorSpace.h @@ -44,7 +44,13 @@ typedef enum _NSColorSpaceModel NSRGBColorSpaceModel, NSCMYKColorSpaceModel, NSLABColorSpaceModel, - NSDeviceNColorSpaceModel + NSDeviceNColorSpaceModel, + NSColorSpaceModelUnknown = NSUnknownColorSpaceModel, + NSColorSpaceModelGray = NSGrayColorSpaceModel, + NSColorSpaceModelRGB = NSRGBColorSpaceModel, + NSColorSpaceModelCMYK = NSCMYKColorSpaceModel, + NSColorSpaceModelLAB = NSLABColorSpaceModel, + NSColorSpaceModelDeviceN = NSDeviceNColorSpaceModel } NSColorSpaceModel; APPKIT_EXPORT_CLASS diff --git a/PrinterTypes/English.lproj/Generic-PostScript_Printer-Postscript.ppd b/PrinterTypes/English.lproj/Generic-PostScript_Printer-Postscript.ppd index 917a3b2b5..622eae471 100644 --- a/PrinterTypes/English.lproj/Generic-PostScript_Printer-Postscript.ppd +++ b/PrinterTypes/English.lproj/Generic-PostScript_Printer-Postscript.ppd @@ -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" diff --git a/Source/GSAutoLayoutEngine.m b/Source/GSAutoLayoutEngine.m index 84c3f8a4b..5ecb081e0 100644 --- a/Source/GSAutoLayoutEngine.m +++ b/Source/GSAutoLayoutEngine.m @@ -1280,7 +1280,7 @@ typedef NSInteger GSLayoutViewAttribute; RELEASE(_viewAlignmentRectByViewIndex); RELEASE(_viewIndexByViewHash); RELEASE(_constraintsByViewIndex); - RELEASE(_constraintsByViewIndex); + RELEASE(_layoutConstraintsBySolverConstraint); RELEASE(_supportingConstraintsByConstraint); RELEASE(_constraintsByAutoLayoutConstaintHash); RELEASE(_internalConstraintsByViewIndex); diff --git a/Source/NSHelpManager.m b/Source/NSHelpManager.m index e09e4e652..83aa122de 100644 --- a/Source/NSHelpManager.m +++ b/Source/NSHelpManager.m @@ -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; + } } } diff --git a/Source/NSPrintInfo.m b/Source/NSPrintInfo.m index 2f82f6d4a..47ded456d 100644 --- a/Source/NSPrintInfo.m +++ b/Source/NSPrintInfo.m @@ -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 diff --git a/Source/NSView.m b/Source/NSView.m index 88f78ae0b..e6ad16481 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -2830,9 +2830,14 @@ in the main thread. - (void) _setNeedsDisplayInRect_real: (NSValue *)v { - NSRect invalidRect = [v rectValue]; + NSRect invalidRect; NSView *currentView = _super_view; + if (nil == v) + return; + + invalidRect = [v rectValue]; + /* * Limit to bounds, combine with old _invalidRect, and then check to see * if the result is the same as the old _invalidRect - if it isn't then @@ -5172,6 +5177,8 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level) - (void) layout { + _needsLayout = NO; + GSAutoLayoutEngine *engine = [self _layoutEngine]; if (!engine) { @@ -5307,7 +5314,6 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level) if (_needsLayout) { [self layout]; - _needsLayout = NO; } NSArray *subviews = [self subviews]; diff --git a/Tools/gopen.m b/Tools/gopen.m index 73b097b22..6bbdec407 100644 --- a/Tools/gopen.m +++ b/Tools/gopen.m @@ -1,9 +1,10 @@ /* This tool opens the appropriate application from the command line based on what type of file is being accessed. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2025 Software Foundation, Inc. - Written by: Gregory Casamento + Written by: Gregory Casamento + Riccardo Mottola Created: November 2001 This file is part of the GNUstep Project @@ -45,11 +46,12 @@ static NSString* absolutePath(NSFileManager *fm, NSString *path) { + if (nil == path || [path length] == 0) + return path; + + if (![path isAbsolutePath]) + path = [[fm currentDirectoryPath] stringByAppendingPathComponent: path] ; path = [path stringByStandardizingPath]; - if ([path isAbsolutePath] == NO) - { - path = [[fm currentDirectoryPath] stringByAppendingPathComponent: path]; - } return path; } @@ -100,7 +102,8 @@ main(int argc, char** argv, char **env_c) if (filetoopen) { - exists = [fm fileExistsAtPath: arg isDirectory: &isDir]; + filetoopen = absolutePath(fm, filetoopen); + exists = [fm fileExistsAtPath: filetoopen isDirectory: &isDir]; if (exists == NO) { if ([filetoopen hasPrefix: @"/"] == NO @@ -111,7 +114,6 @@ main(int argc, char** argv, char **env_c) } else { - filetoopen = absolutePath(fm, filetoopen); [workspace openFile: filetoopen withApplication: application]; }