mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 19:31:18 +00:00
Merge branch 'master' into nextspace
This commit is contained in:
commit
85c44ee8d8
23 changed files with 1668 additions and 298 deletions
|
@ -1,3 +1,5 @@
|
|||
---
|
||||
os: linux
|
||||
language: cpp
|
||||
dist: xenial
|
||||
compiler:
|
||||
|
@ -9,7 +11,7 @@ env:
|
|||
- LIBRARY_COMBO=ng-gnu-gnu BASE_ABI=--disable-mixedabi RUNTIME_VERSION=gnustep-1.9
|
||||
- LIBRARY_COMBO=ng-gnu-gnu RUNTIME_VERSION=gnustep-2.0
|
||||
- LIBRARY_COMBO=ng-gnu-gnu BASE_ABI=--disable-mixedabi RUNTIME_VERSION=gnustep-2.0
|
||||
matrix:
|
||||
jobs:
|
||||
exclude:
|
||||
- compiler: gcc
|
||||
env: LIBRARY_COMBO=ng-gnu-gnu RUNTIME_VERSION=gnustep-1.9
|
||||
|
@ -21,7 +23,6 @@ matrix:
|
|||
env: LIBRARY_COMBO=ng-gnu-gnu BASE_ABI=--disable-mixedabi RUNTIME_VERSION=gnustep-2.0
|
||||
- compiler: clang
|
||||
env: LIBRARY_COMBO=gnu-gnu-gnu
|
||||
sudo: required
|
||||
before_install:
|
||||
- sudo apt-get -qq update
|
||||
- sudo apt-get install -y cmake pkg-config libgnutls28-dev libgmp-dev libffi-dev libicu-dev libxml2-dev libxslt1-dev libssl-dev libavahi-client-dev zlib1g-dev
|
||||
|
|
61
ANNOUNCE
61
ANNOUNCE
|
@ -1,7 +1,7 @@
|
|||
1 ANNOUNCE
|
||||
**********
|
||||
|
||||
This is version 0.27.0 of the GNUstep GUI library ('gnustep-gui').
|
||||
This is version 0.28.0 of the GNUstep GUI library ('gnustep-gui').
|
||||
|
||||
1.1 What is the GNUstep GUI Library?
|
||||
====================================
|
||||
|
@ -32,40 +32,55 @@ Group's libjpeg library, and a back-end component from the GNUstep
|
|||
libraries. For example, to build the Cairo backend in the GNUstep Back
|
||||
library, you will need to install Cairo.
|
||||
|
||||
1.2 Noteworthy changes in version '0.27.0'
|
||||
1.2 Noteworthy changes in version '0.28.0'
|
||||
==========================================
|
||||
|
||||
This version includes numerous bugfixes, compatibility improvements and
|
||||
other changes accumulated over the last year. It also enables work to
|
||||
be done on integrating NSViews with a Core Animation renderer.
|
||||
This version adds support for modern XIB files and many new classes.
|
||||
Plus the usual bunch of bug fixes.
|
||||
|
||||
* Make targetForAction safer.
|
||||
* Speed up menu updates.
|
||||
* Clean up speech tool compilation and switch to newer interface.
|
||||
* Fix bug in CUPS subclassing introduced in last release.
|
||||
* Minor improvements to typesetting.
|
||||
* Add NSIsControllerMarker.
|
||||
* Fix tracking on segmented cell.
|
||||
* Bring slider cell closer to Cocoa implementation.
|
||||
* Add ivar for Core Animation in NSView.
|
||||
* Improve border calculation on printing.
|
||||
* Lazy load app icon.
|
||||
* Better detection of removable volumes.
|
||||
* Polish translations.
|
||||
* Japanese translations.
|
||||
* Lots of bug fixes.
|
||||
* Support loading of document XIB files.
|
||||
* Improve Key Value Binding for NSArrayController and add more
|
||||
bindings.
|
||||
* Better support for multi monitor usage and other improvement in the
|
||||
backend integration.
|
||||
* Add classes NSFontCollection, NSColorSampler, NSSpeechRecognizer,
|
||||
NSAppearance, NSPDFInfo, NSPICTImageRep, NSCIImageRep,
|
||||
NSPDFImageRep, NSPDFPanel, NSDataAsset, NSDatePicker,
|
||||
NSDatePickerCell, NSPredicateEditor, NSPredicateEditorRowTemplate,
|
||||
NSRuleEditor, NSGestureRecognizer, NSButtonTouchBarItem,
|
||||
NSCandidateListTouchBarItem, NSClickGestureRecognizer,
|
||||
NSColorPickerTouchBarItem, NSCustomTouchBarItem,
|
||||
NSGroupTouchBarItem, NSMagnificationGestureRecognizer,
|
||||
NSPanGestureRecognizer, NSPickerTouchBarItem,
|
||||
NSPopoverTouchBarItem, NSPressGestureRecognizer,
|
||||
NSRotationGestureRecognizer, NSSharingServicePickerTouchBarItem,
|
||||
NSSliderTouchBarItem, NSStepperTouchBarItem, NSTouchBarItem,
|
||||
NSTouchBar, NSTouch, NSDockTile.
|
||||
* Implement NSEPSImageRep.
|
||||
* Better encoding handling in RTF files.
|
||||
* Theming and drawing improvements.
|
||||
* Increase small font size to 10.
|
||||
* New cursor and stepper images.
|
||||
* Move NSFileWrapper to Foundation.
|
||||
* Fixed build on Debian GNU/kFreeBSD.
|
||||
* With command line argument -autolaunch YES, do not activate the
|
||||
application when -activateIgnoringOtherApps: is invoked.
|
||||
* Improvements to WindowMaker compatibility (e.g. WMFHideApplication
|
||||
support).
|
||||
* Lowered NSFloatingWindowLevel by one to distinguish floating panels
|
||||
from menus.
|
||||
|
||||
1.3 Where can you get it? How can you compile it?
|
||||
=================================================
|
||||
|
||||
The gnustep-gui-0.27.0.tar.gz distribution file has been placed at
|
||||
The gnustep-gui-0.28.0.tar.gz distribution file has been placed at
|
||||
<ftp://ftp.gnustep.org/pub/gnustep/core>.
|
||||
|
||||
It is accompanied by gnustep-back-0.27.0.tar.gz.sig, a PGP signature
|
||||
It is accompanied by gnustep-back-0.28.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.27.0.tar.gz.sig
|
||||
gpg --verify gnustep-gui-0.28.0.tar.gz.sig
|
||||
|
||||
Signature has been created using the key with the following
|
||||
fingerprint:
|
||||
|
|
35
ChangeLog
35
ChangeLog
|
@ -1,3 +1,36 @@
|
|||
2020-04-05 Ivan Vucica <ivan@vucica.net>
|
||||
|
||||
* ANNOUNCE:
|
||||
* Documentation/ReleaseNotes.gsdoc:
|
||||
* Documentation/news.texi:
|
||||
* NEWS:
|
||||
Updating documentation for the 0.28.0 release.
|
||||
|
||||
2020-04-01 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSAlert.m (NSBeginAlertSheet): Restore call to delegate
|
||||
method which was lost a while ago.
|
||||
|
||||
* Source/NSAlert.m (NSBeginCriticalAlertSheet,
|
||||
NSBeginInformationalAlertSheet): Remove redundant calls to close
|
||||
method.
|
||||
|
||||
* Source/NSAlert.m (NSBeginAlertSheet, NSBeginCriticalAlertSheet,
|
||||
NSBeginInformationalAlertSheet): Change arguments names to reduce
|
||||
confusion about the intended use of the corresponding selectors.
|
||||
|
||||
2020-03-26 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Documentation/news.texi: Started to fill in some details for
|
||||
pending release.
|
||||
* .travis.yml: Try to keep up with Niels' changes in base.
|
||||
|
||||
2020-03-12 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Model/GNUmakefile: do not overwrite ADDITIONAL_INCLUDE_DIRS
|
||||
value to help RPM build. In spec file ADDITIONAL_INCLUDE_DIRS can be sat
|
||||
to subdirectories which are create by RPM build tool.
|
||||
|
||||
2020-03-05 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Source/NSWindow.m (_applyFrame:): new helper method to do actual
|
||||
|
@ -502,7 +535,7 @@
|
|||
* Documentation/news.texi
|
||||
* NEWS
|
||||
* Version:
|
||||
Updating documentation for the 0.26.2 release.
|
||||
Updating documentation for the 0.27.0 release.
|
||||
|
||||
2019-01-06 Ivan Vucica <ivan@vucica.net>
|
||||
|
||||
|
|
|
@ -20,6 +20,54 @@
|
|||
migrate to using a newer version of the library.
|
||||
</p>
|
||||
|
||||
<section>
|
||||
<heading>0.28.0</heading>
|
||||
<p>
|
||||
This version adds support for modern XIB files and many new
|
||||
classes. Plus the usual bunch of bug fixes.
|
||||
</p>
|
||||
<deflist>
|
||||
<term>XIB</term>
|
||||
<desc>Support loading XIB5 files.</desc>
|
||||
<term>key-value binding</term>
|
||||
<desc>Improve Key Value Binding for NSArrayController and add more
|
||||
bindings.</desc>
|
||||
<term>multi-monitor support</term>
|
||||
<desc>Better support for multi monitor usage and other improvement in
|
||||
the backend integration.</desc>
|
||||
<term>new classes</term>
|
||||
<desc>NSFontCollection, NSColorSampler, NSSpeechRecognizer,
|
||||
NSAppearance, NSPDFInfo, NSPICTImageRep, NSCIImageRep, NSPDFImageRep,
|
||||
NSPDFPanel, NSDataAsset,
|
||||
NSDatePicker, NSDatePickerCell, NSPredicateEditor,
|
||||
NSPredicateEditorRowTemplate, NSRuleEditor, NSGestureRecognizer,
|
||||
NSButtonTouchBarItem, NSCandidateListTouchBarItem,
|
||||
NSClickGestureRecognizer, NSColorPickerTouchBarItem,
|
||||
NSCustomTouchBarItem, NSGroupTouchBarItem,
|
||||
NSMagnificationGestureRecognizer, NSPanGestureRecognizer,
|
||||
NSPickerTouchBarItem, NSPopoverTouchBarItem, NSPressGestureRecognizer,
|
||||
NSRotationGestureRecognizer, NSSharingServicePickerTouchBarItem,
|
||||
NSSliderTouchBarItem, NSStepperTouchBarItem, NSTouchBarItem,
|
||||
NSTouchBar, NSTouch, NSDockTile
|
||||
</desc>
|
||||
<term>formats</term>
|
||||
<desc>Implement NSEPSImageRep. Marked GSImageMagickImageRep public.
|
||||
PICT. Better encoding handling in RTF files.</desc>
|
||||
<term>theming and drawing</term>
|
||||
<desc>Increase small font size to 10. New cursor and stepper images.
|
||||
Various improvements.Lowered NSFloatingWindowLevel by one to
|
||||
distinguish floating panels from menus.</desc>
|
||||
<term>NSFileWrapper move</term>
|
||||
<desc>Move NSFileWrapper to Foundation.</desc>
|
||||
<term>platform compatibility</term>
|
||||
<desc>Fixed build on Debian GNU/kFreeBSD. Improvements to WindowMaker
|
||||
compatibility (e.g. WMFHideApplication support).</desc>
|
||||
<term>command line arguments</term>
|
||||
<desc>With command line argument -autolaunch YES, do not activate the
|
||||
application when -activateIgnoringOtherApps: is invoked.</desc>
|
||||
</deflist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<heading>0.27.0</heading>
|
||||
<p>
|
||||
|
@ -36,7 +84,7 @@
|
|||
<term>Tools/speech</term>
|
||||
<desc>Clean up speech tool compilation and switch to newer interface.</desc>
|
||||
<term>printing</term>
|
||||
<desc>Fix bug in CUPS subclassing introduced in last release.</term>
|
||||
<desc>Fix bug in CUPS subclassing introduced in last release.</desc>
|
||||
<term>typesetting</term>
|
||||
<desc>Minor improvments to typesetting.</desc>
|
||||
<term>NSKeyValueBinding</term>
|
||||
|
|
|
@ -9,6 +9,45 @@
|
|||
The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}.
|
||||
@end ifclear
|
||||
|
||||
@section Noteworthy changes in version @samp{0.28.0}
|
||||
|
||||
This version adds support for modern XIB files and many new
|
||||
classes. Plus the usual bunch of bug fixes.
|
||||
|
||||
@itemize @bullet
|
||||
@item Support loading of document XIB files.
|
||||
@item Improve Key Value Binding for NSArrayController and add more bindings.
|
||||
@item Better support for multi monitor usage and other improvement in
|
||||
the backend integration.
|
||||
@item Add classes NSFontCollection, NSColorSampler, NSSpeechRecognizer,
|
||||
NSAppearance, NSPDFInfo, NSPICTImageRep, NSCIImageRep, NSPDFImageRep,
|
||||
NSPDFPanel, NSDataAsset,
|
||||
NSDatePicker, NSDatePickerCell, NSPredicateEditor,
|
||||
NSPredicateEditorRowTemplate, NSRuleEditor, NSGestureRecognizer,
|
||||
NSButtonTouchBarItem, NSCandidateListTouchBarItem,
|
||||
NSClickGestureRecognizer, NSColorPickerTouchBarItem,
|
||||
NSCustomTouchBarItem, NSGroupTouchBarItem,
|
||||
NSMagnificationGestureRecognizer, NSPanGestureRecognizer,
|
||||
NSPickerTouchBarItem, NSPopoverTouchBarItem, NSPressGestureRecognizer,
|
||||
NSRotationGestureRecognizer, NSSharingServicePickerTouchBarItem,
|
||||
NSSliderTouchBarItem, NSStepperTouchBarItem, NSTouchBarItem, NSTouchBar,
|
||||
NSTouch, NSDockTile.
|
||||
@item Implement NSEPSImageRep.
|
||||
@item Better encoding handling in RTF files.
|
||||
@item Theming and drawing improvements.
|
||||
@item Increase small font size to 10.
|
||||
@item New cursor and stepper images.
|
||||
@item Move NSFileWrapper to Foundation.
|
||||
@item Fixed build on Debian GNU/kFreeBSD.
|
||||
@item With command line argument -autolaunch YES, do not activate the
|
||||
application when -activateIgnoringOtherApps: is invoked.
|
||||
@item Improvements to WindowMaker compatibility (e.g. WMFHideApplication
|
||||
support).
|
||||
@item Lowered NSFloatingWindowLevel by one to distinguish floating panels from
|
||||
menus.
|
||||
@end itemize
|
||||
|
||||
@ifclear ANNOUNCE-ONLY
|
||||
@section Noteworthy changes in version @samp{0.27.0}
|
||||
|
||||
This version includes numerous bugfixes, compatibility
|
||||
|
@ -34,7 +73,6 @@ Animation renderer.
|
|||
@item Lots of bug fixes.
|
||||
@end itemize
|
||||
|
||||
@ifclear ANNOUNCE-ONLY
|
||||
@section Noteworthy changes in version @samp{0.26.2}
|
||||
|
||||
This version is a small, but important bugfix release.
|
||||
|
|
|
@ -54,6 +54,10 @@
|
|||
- (NSArray*) availableFontDescriptors;
|
||||
- (NSArray *) availableFontNamesMatchingFontDescriptor: (NSFontDescriptor *)descriptor;
|
||||
- (NSArray *) matchingFontDescriptorsFor: (NSDictionary *)attributes;
|
||||
- (NSArray *) matchingDescriptorsForFamily: (NSString *)family
|
||||
options: (NSDictionary *)options
|
||||
inclusion: (NSArray *)queryDescriptors
|
||||
exculsion: (NSArray *)exclusionDescriptors;
|
||||
|
||||
/* Note that these are only called once. NSFont will remember the returned
|
||||
values. Backends may override these. */
|
||||
|
|
|
@ -141,6 +141,7 @@
|
|||
#import <AppKit/NSArrayController.h>
|
||||
#import <AppKit/NSBezierPath.h>
|
||||
#import <AppKit/NSButtonTouchBarItem.h>
|
||||
#import <AppKit/NSColorSampler.h>
|
||||
#import <AppKit/NSColorSpace.h>
|
||||
#import <AppKit/NSComboBox.h>
|
||||
#import <AppKit/NSComboBoxCell.h>
|
||||
|
@ -156,6 +157,7 @@
|
|||
#import <AppKit/NSDocumentController.h>
|
||||
#import <AppKit/NSDrawer.h>
|
||||
#import <AppKit/NSFileWrapperExtensions.h>
|
||||
#import <AppKit/NSFontCollection.h>
|
||||
#import <AppKit/NSFontDescriptor.h>
|
||||
#import <AppKit/NSGestureRecognizer.h>
|
||||
#import <AppKit/NSGlyphGenerator.h>
|
||||
|
|
|
@ -125,7 +125,34 @@ typedef NSUInteger NSRequestUserAttentionType;
|
|||
#define NSAppKitVersionNumber10_5_3 949.33
|
||||
#define NSAppKitVersionNumber10_6 1038
|
||||
#define NSAppKitVersionNumber10_7 1138
|
||||
#define NSAppKitVersionNumber10_7_2 1138.23
|
||||
#define NSAppKitVersionNumber10_7_2 1138.23;
|
||||
#define NSAppKitVersionNumber10_7_3 1138.32;
|
||||
#define NSAppKitVersionNumber10_7_4 1138.47;
|
||||
#define NSAppKitVersionNumber10_8 1187;
|
||||
#define NSAppKitVersionNumber10_9 1265;
|
||||
#define NSAppKitVersionNumber10_10 1343;
|
||||
#define NSAppKitVersionNumber10_10_2 1344;
|
||||
#define NSAppKitVersionNumber10_10_3 1347;
|
||||
#define NSAppKitVersionNumber10_10_4 1348;
|
||||
#define NSAppKitVersionNumber10_10_5 1348;
|
||||
#define NSAppKitVersionNumber10_10_Max 1349;
|
||||
#define NSAppKitVersionNumber10_11 1404;
|
||||
#define NSAppKitVersionNumber10_11_1 1404.13;
|
||||
#define NSAppKitVersionNumber10_11_2 1404.34;
|
||||
#define NSAppKitVersionNumber10_11_3 1404.34;
|
||||
#define NSAppKitVersionNumber10_12 1504;
|
||||
#define NSAppKitVersionNumber10_12_1 1504.60;
|
||||
#define NSAppKitVersionNumber10_12_2 1504.76;
|
||||
#define NSAppKitVersionNumber10_13 1561;
|
||||
#define NSAppKitVersionNumber10_13_1 1561.1;
|
||||
#define NSAppKitVersionNumber10_13_2 1561.2;
|
||||
#define NSAppKitVersionNumber10_13_4 1561.4;
|
||||
#define NSAppKitVersionNumber10_14 1671;
|
||||
#define NSAppKitVersionNumber10_14_1 1671.1;
|
||||
#define NSAppKitVersionNumber10_14_2 1671.2;
|
||||
#define NSAppKitVersionNumber10_14_3 1671.3;
|
||||
#define NSAppKitVersionNumber10_14_4 1671.4;
|
||||
#define NSAppKitVersionNumber10_14_5 1671.5;
|
||||
|
||||
APPKIT_EXPORT const double NSAppKitVersionNumber;
|
||||
#endif
|
||||
|
|
53
Headers/AppKit/NSColorSampler.h
Normal file
53
Headers/AppKit/NSColorSampler.h
Normal file
|
@ -0,0 +1,53 @@
|
|||
/* Definition of class NSColorSampler
|
||||
Copyright (C) 2020 Free Software Foundation, Inc.
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: Thu Mar 12 03:11:27 EDT 2020
|
||||
|
||||
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
|
||||
Library 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 _NSColorSampler_h_GNUSTEP_GUI_INCLUDE
|
||||
#define _NSColorSampler_h_GNUSTEP_GUI_INCLUDE
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_0, GS_API_LATEST)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@class NSColor;
|
||||
|
||||
DEFINE_BLOCK_TYPE(GSColorSampleHandler, void, NSColor*);
|
||||
|
||||
@interface NSColorSampler : NSObject
|
||||
|
||||
- (void) showSamplerWithSelectionHandler: (GSColorSampleHandler)selectionHandler;
|
||||
|
||||
@end
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GS_API_MACOSX */
|
||||
|
||||
#endif /* _NSColorSampler_h_GNUSTEP_GUI_INCLUDE */
|
||||
|
79
Headers/AppKit/NSErrors.h
Normal file
79
Headers/AppKit/NSErrors.h
Normal file
|
@ -0,0 +1,79 @@
|
|||
/* Definition of class NSErrors
|
||||
Copyright (C) 2020 Free Software Foundation, Inc.
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: Thu Mar 26 09:13:56 EDT 2020
|
||||
|
||||
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
|
||||
Library 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 _NSErrors_h_GNUSTEP_GUI_INCLUDE
|
||||
#define _NSErrors_h_GNUSTEP_GUI_INCLUDE
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_0, GS_API_LATEST)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
APPKIT_EXPORT NSExceptionName NSAbortModalException;
|
||||
APPKIT_EXPORT NSExceptionName NSAbortPrintingException;
|
||||
APPKIT_EXPORT NSExceptionName NSAccessibilityException;
|
||||
APPKIT_EXPORT NSExceptionName NSAppKitIgnoredException;
|
||||
APPKIT_EXPORT NSExceptionName NSAppKitVirtualMemoryException;
|
||||
APPKIT_EXPORT NSExceptionName NSBadBitmapParametersException;
|
||||
APPKIT_EXPORT NSExceptionName NSBadComparisonException;
|
||||
APPKIT_EXPORT NSExceptionName NSBadRTFColorTableException;
|
||||
APPKIT_EXPORT NSExceptionName NSBadRTFDirectiveException;
|
||||
APPKIT_EXPORT NSExceptionName NSBadRTFFontTableException;
|
||||
APPKIT_EXPORT NSExceptionName NSBadRTFStyleSheetException;
|
||||
APPKIT_EXPORT NSExceptionName NSBrowserIllegalDelegateException;
|
||||
APPKIT_EXPORT NSExceptionName NSColorListIOException;
|
||||
APPKIT_EXPORT NSExceptionName NSColorListNotEditableException;
|
||||
APPKIT_EXPORT NSExceptionName NSDraggingException;
|
||||
APPKIT_EXPORT NSExceptionName NSFontUnavailableException;
|
||||
APPKIT_EXPORT NSExceptionName NSIllegalSelectorException;
|
||||
APPKIT_EXPORT NSExceptionName NSImageCacheException;
|
||||
APPKIT_EXPORT NSExceptionName NSNibLoadingException;
|
||||
APPKIT_EXPORT NSExceptionName NSPPDIncludeNotFoundException;
|
||||
APPKIT_EXPORT NSExceptionName NSPPDIncludeStackOverflowException;
|
||||
APPKIT_EXPORT NSExceptionName NSPPDIncludeStackUnderflowException;
|
||||
APPKIT_EXPORT NSExceptionName NSPPDParseException;
|
||||
APPKIT_EXPORT NSExceptionName NSPasteboardCommunicationException;
|
||||
APPKIT_EXPORT NSExceptionName NSPrintPackageException;
|
||||
APPKIT_EXPORT NSExceptionName NSPrintingCommunicationException;
|
||||
APPKIT_EXPORT NSExceptionName NSRTFPropertyStackOverflowException;
|
||||
APPKIT_EXPORT NSExceptionName NSTIFFException;
|
||||
APPKIT_EXPORT NSExceptionName NSTextLineTooLongException;
|
||||
APPKIT_EXPORT NSExceptionName NSTextNoSelectionException;
|
||||
APPKIT_EXPORT NSExceptionName NSTextReadException;
|
||||
APPKIT_EXPORT NSExceptionName NSTextWriteException;
|
||||
APPKIT_EXPORT NSExceptionName NSTypedStreamVersionException;
|
||||
APPKIT_EXPORT NSExceptionName NSWindowServerCommunicationException;
|
||||
APPKIT_EXPORT NSExceptionName NSWordTablesReadException;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GS_API_MACOSX */
|
||||
|
||||
#endif /* _NSErrors_h_GNUSTEP_GUI_INCLUDE */
|
||||
|
151
Headers/AppKit/NSFontCollection.h
Normal file
151
Headers/AppKit/NSFontCollection.h
Normal file
|
@ -0,0 +1,151 @@
|
|||
/* Definition of class NSFontCollection
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: Tue Dec 10 11:51:33 EST 2019
|
||||
|
||||
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
|
||||
Library 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 _NSFontCollection_h_GNUSTEP_GUI_INCLUDE
|
||||
#define _NSFontCollection_h_GNUSTEP_GUI_INCLUDE
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <AppKit/AppKitDefines.h>
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@class NSFontDescriptor, NSLocale, NSError, NSArray, NSMutableArray, NSDictionary, NSMutableDictionary;
|
||||
|
||||
enum {
|
||||
NSFontCollectionVisibilityProcess = (1UL << 0),
|
||||
NSFontCollectionVisibilityUser = (1UL << 1),
|
||||
NSFontCollectionVisibilityComputer = (1UL << 2)
|
||||
};
|
||||
typedef NSUInteger NSFontCollectionVisibility;
|
||||
|
||||
typedef NSString* NSFontCollectionMatchingOptionKey;
|
||||
|
||||
APPKIT_EXPORT NSFontCollectionMatchingOptionKey const NSFontCollectionIncludeDisabledFontsOption;
|
||||
APPKIT_EXPORT NSFontCollectionMatchingOptionKey const NSFontCollectionRemoveDuplicatesOption;
|
||||
APPKIT_EXPORT NSFontCollectionMatchingOptionKey const NSFontCollectionDisallowAutoActivationOption;
|
||||
|
||||
typedef NSString* NSFontCollectionName;
|
||||
|
||||
@interface NSFontCollection : NSObject <NSCopying, NSMutableCopying, NSCoding>
|
||||
{
|
||||
NSMutableDictionary *_fontCollectionDictionary;
|
||||
}
|
||||
|
||||
// Initializers...
|
||||
+ (NSFontCollection *) fontCollectionWithDescriptors: (NSArray *)queryDescriptors;
|
||||
+ (NSFontCollection *) fontCollectionWithAllAvailableDescriptors;
|
||||
+ (NSFontCollection *) fontCollectionWithLocale: (NSLocale *)locale;
|
||||
|
||||
+ (BOOL) showFontCollection: (NSFontCollection *)collection
|
||||
withName: (NSFontCollectionName)name
|
||||
visibility: (NSFontCollectionVisibility)visibility
|
||||
error: (NSError **)error;
|
||||
|
||||
+ (BOOL) hideFontCollectionWithName: (NSFontCollectionName)name
|
||||
visibility: (NSFontCollectionVisibility)visibility
|
||||
error: (NSError **)error;
|
||||
|
||||
+ (BOOL) renameFontCollectionWithName: (NSFontCollectionName)name
|
||||
visibility: (NSFontCollectionVisibility)visibility
|
||||
toName: (NSFontCollectionName)name
|
||||
error: (NSError **)error;
|
||||
|
||||
+ (NSArray *) allFontCollectionNames;
|
||||
|
||||
+ (NSFontCollection *) fontCollectionWithName: (NSFontCollectionName)name;
|
||||
|
||||
+ (NSFontCollection *) fontCollectionWithName: (NSFontCollectionName)name
|
||||
visibility: (NSFontCollectionVisibility)visibility;
|
||||
|
||||
|
||||
// Descriptors
|
||||
- (NSArray *) queryDescriptors;
|
||||
|
||||
- (NSArray *) exclusionDescriptors;
|
||||
|
||||
- (NSArray *) matchingDescriptors;
|
||||
- (NSArray *) matchingDescriptorsWithOptions: (NSDictionary *)options;
|
||||
|
||||
- (NSArray *) matchingDescriptorsForFamily: (NSString *)family;
|
||||
- (NSArray *) matchingDescriptorsForFamily: (NSString *)family options: (NSDictionary *)options;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface NSMutableFontCollection : NSFontCollection
|
||||
|
||||
+ (NSMutableFontCollection *) fontCollectionWithDescriptors: (NSArray *)queryDescriptors;
|
||||
+ (NSMutableFontCollection *) fontCollectionWithAllAvailableDescriptors;
|
||||
+ (NSMutableFontCollection *) fontCollectionWithLocale: (NSLocale *)locale;
|
||||
+ (NSMutableFontCollection *) fontCollectionWithName: (NSFontCollectionName)name;
|
||||
|
||||
+ (NSMutableFontCollection *) fontCollectionWithName: (NSFontCollectionName)name
|
||||
visibility: (NSFontCollectionVisibility)visibility;
|
||||
|
||||
- (NSArray *) queryDescriptors;
|
||||
- (void) setQueryDescriptors: (NSArray *)queryDescriptors;
|
||||
|
||||
- (NSArray *) exclusionDescriptors;
|
||||
- (void) setExclusionDescriptors: (NSArray *)exclusionDescriptors;
|
||||
|
||||
- (void)addQueryForDescriptors: (NSArray *)descriptors;
|
||||
|
||||
- (void)removeQueryForDescriptors: (NSArray *)descriptors;
|
||||
|
||||
@end
|
||||
|
||||
// NSFontCollectionDidChangeNotification
|
||||
APPKIT_EXPORT NSString * const NSFontCollectionDidChangeNotification;
|
||||
|
||||
// Notification user info dictionary keys
|
||||
typedef NSString * NSFontCollectionUserInfoKey;
|
||||
APPKIT_EXPORT NSFontCollectionUserInfoKey const NSFontCollectionActionKey;
|
||||
APPKIT_EXPORT NSFontCollectionUserInfoKey const NSFontCollectionNameKey;
|
||||
APPKIT_EXPORT NSFontCollectionUserInfoKey const NSFontCollectionOldNameKey;
|
||||
APPKIT_EXPORT NSFontCollectionUserInfoKey const NSFontCollectionVisibilityKey;
|
||||
|
||||
// Values for NSFontCollectionAction
|
||||
typedef NSString * NSFontCollectionActionTypeKey;
|
||||
APPKIT_EXPORT NSFontCollectionActionTypeKey const NSFontCollectionWasShown;
|
||||
APPKIT_EXPORT NSFontCollectionActionTypeKey const NSFontCollectionWasHidden;
|
||||
APPKIT_EXPORT NSFontCollectionActionTypeKey const NSFontCollectionWasRenamed;
|
||||
|
||||
// Standard named collections
|
||||
APPKIT_EXPORT NSFontCollectionName const NSFontCollectionAllFonts;
|
||||
APPKIT_EXPORT NSFontCollectionName const NSFontCollectionUser;
|
||||
APPKIT_EXPORT NSFontCollectionName const NSFontCollectionFavorites;
|
||||
APPKIT_EXPORT NSFontCollectionName const NSFontCollectionRecentlyUsed;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GS_API_MACOSX */
|
||||
|
||||
#endif /* _NSFontCollection_h_GNUSTEP_GUI_INCLUDE */
|
||||
|
|
@ -8,16 +8,16 @@
|
|||
* This file is part of GNUstep.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* 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 program 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 General Public License for more details.
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110
|
||||
* USA.
|
||||
|
|
|
@ -8,16 +8,16 @@
|
|||
* This file is part of GNUstep.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* 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 program 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 General Public License for more details.
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110
|
||||
* USA.
|
||||
|
|
14
MISSING
14
MISSING
|
@ -6,22 +6,18 @@ MISSING HEADERS
|
|||
> NSAccessibilityCustomRotor.h
|
||||
> NSAccessibilityElement.h
|
||||
> NSAccessibilityProtocols.h
|
||||
> NSAlignmentFeedbackFilter.h
|
||||
> NSCollectionViewCompositionalLayout.h
|
||||
> NSCollectionViewFlowLayout.h
|
||||
> NSCollectionViewGridLayout.h
|
||||
> NSCollectionViewLayout.h
|
||||
> NSCollectionViewTransitionLayout.h
|
||||
> NSColorSampler.h
|
||||
> NSDictionaryController.h
|
||||
> NSDiffableDataSource.h
|
||||
> NSDraggingItem.h
|
||||
> NSDraggingSession.h
|
||||
> NSErrors.h
|
||||
> NSFilePromiseProvider.h
|
||||
> NSFilePromiseReceiver.h
|
||||
> NSFontAssetRequest.h
|
||||
> NSFontCollection.h
|
||||
> NSGlyphInfo.h
|
||||
> NSGridView.h
|
||||
> NSItemProvider.h
|
||||
|
@ -37,8 +33,6 @@ MISSING HEADERS
|
|||
> NSPathControl.h
|
||||
> NSPathControlItem.h
|
||||
> NSPersistentDocument.h
|
||||
> NSPressureConfiguration.h
|
||||
> NSQuickDrawView.h
|
||||
> NSRuleEditor.h
|
||||
> NSScrubber.h
|
||||
> NSScrubberItemView.h
|
||||
|
@ -62,8 +56,6 @@ MISSING HEADERS
|
|||
> NSTextInputClient.h
|
||||
> NSTextInputContext.h
|
||||
> NSTitlebarAccessoryViewController.h
|
||||
> NSTouch.h
|
||||
> NSTouchBar.h
|
||||
> NSTypesetter.h
|
||||
> NSUserActivity.h
|
||||
> NSUserInterfaceCompression.h
|
||||
|
@ -85,6 +77,7 @@ Completed
|
|||
> NSTouch.h
|
||||
> NSTouchBar.h
|
||||
> NSSpeechRecognizer.h
|
||||
> NSColorSampler.h
|
||||
|
||||
Mac Specific
|
||||
---
|
||||
|
@ -110,3 +103,8 @@ Mac Specific
|
|||
> NSWindowScripting.h
|
||||
> NSHapticFeedback.h
|
||||
> NSAppleScriptExtensions.h
|
||||
> NSAlignmentFeedbackFilter.h
|
||||
> NSTouch.h
|
||||
> NSTouchBar.h
|
||||
> NSQuickDrawView.h
|
||||
> NSPressureConfiguration.h
|
||||
|
|
158
NEWS
158
NEWS
|
@ -1,9 +1,47 @@
|
|||
1 NEWS
|
||||
******
|
||||
|
||||
The currently released version of the library is '0.27.0'.
|
||||
The currently released version of the library is '0.28.0'.
|
||||
|
||||
1.1 Noteworthy changes in version '0.27.0'
|
||||
1.1 Noteworthy changes in version '0.28.0'
|
||||
==========================================
|
||||
|
||||
This version adds support for modern XIB files and many new classes.
|
||||
Plus the usual bunch of bug fixes.
|
||||
|
||||
* Support loading of document XIB files.
|
||||
* Improve Key Value Binding for NSArrayController and add more
|
||||
bindings.
|
||||
* Better support for multi monitor usage and other improvement in the
|
||||
backend integration.
|
||||
* Add classes NSFontCollection, NSColorSampler, NSSpeechRecognizer,
|
||||
NSAppearance, NSPDFInfo, NSPICTImageRep, NSCIImageRep,
|
||||
NSPDFImageRep, NSPDFPanel, NSDataAsset, NSDatePicker,
|
||||
NSDatePickerCell, NSPredicateEditor, NSPredicateEditorRowTemplate,
|
||||
NSRuleEditor, NSGestureRecognizer, NSButtonTouchBarItem,
|
||||
NSCandidateListTouchBarItem, NSClickGestureRecognizer,
|
||||
NSColorPickerTouchBarItem, NSCustomTouchBarItem,
|
||||
NSGroupTouchBarItem, NSMagnificationGestureRecognizer,
|
||||
NSPanGestureRecognizer, NSPickerTouchBarItem,
|
||||
NSPopoverTouchBarItem, NSPressGestureRecognizer,
|
||||
NSRotationGestureRecognizer, NSSharingServicePickerTouchBarItem,
|
||||
NSSliderTouchBarItem, NSStepperTouchBarItem, NSTouchBarItem,
|
||||
NSTouchBar, NSTouch, NSDockTile.
|
||||
* Implement NSEPSImageRep.
|
||||
* Better encoding handling in RTF files.
|
||||
* Theming and drawing improvements.
|
||||
* Increase small font size to 10.
|
||||
* New cursor and stepper images.
|
||||
* Move NSFileWrapper to Foundation.
|
||||
* Fixed build on Debian GNU/kFreeBSD.
|
||||
* With command line argument -autolaunch YES, do not activate the
|
||||
application when -activateIgnoringOtherApps: is invoked.
|
||||
* Improvements to WindowMaker compatibility (e.g. WMFHideApplication
|
||||
support).
|
||||
* Lowered NSFloatingWindowLevel by one to distinguish floating panels
|
||||
from menus.
|
||||
|
||||
1.2 Noteworthy changes in version '0.27.0'
|
||||
==========================================
|
||||
|
||||
This version includes numerous bugfixes, compatibility improvements and
|
||||
|
@ -26,7 +64,7 @@ be done on integrating NSViews with a Core Animation renderer.
|
|||
* Japanese translations.
|
||||
* Lots of bug fixes.
|
||||
|
||||
1.2 Noteworthy changes in version '0.26.2'
|
||||
1.3 Noteworthy changes in version '0.26.2'
|
||||
==========================================
|
||||
|
||||
This version is a small, but important bugfix release.
|
||||
|
@ -34,7 +72,7 @@ This version is a small, but important bugfix release.
|
|||
* printing: Fix allocation of the CUPS printing classes.
|
||||
* installation: Fix the configure script.
|
||||
|
||||
1.3 Noteworthy changes in version '0.26.1'
|
||||
1.4 Noteworthy changes in version '0.26.1'
|
||||
==========================================
|
||||
|
||||
This version is released to conincide with version 1.25.1 of
|
||||
|
@ -61,7 +99,7 @@ for more information.
|
|||
* graphics context: Workaround for Clang+libobjc2+nonfragile ABI
|
||||
issue.
|
||||
|
||||
1.4 Noteworthy changes in version '0.26.0'
|
||||
1.5 Noteworthy changes in version '0.26.0'
|
||||
==========================================
|
||||
|
||||
This version was bumped due to previous binary incompatibilities between
|
||||
|
@ -92,7 +130,7 @@ system.
|
|||
and methods to improve source-level compatibility.
|
||||
* other bugfixes
|
||||
|
||||
1.5 Noteworthy changes in version '0.25.1'
|
||||
1.6 Noteworthy changes in version '0.25.1'
|
||||
==========================================
|
||||
|
||||
* JPEG (saving) alpha channel fixes and size with resolution != 72
|
||||
|
@ -103,7 +141,7 @@ system.
|
|||
* Corrected layout of empty strings
|
||||
* Only update visible menus
|
||||
|
||||
1.6 Noteworthy changes in version '0.25.0'
|
||||
1.7 Noteworthy changes in version '0.25.0'
|
||||
==========================================
|
||||
|
||||
* Fixes for new GIF library versions
|
||||
|
@ -118,14 +156,14 @@ system.
|
|||
* Numerous theme tweaks
|
||||
* Spanish locale
|
||||
|
||||
1.7 Noteworthy changes in version '0.24.1'
|
||||
1.8 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.8 Noteworthy changes in version '0.24.0'
|
||||
1.9 Noteworthy changes in version '0.24.0'
|
||||
==========================================
|
||||
|
||||
New features include:
|
||||
|
@ -137,13 +175,13 @@ New features include:
|
|||
|
||||
Many bugfixes.
|
||||
|
||||
1.9 Noteworthy changes in version '0.23.1'
|
||||
==========================================
|
||||
1.10 Noteworthy changes in version '0.23.1'
|
||||
===========================================
|
||||
|
||||
This is a bugfix release, primarily to deal with coding/archiving
|
||||
issues.
|
||||
|
||||
1.10 Noteworthy changes in version '0.22.0'
|
||||
1.11 Noteworthy changes in version '0.22.0'
|
||||
===========================================
|
||||
|
||||
New features include:
|
||||
|
@ -159,19 +197,19 @@ New features include:
|
|||
selection of image reps, better support for icons). Many bugfixes,
|
||||
including in Xib loading, printing, and NSView geometry.
|
||||
|
||||
1.11 Noteworthy changes in version '0.20.0'
|
||||
1.12 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.12 Noteworthy changes in version '0.19.0'
|
||||
1.13 Noteworthy changes in version '0.19.0'
|
||||
===========================================
|
||||
|
||||
This is an (unstable) copy of the 0.18.0 release
|
||||
|
||||
1.13 Noteworthy changes in version '0.18.0'
|
||||
1.14 Noteworthy changes in version '0.18.0'
|
||||
===========================================
|
||||
|
||||
A new stable release that has had many improvements. Many new Mac OS X
|
||||
|
@ -180,20 +218,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.14 Noteworthy changes in version '0.17.1'
|
||||
1.15 Noteworthy changes in version '0.17.1'
|
||||
===========================================
|
||||
|
||||
* New Mac OS X 10.5 methods in NSFont
|
||||
* Add live resize in NSSplitView
|
||||
|
||||
1.15 Noteworthy changes in version '0.17.0'
|
||||
1.16 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.16 Noteworthy changes in version '0.16.0'
|
||||
1.17 Noteworthy changes in version '0.16.0'
|
||||
===========================================
|
||||
|
||||
* Nib loading refractored and improved.
|
||||
|
@ -201,7 +239,7 @@ and other definitions.
|
|||
* NSWindowController made a subclass of NSResponder
|
||||
* NSTokenField and netokenFiledCell classes added.
|
||||
|
||||
1.17 Noteworthy changes in version '0.14.0'
|
||||
1.18 Noteworthy changes in version '0.14.0'
|
||||
===========================================
|
||||
|
||||
* New class NSGlyphGenerator for glyph generation
|
||||
|
@ -209,7 +247,7 @@ and other definitions.
|
|||
* NSOpenGLView added some Mac OS X 10.3 methods
|
||||
* Manu bug fixes.
|
||||
|
||||
1.18 Noteworthy changes in version '0.13.2'
|
||||
1.19 Noteworthy changes in version '0.13.2'
|
||||
===========================================
|
||||
|
||||
* Printing works a little better now.
|
||||
|
@ -220,7 +258,7 @@ and other definitions.
|
|||
* New class NSSegmentedCell.
|
||||
* NSDrawer was implemented.
|
||||
|
||||
1.19 Noteworthy changes in version '0.13.1'
|
||||
1.20 Noteworthy changes in version '0.13.1'
|
||||
===========================================
|
||||
|
||||
* NSMenu - Added more MacOS X methods and an ivar.
|
||||
|
@ -230,7 +268,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.20 Noteworthy changes in version '0.13.0'
|
||||
1.21 Noteworthy changes in version '0.13.0'
|
||||
===========================================
|
||||
|
||||
This is an unstable release. There may be backward compatibility issues
|
||||
|
@ -257,7 +295,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.21 Noteworthy changes in version '0.12.0'
|
||||
1.22 Noteworthy changes in version '0.12.0'
|
||||
===========================================
|
||||
|
||||
It has been a long time since the last release and many things have been
|
||||
|
@ -277,7 +315,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.22 Noteworthy changes in version '0.11.0'
|
||||
1.23 Noteworthy changes in version '0.11.0'
|
||||
===========================================
|
||||
|
||||
* Added support for keyed encoding in all gui classes.
|
||||
|
@ -286,25 +324,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.23 Noteworthy changes in version '0.10.3'
|
||||
1.24 Noteworthy changes in version '0.10.3'
|
||||
===========================================
|
||||
|
||||
* Horizontal menus now work
|
||||
* Better support for tracking active applications.
|
||||
|
||||
1.24 Noteworthy changes in version '0.10.2'
|
||||
1.25 Noteworthy changes in version '0.10.2'
|
||||
===========================================
|
||||
|
||||
Mostly bug fixes.
|
||||
|
||||
1.25 Noteworthy changes in version '0.10.1'
|
||||
1.26 Noteworthy changes in version '0.10.1'
|
||||
===========================================
|
||||
|
||||
GNUstep now uses v19 of portaudio for the sound daemon. Version v19
|
||||
hasn't been officially released, but it is still used in several
|
||||
distributions (SuSE, etc) as v18 is very old.
|
||||
|
||||
1.26 Noteworthy changes in version '0.10.0'
|
||||
1.27 Noteworthy changes in version '0.10.0'
|
||||
===========================================
|
||||
|
||||
This release is binary incompatible with previous releases. The
|
||||
|
@ -315,7 +353,7 @@ new version.
|
|||
* Model loading supports window auto-positioning
|
||||
* Keyed encoding is supported in many classes.
|
||||
|
||||
1.27 Noteworthy changes in version '0.9.5'
|
||||
1.28 Noteworthy changes in version '0.9.5'
|
||||
==========================================
|
||||
|
||||
* Beginnings of CUPS interface were added.
|
||||
|
@ -324,7 +362,7 @@ new version.
|
|||
* NSApplication -runModalSession behavior changed.
|
||||
* You can find the GUI library's version using the Info.plist
|
||||
|
||||
1.28 Noteworthy changes in version '0.9.4'
|
||||
1.29 Noteworthy changes in version '0.9.4'
|
||||
==========================================
|
||||
|
||||
* The printing classes have been completely reorganized to
|
||||
|
@ -335,7 +373,7 @@ new version.
|
|||
* NSScroller, NSScrollView has a new ivar.
|
||||
* Some improvement of NSDataLink classes.
|
||||
|
||||
1.29 Noteworthy changes in version '0.9.3'
|
||||
1.30 Noteworthy changes in version '0.9.3'
|
||||
==========================================
|
||||
|
||||
* Spell checker reimplemented using libaspell
|
||||
|
@ -344,7 +382,7 @@ new version.
|
|||
* Binary incompatibilites from ivar additions in NSView and
|
||||
subclasses.
|
||||
|
||||
1.30 Noteworthy changes in version '0.9.2'
|
||||
1.31 Noteworthy changes in version '0.9.2'
|
||||
==========================================
|
||||
|
||||
* Working NSToolbar implementation
|
||||
|
@ -356,21 +394,21 @@ new version.
|
|||
* NSStringDrawing redesigned.
|
||||
* Much improved loading of gorm files
|
||||
|
||||
1.31 Noteworthy changes in version '0.9.1'
|
||||
1.32 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.32 Noteworthy changes in version '0.9.0'
|
||||
1.33 Noteworthy changes in version '0.9.0'
|
||||
==========================================
|
||||
|
||||
Improvements in various classes, include NSPopUpButton,
|
||||
NSBitmapImageRep, NSMenu, NSToolbar. Added support for thumbnail images
|
||||
in NSWorkspace.
|
||||
|
||||
1.33 Noteworthy changes in version '0.8.9'
|
||||
1.34 Noteworthy changes in version '0.8.9'
|
||||
==========================================
|
||||
|
||||
Note that many headers have moved to new locations (both in the package
|
||||
|
@ -379,13 +417,13 @@ applications may not compile because they cannot find the right header.
|
|||
|
||||
* New Language Setup documentation.
|
||||
|
||||
1.34 Noteworthy changes in version '0.8.8'
|
||||
1.35 Noteworthy changes in version '0.8.8'
|
||||
==========================================
|
||||
|
||||
* Updated LanguageSetup documentation
|
||||
* Improved RTF reader (unicode support, etc).
|
||||
|
||||
1.35 Noteworthy changes in version '0.8.7'
|
||||
1.36 Noteworthy changes in version '0.8.7'
|
||||
==========================================
|
||||
|
||||
* NSBezierPath glyph methods implemented (depends on backend).
|
||||
|
@ -393,7 +431,7 @@ applications may not compile because they cannot find the right header.
|
|||
* Added default to load user-defined bundles (GSAppKitUserBundles
|
||||
default).
|
||||
|
||||
1.36 Noteworthy changes in version '0.8.6'
|
||||
1.37 Noteworthy changes in version '0.8.6'
|
||||
==========================================
|
||||
|
||||
Updated to install in new locations based on changes in gnustep-make
|
||||
|
@ -403,12 +441,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.37 Noteworthy changes in version '0.8.5'
|
||||
1.38 Noteworthy changes in version '0.8.5'
|
||||
==========================================
|
||||
|
||||
Bug fixes. NSStringDrawing now uses text system implementation.
|
||||
|
||||
1.38 Noteworthy changes in version '0.8.4'
|
||||
1.39 Noteworthy changes in version '0.8.4'
|
||||
==========================================
|
||||
|
||||
This release features a brand new text and layout system thanks to
|
||||
|
@ -419,7 +457,7 @@ Alexander Malmberg. Other improvements include:
|
|||
* Printing fixes.
|
||||
* NSToolbar partially implemented.
|
||||
|
||||
1.39 Noteworthy changes in version '0.8.3'
|
||||
1.40 Noteworthy changes in version '0.8.3'
|
||||
==========================================
|
||||
|
||||
* Additions for Gorm support.
|
||||
|
@ -430,7 +468,7 @@ Alexander Malmberg. Other improvements include:
|
|||
* Window focus fixes
|
||||
* Key view handling rewritten.
|
||||
|
||||
1.40 Noteworthy changes in version '0.8.2'
|
||||
1.41 Noteworthy changes in version '0.8.2'
|
||||
==========================================
|
||||
|
||||
* Handle fonts that aren't found better.
|
||||
|
@ -441,7 +479,7 @@ Alexander Malmberg. Other improvements include:
|
|||
* NSBrowser: implement non-separate columns
|
||||
* Fix firstResponder status in text fields.
|
||||
|
||||
1.41 Noteworthy changes in version '0.8.1'
|
||||
1.42 Noteworthy changes in version '0.8.1'
|
||||
==========================================
|
||||
|
||||
* Handle scaled curves correctly.
|
||||
|
@ -450,23 +488,23 @@ Alexander Malmberg. Other improvements include:
|
|||
* NSSound implemented. gssnd sound server.
|
||||
* Spell checker starts correctly now.
|
||||
|
||||
1.42 Noteworthy changes in version '0.8.0'
|
||||
1.43 Noteworthy changes in version '0.8.0'
|
||||
==========================================
|
||||
|
||||
1.43 Noteworthy changes in version '0.7.9'
|
||||
1.44 Noteworthy changes in version '0.7.9'
|
||||
==========================================
|
||||
|
||||
* NSTableView, NSOutlineView improvements.
|
||||
* Menus no longer work in modal loop.
|
||||
* Skeleton implementation of NSToolBar
|
||||
|
||||
1.44 Noteworthy changes in version '0.7.8'
|
||||
1.45 Noteworthy changes in version '0.7.8'
|
||||
==========================================
|
||||
|
||||
* Wheel color picker, standard color picker (bundles) added.
|
||||
* System colors now use named colors. Easier configuration
|
||||
|
||||
1.45 Noteworthy changes in version '0.7.7'
|
||||
1.46 Noteworthy changes in version '0.7.7'
|
||||
==========================================
|
||||
|
||||
The graphics/window interface was completely revamped. Window functions
|
||||
|
@ -488,7 +526,7 @@ computers, although it is in a very alpha state.
|
|||
* Better autolayout with GSTable and subclasses.
|
||||
* NSOutlineView much improved.
|
||||
|
||||
1.46 Noteworthy changes in version '0.7.6'
|
||||
1.47 Noteworthy changes in version '0.7.6'
|
||||
==========================================
|
||||
|
||||
* NSOutlineView implemented.
|
||||
|
@ -497,7 +535,7 @@ computers, although it is in a very alpha state.
|
|||
* Fully-functional keybindings, including multi-stroke keybindings.
|
||||
* Memory panel available from Info Panel.
|
||||
|
||||
1.47 Noteworthy changes in version '0.7.5'
|
||||
1.48 Noteworthy changes in version '0.7.5'
|
||||
==========================================
|
||||
|
||||
* Drag and drop and image sliding much improved.
|
||||
|
@ -515,7 +553,7 @@ computers, although it is in a very alpha state.
|
|||
* Near rewrite of Menu handling code.
|
||||
* Gmodel code compiled as a separate bundle.
|
||||
|
||||
1.48 Noteworthy changes in version '0.7.0'
|
||||
1.49 Noteworthy changes in version '0.7.0'
|
||||
==========================================
|
||||
|
||||
* Much improvement in NSBrowser, NSMatrix, NSPopUpButton, combo
|
||||
|
@ -526,7 +564,7 @@ computers, although it is in a very alpha state.
|
|||
* simpler, faster compilation and installation.
|
||||
* NSColorWell works.
|
||||
|
||||
1.49 Noteworthy changes in version '0.6.7'
|
||||
1.50 Noteworthy changes in version '0.6.7'
|
||||
==========================================
|
||||
|
||||
* App Icons can support documents dropped using DnD.
|
||||
|
@ -542,7 +580,7 @@ computers, although it is in a very alpha state.
|
|||
* Implemented object value and formatter support in NSCell
|
||||
* Support middle mouse button.
|
||||
|
||||
1.50 Noteworthy changes in version '0.6.6'
|
||||
1.51 Noteworthy changes in version '0.6.6'
|
||||
==========================================
|
||||
|
||||
* Window hints for motif and generic window managers.
|
||||
|
@ -568,7 +606,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.51 Noteworthy changes in version '0.6.5'
|
||||
1.52 Noteworthy changes in version '0.6.5'
|
||||
==========================================
|
||||
|
||||
Many of the basic GUI classes have been vastly improved or rewritten,
|
||||
|
@ -592,7 +630,7 @@ thanks to Nicola Pero <n.pero@mi.flashnet.it> and many others.
|
|||
been written, thanks to Richard Frith-Macdonald
|
||||
<richard@brainstorm.co.uk>
|
||||
|
||||
1.52 Noteworthy changes in version '0.6.0'
|
||||
1.53 Noteworthy changes in version '0.6.0'
|
||||
==========================================
|
||||
|
||||
A Huge amount of progress, although a lot still needs to be done. It's
|
||||
|
@ -613,7 +651,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.53 Noteworthy changes in version '0.5.5'
|
||||
1.54 Noteworthy changes in version '0.5.5'
|
||||
==========================================
|
||||
|
||||
Too extensive to list.
|
||||
|
@ -621,7 +659,7 @@ Too extensive to list.
|
|||
* A lot of rewritting has been done to the classes, with general
|
||||
cleanup of coordinate conversion code, etc.
|
||||
|
||||
1.54 Noteworthy changes in version '0.5.0'
|
||||
1.55 Noteworthy changes in version '0.5.0'
|
||||
==========================================
|
||||
|
||||
* NSBrowser and NSBrowserCell have been implemented. There is one
|
||||
|
@ -670,7 +708,7 @@ Too extensive to list.
|
|||
|
||||
* Several cleanups and as usual, many bug fixes.
|
||||
|
||||
1.55 Noteworthy changes in version '0.3.0'
|
||||
1.56 Noteworthy changes in version '0.3.0'
|
||||
==========================================
|
||||
|
||||
* Completely reworked the menu class. The NSMenu class is now
|
||||
|
@ -701,7 +739,7 @@ Too extensive to list.
|
|||
retain/release policy has been fixed, the cell classes correctly
|
||||
implement the NSCopying protocol and many others.
|
||||
|
||||
1.56 Noteworthy changes in version '0.2.0'
|
||||
1.57 Noteworthy changes in version '0.2.0'
|
||||
==========================================
|
||||
|
||||
* Additional NSImage and NSImageRep class work. Incorporated common
|
||||
|
@ -735,7 +773,7 @@ Too extensive to list.
|
|||
|
||||
* Many bug fixes and minor enhancements.
|
||||
|
||||
1.57 Noteworthy changes in version '0.1.1'
|
||||
1.58 Noteworthy changes in version '0.1.1'
|
||||
==========================================
|
||||
|
||||
* Almost complete implementation of the PXKMenu and PXKMenuCell
|
||||
|
@ -758,7 +796,7 @@ Too extensive to list.
|
|||
* Now requires the TIFF library for reading, writing, and
|
||||
manipulating tiff files and images.
|
||||
|
||||
1.58 Noteworthy changes in version '0.1.0'
|
||||
1.59 Noteworthy changes in version '0.1.0'
|
||||
==========================================
|
||||
|
||||
* Integration of the GNUstep X/DPS GUI Backend. This has finally
|
||||
|
|
|
@ -81,6 +81,7 @@ NSColorList.m \
|
|||
NSColorPanel.m \
|
||||
NSColorPicker.m \
|
||||
NSColorPickerTouchBarItem.m \
|
||||
NSColorSampler.m \
|
||||
NSColorSpace.m \
|
||||
NSColorWell.m \
|
||||
NSComboBox.m \
|
||||
|
@ -104,6 +105,7 @@ NSEPSImageRep.m \
|
|||
NSEvent.m \
|
||||
NSFileWrapperExtensions.m \
|
||||
NSFont.m \
|
||||
NSFontCollection.m \
|
||||
NSFontDescriptor.m \
|
||||
NSFontManager.m \
|
||||
NSFontPanel.m \
|
||||
|
@ -369,6 +371,7 @@ NSColorList.h \
|
|||
NSColorPanel.h \
|
||||
NSColorPicker.h \
|
||||
NSColorPickerTouchBarItem.h \
|
||||
NSColorSampler.h \
|
||||
NSColorSpace.h \
|
||||
NSColorWell.h \
|
||||
NSComboBox.h \
|
||||
|
@ -389,10 +392,12 @@ NSDocument.h \
|
|||
NSDocumentController.h \
|
||||
NSDrawer.h \
|
||||
NSEPSImageRep.h \
|
||||
NSErrors.h \
|
||||
NSEvent.h \
|
||||
NSFileWrapper.h \
|
||||
NSFileWrapperExtensions.h \
|
||||
NSFont.h \
|
||||
NSFontCollection.h \
|
||||
NSFontDescriptor.h \
|
||||
NSFontManager.h \
|
||||
NSFontPanel.h \
|
||||
|
|
|
@ -3,11 +3,14 @@
|
|||
|
||||
Private class for handling font info
|
||||
|
||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000, 2020 Free Software Foundation, Inc.
|
||||
|
||||
Author: Adam Fedor <fedor@gnu.org>
|
||||
Date: Mar 2000
|
||||
|
||||
Author: Fred Kiefer <fredkiefer@gmx.de>
|
||||
Date: March 2020
|
||||
|
||||
This file is part of the GNUstep.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
|
@ -183,18 +186,10 @@ static GSFontEnumerator *sharedEnumerator = nil;
|
|||
return found;
|
||||
}
|
||||
|
||||
- (NSArray *) matchingFontDescriptorsFor: (NSDictionary *)attributes
|
||||
- (BOOL) _fontDescriptor: (NSFontDescriptor *)fd matches: (NSDictionary *)attributes
|
||||
{
|
||||
NSMutableArray *found;
|
||||
NSEnumerator *fdEnumerator;
|
||||
NSFontDescriptor *fd;
|
||||
// Get all the keys from the attributes and see if they match
|
||||
NSArray *keys = [attributes allKeys];
|
||||
|
||||
found = [NSMutableArray arrayWithCapacity: 3];
|
||||
// Get an enumerator for all available font descriptors
|
||||
fdEnumerator = [[self availableFontDescriptors] objectEnumerator];
|
||||
while ((fd = [fdEnumerator nextObject]) != nil)
|
||||
{
|
||||
NSEnumerator *keyEnumerator;
|
||||
NSString *key;
|
||||
BOOL match = YES;
|
||||
|
@ -248,7 +243,21 @@ static GSFontEnumerator *sharedEnumerator = nil;
|
|||
}
|
||||
}
|
||||
|
||||
if (match)
|
||||
return match;
|
||||
}
|
||||
|
||||
- (NSArray *) matchingFontDescriptorsFor: (NSDictionary *)attributes
|
||||
{
|
||||
NSMutableArray *found;
|
||||
NSEnumerator *fdEnumerator;
|
||||
NSFontDescriptor *fd;
|
||||
|
||||
found = [NSMutableArray arrayWithCapacity: 3];
|
||||
// Get an enumerator for all available font descriptors
|
||||
fdEnumerator = [[self availableFontDescriptors] objectEnumerator];
|
||||
while ((fd = [fdEnumerator nextObject]) != nil)
|
||||
{
|
||||
if ([self _fontDescriptor: fd matches: attributes])
|
||||
{
|
||||
[found addObject: fd];
|
||||
}
|
||||
|
@ -257,6 +266,66 @@ static GSFontEnumerator *sharedEnumerator = nil;
|
|||
return found;
|
||||
}
|
||||
|
||||
// Font collection methods....
|
||||
|
||||
- (BOOL) _fontDescriptor: (NSFontDescriptor *)fd matchesAny: (NSArray *)a
|
||||
{
|
||||
NSEnumerator *en = [a objectEnumerator];
|
||||
NSFontDescriptor *o;
|
||||
|
||||
while ((o = [en nextObject]) != nil)
|
||||
{
|
||||
if ([self _fontDescriptor: fd matches: [o fontAttributes]])
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
/*
|
||||
* This method implements the filtering of font descriptors to match the given restrictions.
|
||||
* This code should be implemented more effiently in the backend.
|
||||
* Currently we ignore the options as these may only be implemented in the backend.
|
||||
*/
|
||||
- (NSArray *) matchingDescriptorsForFamily: (NSString *)family
|
||||
options: (NSDictionary *)options
|
||||
inclusion: (NSArray *)queryDescriptors
|
||||
exculsion: (NSArray *)exclusionDescriptors
|
||||
{
|
||||
NSMutableArray *r = [NSMutableArray arrayWithCapacity: 50];
|
||||
NSEnumerator *en = [[self availableFontDescriptors] objectEnumerator];
|
||||
NSFontDescriptor *fd;
|
||||
|
||||
while ((fd = [en nextObject]) != nil)
|
||||
{
|
||||
// Check if the font descriptor matches the family value if one is given
|
||||
if ((family != nil) &&
|
||||
![[fd objectForKey: NSFontFamilyAttribute] isEqualToString: family])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if the font descriptor matches any of the query descriptors
|
||||
if (![self _fontDescriptor: fd matchesAny: queryDescriptors])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if the font descriptor matches none of the exclusion descriptors
|
||||
if ([self _fontDescriptor: fd matchesAny: exclusionDescriptors])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add it to the result
|
||||
[r addObject: fd];
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
- (NSString *) defaultSystemFontName
|
||||
{
|
||||
return @"Helvetica";
|
||||
|
|
|
@ -1651,8 +1651,8 @@ void NSBeginAlertSheet(NSString *title,
|
|||
NSString *otherButton,
|
||||
NSWindow *docWindow,
|
||||
id modalDelegate,
|
||||
SEL willEndSelector,
|
||||
SEL didEndSelector,
|
||||
SEL didDismissSelector,
|
||||
void *contextInfo,
|
||||
NSString *msg, ...)
|
||||
{
|
||||
|
@ -1676,8 +1676,16 @@ void NSBeginAlertSheet(NSString *title,
|
|||
[NSApp beginSheet: panel
|
||||
modalForWindow: docWindow
|
||||
modalDelegate: modalDelegate
|
||||
didEndSelector: willEndSelector
|
||||
didEndSelector: didEndSelector
|
||||
contextInfo: contextInfo];
|
||||
if (modalDelegate && [modalDelegate respondsToSelector: didDismissSelector])
|
||||
{
|
||||
void (*didDismiss)(id, SEL, id, NSInteger, void*);
|
||||
didDismiss = (void (*)(id, SEL, id, NSInteger, void*))[modalDelegate
|
||||
methodForSelector: didDismissSelector];
|
||||
didDismiss(modalDelegate, didDismissSelector, panel, [panel result],
|
||||
contextInfo);
|
||||
}
|
||||
|
||||
NSReleaseAlertPanel(panel);
|
||||
}
|
||||
|
@ -1688,8 +1696,8 @@ void NSBeginCriticalAlertSheet(NSString *title,
|
|||
NSString *otherButton,
|
||||
NSWindow *docWindow,
|
||||
id modalDelegate,
|
||||
SEL willEndSelector,
|
||||
SEL didEndSelector,
|
||||
SEL didDismissSelector,
|
||||
void *contextInfo,
|
||||
NSString *msg, ...)
|
||||
{
|
||||
|
@ -1707,15 +1715,15 @@ void NSBeginCriticalAlertSheet(NSString *title,
|
|||
[NSApp beginSheet: panel
|
||||
modalForWindow: docWindow
|
||||
modalDelegate: modalDelegate
|
||||
didEndSelector: willEndSelector
|
||||
didEndSelector: didEndSelector
|
||||
contextInfo: contextInfo];
|
||||
[panel close];
|
||||
if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector])
|
||||
if (modalDelegate && [modalDelegate respondsToSelector: didDismissSelector])
|
||||
{
|
||||
void (*didEnd)(id, SEL, id, NSInteger, void*);
|
||||
didEnd = (void (*)(id, SEL, id, NSInteger, void*))[modalDelegate
|
||||
methodForSelector: didEndSelector];
|
||||
didEnd(modalDelegate, didEndSelector, panel, [panel result], contextInfo);
|
||||
void (*didDismiss)(id, SEL, id, NSInteger, void*);
|
||||
didDismiss = (void (*)(id, SEL, id, NSInteger, void*))[modalDelegate
|
||||
methodForSelector: didDismissSelector];
|
||||
didDismiss(modalDelegate, didDismissSelector, panel, [panel result],
|
||||
contextInfo);
|
||||
}
|
||||
|
||||
NSReleaseAlertPanel(panel);
|
||||
|
@ -1727,8 +1735,8 @@ void NSBeginInformationalAlertSheet(NSString *title,
|
|||
NSString *otherButton,
|
||||
NSWindow *docWindow,
|
||||
id modalDelegate,
|
||||
SEL willEndSelector,
|
||||
SEL didEndSelector,
|
||||
SEL didDismissSelector,
|
||||
void *contextInfo,
|
||||
NSString *msg, ...)
|
||||
{
|
||||
|
@ -1748,15 +1756,15 @@ void NSBeginInformationalAlertSheet(NSString *title,
|
|||
[NSApp beginSheet: panel
|
||||
modalForWindow: docWindow
|
||||
modalDelegate: modalDelegate
|
||||
didEndSelector: willEndSelector
|
||||
didEndSelector: didEndSelector
|
||||
contextInfo: contextInfo];
|
||||
[panel close];
|
||||
if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector])
|
||||
if (modalDelegate && [modalDelegate respondsToSelector: didDismissSelector])
|
||||
{
|
||||
void (*didEnd)(id, SEL, id, NSInteger, void*);
|
||||
didEnd = (void (*)(id, SEL, id, NSInteger, void*))[modalDelegate
|
||||
methodForSelector: didEndSelector];
|
||||
didEnd(modalDelegate, didEndSelector, panel, [panel result], contextInfo);
|
||||
void (*didDismiss)(id, SEL, id, NSInteger, void*);
|
||||
didDismiss = (void (*)(id, SEL, id, NSInteger, void*))[modalDelegate
|
||||
methodForSelector: didDismissSelector];
|
||||
didDismiss(modalDelegate, didDismissSelector, panel, [panel result],
|
||||
contextInfo);
|
||||
}
|
||||
|
||||
NSReleaseAlertPanel(panel);
|
||||
|
|
158
Source/NSColorSampler.m
Normal file
158
Source/NSColorSampler.m
Normal file
|
@ -0,0 +1,158 @@
|
|||
/* Implementation of class NSColorSampler
|
||||
Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: Thu Mar 12 03:11:27 EDT 2020
|
||||
|
||||
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 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/NSGeometry.h>
|
||||
#import <Foundation/NSDate.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSLock.h>
|
||||
|
||||
#import <AppKit/NSApplication.h>
|
||||
#import <AppKit/NSBitmapImageRep.h>
|
||||
#import <AppKit/NSColorSampler.h>
|
||||
#import <AppKit/NSCursor.h>
|
||||
#import <AppKit/NSColor.h>
|
||||
#import <AppKit/NSEvent.h>
|
||||
#import <AppKit/NSImage.h>
|
||||
#import <AppKit/NSScreen.h>
|
||||
#import <AppKit/NSPanel.h>
|
||||
|
||||
#import <GNUstepGUI/GSDisplayServer.h>
|
||||
|
||||
static NSLock *_gs_gui_color_sampler_lock = nil;
|
||||
static NSColorSampler *_gs_gui_color_sampler = nil;
|
||||
|
||||
@interface NSWindow (private)
|
||||
- (void) _captureMouse: sender;
|
||||
- (void) _releaseMouse: sender;
|
||||
@end
|
||||
|
||||
@implementation NSColorSampler
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
if (self == [NSColorSampler class])
|
||||
{
|
||||
// Initial version
|
||||
[self setVersion: 1];
|
||||
_gs_gui_color_sampler_lock = [NSLock new];
|
||||
}
|
||||
}
|
||||
|
||||
- (instancetype) init
|
||||
{
|
||||
if (_gs_gui_color_sampler == nil)
|
||||
{
|
||||
_gs_gui_color_sampler = self;
|
||||
}
|
||||
|
||||
if (self != _gs_gui_color_sampler)
|
||||
{
|
||||
RELEASE(self);
|
||||
return _gs_gui_color_sampler;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) showSamplerWithSelectionHandler: (GSColorSampleHandler)selectionHandler
|
||||
{
|
||||
NSEvent *currentEvent;
|
||||
NSCursor *cursor;
|
||||
NSRect contentRect = NSMakeRect(-1024,-1024,0,0);
|
||||
unsigned int style = NSTitledWindowMask | NSClosableWindowMask
|
||||
| NSResizableWindowMask | NSUtilityWindowMask;
|
||||
NSPanel *w = nil;
|
||||
NSColor *color = nil;
|
||||
|
||||
[_gs_gui_color_sampler_lock lock];
|
||||
|
||||
w = [[NSPanel alloc] initWithContentRect: contentRect
|
||||
styleMask: style
|
||||
backing: NSBackingStoreRetained
|
||||
defer: NO
|
||||
screen: nil];
|
||||
|
||||
[w setBecomesKeyOnlyIfNeeded: YES];
|
||||
[w makeKeyAndOrderFront: self];
|
||||
[w _captureMouse: self];
|
||||
|
||||
/**
|
||||
* There was code here to dynamically generate a magnifying glass
|
||||
* cursor with a magnified portion of the screenshot in it,
|
||||
* but changing the cursor rapidly on X seems to cause flicker,
|
||||
* so we just use a plain magnifying glass. (dynamic code is in r33543)
|
||||
*/
|
||||
cursor = [[NSCursor alloc] initWithImage: [NSImage imageNamed: @"MagnifyGlass"]
|
||||
hotSpot: NSMakePoint(12, 13)];
|
||||
AUTORELEASE(cursor);
|
||||
[cursor push];
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
do
|
||||
{
|
||||
NSPoint mouseLoc;
|
||||
NSImage *img;
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
|
||||
RELEASE(color);
|
||||
currentEvent = [NSApp nextEventMatchingMask: NSLeftMouseDownMask | NSLeftMouseUpMask | NSMouseMovedMask
|
||||
untilDate: [NSDate distantFuture]
|
||||
inMode: NSEventTrackingRunLoopMode
|
||||
dequeue: YES];
|
||||
|
||||
mouseLoc = [w convertBaseToScreen: [w mouseLocationOutsideOfEventStream]];
|
||||
|
||||
img = [GSCurrentServer() contentsOfScreen: [[w screen] screenNumber]
|
||||
inRect: NSMakeRect(mouseLoc.x, mouseLoc.y, 1, 1)];
|
||||
|
||||
if (nil != img)
|
||||
{
|
||||
NSBitmapImageRep *rep = (NSBitmapImageRep *)[img bestRepresentationForDevice: nil];
|
||||
color = [rep colorAtX: 0 y: 0];
|
||||
RETAIN(color);
|
||||
}
|
||||
[pool drain];
|
||||
} while ([currentEvent type] != NSLeftMouseUp &&
|
||||
[currentEvent type] != NSLeftMouseDown);
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"Exception occurred in -[NSColorSampler showSamplerWithSelectionHandler:] : %@",
|
||||
localException);
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
|
||||
CALL_BLOCK(selectionHandler, color);
|
||||
RELEASE(color);
|
||||
[NSCursor pop];
|
||||
[w _releaseMouse: self];
|
||||
[w close];
|
||||
|
||||
[_gs_gui_color_sampler_lock unlock];
|
||||
}
|
||||
|
||||
@end
|
||||
|
625
Source/NSFontCollection.m
Normal file
625
Source/NSFontCollection.m
Normal file
|
@ -0,0 +1,625 @@
|
|||
/* Implementation of class NSFontCollection
|
||||
Copyright (C) 2019, 2020 Free Software Foundation, Inc.
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: Tue Dec 10 11:51:33 EST 2019
|
||||
|
||||
Author: Fred Kiefer <fredkiefer@gmx.de>
|
||||
Date: March 2020
|
||||
|
||||
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 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/NSData.h>
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSError.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSFileManager.h>
|
||||
#import <Foundation/NSKeyedArchiver.h>
|
||||
#import <Foundation/NSLocale.h>
|
||||
#import <Foundation/NSLock.h>
|
||||
#import <Foundation/NSPathUtilities.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <AppKit/NSFontCollection.h>
|
||||
#import <AppKit/NSFontDescriptor.h>
|
||||
#import <GNUstepGUI/GSFontInfo.h>
|
||||
|
||||
static NSMutableDictionary *_availableFontCollections = nil;
|
||||
static NSLock *_fontCollectionLock = nil;
|
||||
|
||||
/*
|
||||
* Private functions...
|
||||
*/
|
||||
@interface NSFontCollection (Private)
|
||||
|
||||
+ (NSFontCollection *) _readFileAtPath: (NSString *)path;
|
||||
+ (void) _loadAvailableFontCollections;
|
||||
- (BOOL) _writeToFileAtPath: (NSString *)path;
|
||||
- (BOOL) _writeToFile;
|
||||
- (BOOL) _removeFile;
|
||||
- (NSMutableDictionary *) _fontCollectionDictionary;
|
||||
- (void) _setFontCollectionDictionary: (NSMutableDictionary *)dict;
|
||||
- (void) _setQueryDescriptors: (NSArray *)queryDescriptors;
|
||||
- (void) _setFullFileName: (NSString *)fn;
|
||||
- (NSString *) _fullFileName;
|
||||
- (void) _setName: (NSString *)n;
|
||||
- (NSString *) _name;
|
||||
@end
|
||||
|
||||
/*
|
||||
* Private functions...
|
||||
*/
|
||||
@implementation NSFontCollection (Private)
|
||||
|
||||
/**
|
||||
* Load all font collections....
|
||||
*/
|
||||
+ (void) _loadAvailableFontCollections
|
||||
{
|
||||
[_fontCollectionLock lock];
|
||||
|
||||
if (_availableFontCollections != nil)
|
||||
{
|
||||
// Nothing to do ... already loaded
|
||||
[_fontCollectionLock unlock];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *dir = nil;
|
||||
NSEnumerator *e = nil;
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
|
||||
// Create the global array of font collections...
|
||||
_availableFontCollections = [[NSMutableDictionary alloc] init];
|
||||
|
||||
/*
|
||||
* Load font lists found in standard paths into the array
|
||||
*/
|
||||
e = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
|
||||
NSAllDomainsMask, YES) objectEnumerator];
|
||||
|
||||
while ((dir = (NSString *)[e nextObject]))
|
||||
{
|
||||
BOOL flag;
|
||||
NSDirectoryEnumerator *de = nil;
|
||||
NSString *file = nil;
|
||||
|
||||
dir = [dir stringByAppendingPathComponent: @"FontCollections"];
|
||||
if (![fm fileExistsAtPath: dir isDirectory: &flag] || !flag)
|
||||
{
|
||||
// Only process existing directories
|
||||
continue;
|
||||
}
|
||||
|
||||
de = [fm enumeratorAtPath: dir];
|
||||
while ((file = [de nextObject]))
|
||||
{
|
||||
if ([[file pathExtension] isEqualToString: @"collection"])
|
||||
{
|
||||
NSString *name = [file stringByDeletingPathExtension];
|
||||
NSString *path = [dir stringByAppendingPathComponent: file];
|
||||
NSFontCollection *newCollection = [self _readFileAtPath: path];
|
||||
|
||||
if (newCollection != nil && name != nil)
|
||||
{
|
||||
[newCollection _setFullFileName: path];
|
||||
[newCollection _setName: name];
|
||||
[_availableFontCollections setObject: newCollection
|
||||
forKey: name];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[_fontCollectionLock unlock];
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSFontCollection *) _readFileAtPath: (NSString *)path
|
||||
{
|
||||
NSData *d = [NSData dataWithContentsOfFile: path];
|
||||
NSKeyedUnarchiver *u = [[NSKeyedUnarchiver alloc] initForReadingWithData: d];
|
||||
NSFontCollection *fc = [[NSFontCollection alloc] initWithCoder: u];
|
||||
|
||||
RELEASE(u);
|
||||
|
||||
return AUTORELEASE(fc);
|
||||
}
|
||||
|
||||
/*
|
||||
* Writing and Removing Files
|
||||
*/
|
||||
- (BOOL) _writeToFileAtPath: (NSString *)path
|
||||
{
|
||||
BOOL success = NO;
|
||||
NSMutableData *m = [[NSMutableData alloc] initWithCapacity: 1024];
|
||||
NSKeyedArchiver *a = [[NSKeyedArchiver alloc] initForWritingWithMutableData: m];
|
||||
|
||||
[self encodeWithCoder: a];
|
||||
[a finishEncoding];
|
||||
RELEASE(a);
|
||||
|
||||
// Write the file....
|
||||
NSDebugLLog(@"NSFontCollection", @"Writing to %@", path);
|
||||
success = [m writeToFile: path atomically: YES];
|
||||
RELEASE(m);
|
||||
return success;
|
||||
}
|
||||
|
||||
- (BOOL) _writeToFile
|
||||
{
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
BOOL success = NO;
|
||||
NSString *path = [self _fullFileName];
|
||||
|
||||
/*
|
||||
* We need to initialize before saving, to avoid the new file being
|
||||
* counted as a different collection thus making it appear twice
|
||||
*/
|
||||
[NSFontCollection _loadAvailableFontCollections];
|
||||
|
||||
if (path == nil)
|
||||
{
|
||||
// Find library....
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
|
||||
NSUserDomainMask, YES);
|
||||
|
||||
if ([paths count] == 0)
|
||||
{
|
||||
NSLog(@"Failed to find Library directory for user");
|
||||
return NO;
|
||||
}
|
||||
|
||||
path = [[paths objectAtIndex: 0]
|
||||
stringByAppendingPathComponent: @"FontCollections"];
|
||||
if ([fm fileExistsAtPath: path] == NO)
|
||||
{
|
||||
if ([fm createDirectoryAtPath: path
|
||||
withIntermediateDirectories: YES
|
||||
attributes: nil
|
||||
error: NULL])
|
||||
{
|
||||
NSDebugLLog(@"NSFontCollection", @"Created standard directory %@", path);
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Failed attempt to create directory %@", path);
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
NSDebugLLog(@"NSFontCollection", @"Font collection name = %@", [self _name]);
|
||||
path = [path stringByAppendingPathComponent:
|
||||
[[self _name] stringByAppendingPathExtension: @"collection"]];
|
||||
|
||||
[self _setFullFileName: path];
|
||||
}
|
||||
|
||||
// Create the archive...
|
||||
success = [self _writeToFileAtPath: path];
|
||||
if (success)
|
||||
{
|
||||
[_fontCollectionLock lock];
|
||||
if ([[_availableFontCollections allValues] containsObject: self] == NO)
|
||||
{
|
||||
[_availableFontCollections setObject: self forKey: [self _name]];
|
||||
}
|
||||
[_fontCollectionLock unlock];
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
- (BOOL) _removeFile
|
||||
{
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
BOOL isDir;
|
||||
NSString *path = [self _fullFileName];
|
||||
BOOL result = NO;
|
||||
|
||||
/*
|
||||
* We need to initialize before saving, to avoid the new file being
|
||||
* counted as a different collection thus making it appear twice
|
||||
*/
|
||||
[NSFontCollection _loadAvailableFontCollections];
|
||||
|
||||
if (path == nil)
|
||||
{
|
||||
// the standard path for saving font collections
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
|
||||
NSUserDomainMask, YES);
|
||||
if ([paths count] == 0)
|
||||
{
|
||||
NSLog(@"Failed to find Library directory for user");
|
||||
return NO;
|
||||
}
|
||||
path = [[[[paths objectAtIndex: 0]
|
||||
stringByAppendingPathComponent: @"FontCollections"]
|
||||
stringByAppendingPathComponent: [self _name]]
|
||||
stringByAppendingPathExtension: @"collection"];
|
||||
}
|
||||
|
||||
if (![fm fileExistsAtPath: path isDirectory: &isDir] || isDir)
|
||||
{
|
||||
NSLog(@"Failed to find font collection file to delete");
|
||||
return NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Remove the file
|
||||
result = [[NSFileManager defaultManager] removeFileAtPath: path
|
||||
handler: nil];
|
||||
|
||||
// Remove the collection from the global list of font collections
|
||||
[_fontCollectionLock lock];
|
||||
[_availableFontCollections removeObjectForKey: [self _name]];
|
||||
[_fontCollectionLock unlock];
|
||||
|
||||
// Reset file name
|
||||
[self _setFullFileName: nil];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *) _fontCollectionDictionary
|
||||
{
|
||||
return _fontCollectionDictionary;
|
||||
}
|
||||
|
||||
- (void) _setFontCollectionDictionary: (NSMutableDictionary *)dict
|
||||
{
|
||||
ASSIGNCOPY(_fontCollectionDictionary, dict);
|
||||
}
|
||||
|
||||
- (void) _setQueryDescriptors: (NSArray *)queryDescriptors
|
||||
{
|
||||
return [_fontCollectionDictionary setObject: queryDescriptors
|
||||
forKey: @"NSFontCollectionFontDescriptors"];
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *) _fontCollectionAttributes
|
||||
{
|
||||
NSMutableDictionary *attrs = [_fontCollectionDictionary objectForKey:
|
||||
@"NSFontCollectionAttributes"];
|
||||
|
||||
if (attrs == nil)
|
||||
{
|
||||
attrs = [NSMutableDictionary dictionary];
|
||||
[_fontCollectionDictionary setObject: attrs
|
||||
forKey: @"NSFontCollectionAttributes"];
|
||||
}
|
||||
return attrs;
|
||||
}
|
||||
|
||||
- (void) _setName: (NSString *)n
|
||||
{
|
||||
[[self _fontCollectionAttributes] setObject: n
|
||||
forKey: @"NSFontCollectionName"];
|
||||
}
|
||||
|
||||
- (NSString *) _name
|
||||
{
|
||||
return [[self _fontCollectionAttributes] objectForKey: @"NSFontCollectionName"];
|
||||
}
|
||||
|
||||
- (void) _setFullFileName: (NSString *)fn
|
||||
{
|
||||
[[self _fontCollectionAttributes] setObject: fn
|
||||
forKey: @"NSFontCollectionFileName"];
|
||||
}
|
||||
|
||||
- (NSString *) _fullFileName
|
||||
{
|
||||
return [[self _fontCollectionAttributes] objectForKey: @"NSFontCollectionFileName"];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/*
|
||||
* NSFontCollection
|
||||
*/
|
||||
@implementation NSFontCollection
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
if (self == [NSFontCollection class])
|
||||
{
|
||||
[self _loadAvailableFontCollections];
|
||||
}
|
||||
}
|
||||
|
||||
// Initializers...
|
||||
- (instancetype) initWithDescriptors: (NSArray *)queryDescriptors
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
_fontCollectionDictionary = [[NSMutableDictionary alloc] initWithCapacity: 10];
|
||||
[self _setQueryDescriptors: queryDescriptors];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype) init
|
||||
{
|
||||
return [self initWithDescriptors: [NSArray array]];
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(_fontCollectionDictionary);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
+ (NSFontCollection *) fontCollectionWithDescriptors: (NSArray *)queryDescriptors
|
||||
{
|
||||
NSFontCollection *fc = [[NSFontCollection alloc] initWithDescriptors: queryDescriptors];
|
||||
return AUTORELEASE(fc);
|
||||
}
|
||||
|
||||
+ (NSFontCollection *) fontCollectionWithAllAvailableDescriptors
|
||||
{
|
||||
NSFontCollection *fc = [_availableFontCollections objectForKey: NSFontCollectionAllFonts];
|
||||
if (fc == nil)
|
||||
{
|
||||
NSDictionary *fa = [NSDictionary dictionary];
|
||||
NSFontDescriptor *fd = [NSFontDescriptor fontDescriptorWithFontAttributes: fa];
|
||||
fc = [self fontCollectionWithDescriptors: [NSArray arrayWithObject: fd]];
|
||||
if (fc != nil)
|
||||
{
|
||||
[fc _setName: NSFontCollectionAllFonts];
|
||||
[fc _writeToFile];
|
||||
}
|
||||
}
|
||||
return fc;
|
||||
}
|
||||
|
||||
+ (NSFontCollection *) fontCollectionWithLocale: (NSLocale *)locale
|
||||
{
|
||||
NSDictionary *fa = [NSDictionary dictionaryWithObject: [locale languageCode]
|
||||
forKey: @"NSCTFontDesignLanguagesAttribute"];
|
||||
NSFontDescriptor *fd = [NSFontDescriptor fontDescriptorWithFontAttributes: fa];
|
||||
return [self fontCollectionWithDescriptors: [NSArray arrayWithObject: fd]];
|
||||
}
|
||||
|
||||
+ (BOOL) showFontCollection: (NSFontCollection *)collection
|
||||
withName: (NSFontCollectionName)name
|
||||
visibility: (NSFontCollectionVisibility)visibility
|
||||
error: (NSError **)error
|
||||
{
|
||||
[collection _setName: name];
|
||||
return [collection _writeToFile];
|
||||
}
|
||||
|
||||
+ (BOOL) hideFontCollectionWithName: (NSFontCollectionName)name
|
||||
visibility: (NSFontCollectionVisibility)visibility
|
||||
error: (NSError **)error
|
||||
{
|
||||
NSFontCollection *collection = [_availableFontCollections objectForKey: name];
|
||||
|
||||
return [collection _removeFile];
|
||||
}
|
||||
|
||||
+ (BOOL) renameFontCollectionWithName: (NSFontCollectionName)aname
|
||||
visibility: (NSFontCollectionVisibility)visibility
|
||||
toName: (NSFontCollectionName)name
|
||||
error: (NSError **)error
|
||||
{
|
||||
NSFontCollection *collection = [_availableFontCollections objectForKey: aname];
|
||||
BOOL rv = [collection _removeFile];
|
||||
|
||||
if (rv == YES)
|
||||
{
|
||||
[collection _setName: name];
|
||||
[collection _writeToFile];
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
+ (NSArray *) allFontCollectionNames
|
||||
{
|
||||
return [_availableFontCollections allKeys];
|
||||
}
|
||||
|
||||
+ (NSFontCollection *) fontCollectionWithName: (NSFontCollectionName)name
|
||||
{
|
||||
NSFontCollection *fc = [_availableFontCollections objectForKey: name];
|
||||
if (fc == nil)
|
||||
{
|
||||
fc = [[NSFontCollection alloc] init];
|
||||
[fc _setName: name];
|
||||
AUTORELEASE(fc);
|
||||
}
|
||||
return fc;
|
||||
}
|
||||
|
||||
+ (NSFontCollection *) fontCollectionWithName: (NSFontCollectionName)name
|
||||
visibility: (NSFontCollectionVisibility)visibility
|
||||
{
|
||||
return [self fontCollectionWithName: name];
|
||||
}
|
||||
|
||||
// Descriptors
|
||||
- (NSArray *) queryDescriptors
|
||||
{
|
||||
return [_fontCollectionDictionary objectForKey: @"NSFontCollectionFontDescriptors"];
|
||||
}
|
||||
|
||||
- (NSArray *) exclusionDescriptors
|
||||
{
|
||||
return [_fontCollectionDictionary objectForKey: @"NSFontExclusionDescriptorAttributes"];
|
||||
}
|
||||
|
||||
- (NSArray *) matchingDescriptors
|
||||
{
|
||||
return [self matchingDescriptorsWithOptions: nil];
|
||||
}
|
||||
|
||||
- (NSArray *) matchingDescriptorsWithOptions: (NSDictionary *)options
|
||||
{
|
||||
return [self matchingDescriptorsForFamily: nil options: options];
|
||||
}
|
||||
|
||||
- (NSArray *) matchingDescriptorsForFamily: (NSString *)family
|
||||
{
|
||||
return [self matchingDescriptorsForFamily: family options: nil];
|
||||
}
|
||||
|
||||
- (NSArray *) matchingDescriptorsForFamily: (NSString *)family options: (NSDictionary *)options
|
||||
{
|
||||
GSFontEnumerator *fen = [GSFontEnumerator sharedEnumerator];
|
||||
|
||||
return [fen matchingDescriptorsForFamily: family
|
||||
options: options
|
||||
inclusion: [self queryDescriptors]
|
||||
exculsion: [self exclusionDescriptors]];
|
||||
}
|
||||
|
||||
- (instancetype) copyWithZone: (NSZone *)zone
|
||||
{
|
||||
NSFontCollection *fc = [[NSFontCollection allocWithZone: zone] init];
|
||||
[fc _setFontCollectionDictionary: _fontCollectionDictionary];
|
||||
return fc;
|
||||
}
|
||||
|
||||
- (instancetype) mutableCopyWithZone: (NSZone *)zone
|
||||
{
|
||||
NSMutableFontCollection *fc = [[NSMutableFontCollection allocWithZone: zone] init];
|
||||
|
||||
[fc _setFontCollectionDictionary: [_fontCollectionDictionary mutableCopyWithZone: zone]];
|
||||
|
||||
return fc;
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder *)coder
|
||||
{
|
||||
if ([coder allowsKeyedCoding])
|
||||
{
|
||||
[coder encodeObject: _fontCollectionDictionary
|
||||
forKey: @"NSFontCollectionDictionary"];
|
||||
}
|
||||
else
|
||||
{
|
||||
[coder encodeObject: _fontCollectionDictionary];
|
||||
}
|
||||
}
|
||||
|
||||
- (instancetype) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
if ([coder allowsKeyedCoding])
|
||||
{
|
||||
ASSIGN(_fontCollectionDictionary,
|
||||
[coder decodeObjectForKey: @"NSFontCollectionDictionary"]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[coder decodeValueOfObjCType: @encode(id) at: &_fontCollectionDictionary];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation NSMutableFontCollection
|
||||
|
||||
+ (NSMutableFontCollection *) fontCollectionWithDescriptors: (NSArray *)queryDescriptors
|
||||
{
|
||||
return [[NSFontCollection fontCollectionWithDescriptors: queryDescriptors] mutableCopy];
|
||||
}
|
||||
|
||||
+ (NSMutableFontCollection *) fontCollectionWithAllAvailableDescriptors
|
||||
{
|
||||
return [[NSFontCollection fontCollectionWithAllAvailableDescriptors] mutableCopy];
|
||||
}
|
||||
|
||||
+ (NSMutableFontCollection *) fontCollectionWithLocale: (NSLocale *)locale
|
||||
{
|
||||
return [[NSFontCollection fontCollectionWithLocale: locale] mutableCopy];
|
||||
}
|
||||
|
||||
+ (NSMutableFontCollection *) fontCollectionWithName: (NSFontCollectionName)name
|
||||
{
|
||||
return [[NSFontCollection fontCollectionWithName: name] mutableCopy];
|
||||
}
|
||||
|
||||
+ (NSMutableFontCollection *) fontCollectionWithName: (NSFontCollectionName)name
|
||||
visibility: (NSFontCollectionVisibility)visibility
|
||||
{
|
||||
return [[NSFontCollection fontCollectionWithName: name visibility: visibility] mutableCopy];
|
||||
}
|
||||
|
||||
- (NSArray *) queryDescriptors
|
||||
{
|
||||
return [super queryDescriptors];
|
||||
}
|
||||
|
||||
- (void) setQueryDescriptors: (NSArray *)queryDescriptors
|
||||
{
|
||||
[super _setQueryDescriptors: [queryDescriptors mutableCopy]];
|
||||
}
|
||||
|
||||
- (NSArray *) exclusionDescriptors
|
||||
{
|
||||
return [_fontCollectionDictionary objectForKey: @"NSFontExclusionDescriptorAttributes"];
|
||||
}
|
||||
|
||||
- (void) setExclusionDescriptors: (NSArray *)exclusionDescriptors
|
||||
{
|
||||
[_fontCollectionDictionary setObject: [exclusionDescriptors mutableCopy]
|
||||
forKey: @"NSFontExclusionDescriptorAttributes"];
|
||||
|
||||
}
|
||||
|
||||
- (void) addQueryForDescriptors: (NSArray *)descriptors
|
||||
{
|
||||
NSMutableArray *arr = [[self queryDescriptors] mutableCopy];
|
||||
NSMutableArray *ed = [[self exclusionDescriptors] mutableCopy];
|
||||
|
||||
[ed removeObjectsInArray: descriptors];
|
||||
[arr addObjectsFromArray: descriptors];
|
||||
[self setQueryDescriptors: arr];
|
||||
[self setExclusionDescriptors: ed];
|
||||
RELEASE(arr);
|
||||
RELEASE(ed);
|
||||
}
|
||||
|
||||
- (void) removeQueryForDescriptors: (NSArray *)descriptors
|
||||
{
|
||||
NSMutableArray *arr = [[self queryDescriptors] mutableCopy];
|
||||
NSMutableArray *ed = [[self exclusionDescriptors] mutableCopy];
|
||||
|
||||
[ed addObjectsFromArray: descriptors];
|
||||
[arr removeObjectsInArray: descriptors];
|
||||
[self setQueryDescriptors: arr];
|
||||
[self setExclusionDescriptors: ed];
|
||||
RELEASE(arr);
|
||||
RELEASE(ed);
|
||||
}
|
||||
|
||||
@end
|
|
@ -8,16 +8,16 @@
|
|||
* This file is part of GNUstep.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* 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 program 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 General Public License for more details.
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110
|
||||
* USA.
|
||||
|
|
|
@ -8,16 +8,16 @@
|
|||
* This file is part of GNUstep.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* it under the terms of the Lesser GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
* Lesser GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* You should have received a copy of the Lesser GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110
|
||||
* USA.
|
||||
|
|
|
@ -29,9 +29,12 @@
|
|||
|
||||
#import "config.h"
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSObjCRuntime.h>
|
||||
|
||||
#import "AppKit/NSApplication.h"
|
||||
#import "AppKit/NSEvent.h"
|
||||
#import "AppKit/NSAppearance.h"
|
||||
#import "AppKit/NSFontCollection.h"
|
||||
|
||||
// Global strings
|
||||
NSString *NSModalPanelRunLoopMode = @"NSModalPanelRunLoopMode";
|
||||
|
@ -42,43 +45,43 @@ const double NSAppKitVersionNumber = NSAppKitVersionNumber10_4;
|
|||
//
|
||||
// Global Exception Strings
|
||||
//
|
||||
NSString *NSAbortModalException = @"NSAbortModalException";
|
||||
NSString *NSAbortPrintingException = @"NSAbortPrintingException";
|
||||
NSString *NSAppKitIgnoredException = @"NSAppKitIgnoredException";
|
||||
NSString *NSAppKitVirtualMemoryException = @"NSAppKitVirtualMemoryException";
|
||||
NSString *NSBadBitmapParametersException = @"NSBadBitmapParametersException";
|
||||
NSString *NSBadComparisonException = @"NSBadComparisonException";
|
||||
NSString *NSBadRTFColorTableException = @"NSBadRTFColorTableException";
|
||||
NSString *NSBadRTFDirectiveException = @"NSBadRTFDirectiveException";
|
||||
NSString *NSBadRTFFontTableException = @"NSBadRTFFontTableException";
|
||||
NSString *NSBadRTFStyleSheetException = @"NSBadRTFStyleSheetException";
|
||||
NSString *NSBrowserIllegalDelegateException = @"NSBrowserIllegalDelegateException";
|
||||
NSString *NSColorListIOException = @"NSColorListIOException";
|
||||
NSString *NSColorListNotEditableException = @"NSColorListNotEditableException";
|
||||
NSString *NSDraggingException = @"NSDraggingException";
|
||||
NSString *NSFontUnavailableException = @"NSFontUnavailableException";
|
||||
NSString *NSIllegalSelectorException = @"NSIllegalSelectorException";
|
||||
NSString *NSImageCacheException = @"NSImageCacheException";
|
||||
NSString *NSNibLoadingException = @"NSNibLoadingException";
|
||||
NSString *NSPPDIncludeNotFoundException = @"NSPPDIncludeNotFoundException";
|
||||
NSString *NSPPDIncludeStackOverflowException = @"NSPPDIncludeStackOverflowException";
|
||||
NSString *NSPPDIncludeStackUnderflowException = @"NSPPDIncludeStackUnderflowException";
|
||||
NSString *NSPPDParseException = @"NSPPDParseException";
|
||||
NSString *NSPrintOperationExistsException = @"NSPrintOperationExistsException";
|
||||
NSString *NSPrintPackageException = @"NSPrintPackageException";
|
||||
NSString *NSPrintingCommunicationException = @"NSPrintingCommunicationException";
|
||||
NSString *NSRTFPropertyStackOverflowException = @"NSRTFPropertyStackOverflowException";
|
||||
NSString *NSTIFFException = @"NSTIFFException";
|
||||
NSString *NSTextLineTooLongException = @"NSTextLineTooLongException";
|
||||
NSString *NSTextNoSelectionException = @"NSTextNoSelectionException";
|
||||
NSString *NSTextReadException = @"NSTextReadException";
|
||||
NSString *NSTextWriteException = @"NSTextWriteException";
|
||||
NSString *NSTypedStreamVersionException = @"NSTypedStreamVersionException";
|
||||
NSString *NSWindowServerCommunicationException = @"NSWindowServerCommunicationException";
|
||||
NSString *NSWordTablesReadException = @"NSWordTablesReadException";
|
||||
NSString *NSWordTablesWriteException = @"NSWordTablesWriteException";
|
||||
NSExceptionName NSAbortModalException = @"NSAbortModalException";
|
||||
NSExceptionName NSAbortPrintingException = @"NSAbortPrintingException";
|
||||
NSExceptionName NSAppKitIgnoredException = @"NSAppKitIgnoredException";
|
||||
NSExceptionName NSAppKitVirtualMemoryException = @"NSAppKitVirtualMemoryException";
|
||||
NSExceptionName NSBadBitmapParametersException = @"NSBadBitmapParametersException";
|
||||
NSExceptionName NSBadComparisonException = @"NSBadComparisonException";
|
||||
NSExceptionName NSBadRTFColorTableException = @"NSBadRTFColorTableException";
|
||||
NSExceptionName NSBadRTFDirectiveException = @"NSBadRTFDirectiveException";
|
||||
NSExceptionName NSBadRTFFontTableException = @"NSBadRTFFontTableException";
|
||||
NSExceptionName NSBadRTFStyleSheetException = @"NSBadRTFStyleSheetException";
|
||||
NSExceptionName NSBrowserIllegalDelegateException = @"NSBrowserIllegalDelegateException";
|
||||
NSExceptionName NSColorListIOException = @"NSColorListIOException";
|
||||
NSExceptionName NSColorListNotEditableException = @"NSColorListNotEditableException";
|
||||
NSExceptionName NSDraggingException = @"NSDraggingException";
|
||||
NSExceptionName NSFontUnavailableException = @"NSFontUnavailableException";
|
||||
NSExceptionName NSIllegalSelectorException = @"NSIllegalSelectorException";
|
||||
NSExceptionName NSImageCacheException = @"NSImageCacheException";
|
||||
NSExceptionName NSNibLoadingException = @"NSNibLoadingException";
|
||||
NSExceptionName NSPPDIncludeNotFoundException = @"NSPPDIncludeNotFoundException";
|
||||
NSExceptionName NSPPDIncludeStackOverflowException = @"NSPPDIncludeStackOverflowException";
|
||||
NSExceptionName NSPPDIncludeStackUnderflowException = @"NSPPDIncludeStackUnderflowException";
|
||||
NSExceptionName NSPPDParseException = @"NSPPDParseException";
|
||||
NSExceptionName NSPrintOperationExistsException = @"NSPrintOperationExistsException";
|
||||
NSExceptionName NSPrintPackageException = @"NSPrintPackageException";
|
||||
NSExceptionName NSPrintingCommunicationException = @"NSPrintingCommunicationException";
|
||||
NSExceptionName NSRTFPropertyStackOverflowException = @"NSRTFPropertyStackOverflowException";
|
||||
NSExceptionName NSTIFFException = @"NSTIFFException";
|
||||
NSExceptionName NSTextLineTooLongException = @"NSTextLineTooLongException";
|
||||
NSExceptionName NSTextNoSelectionException = @"NSTextNoSelectionException";
|
||||
NSExceptionName NSTextReadException = @"NSTextReadException";
|
||||
NSExceptionName NSTextWriteException = @"NSTextWriteException";
|
||||
NSExceptionName NSTypedStreamVersionException = @"NSTypedStreamVersionException";
|
||||
NSExceptionName NSWindowServerCommunicationException = @"NSWindowServerCommunicationException";
|
||||
NSExceptionName NSWordTablesReadException = @"NSWordTablesReadException";
|
||||
NSExceptionName NSWordTablesWriteException = @"NSWordTablesWriteException";
|
||||
|
||||
NSString *GSWindowServerInternalException = @"WindowServerInternal";
|
||||
NSExceptionName GSWindowServerInternalException = @"WindowServerInternal";
|
||||
|
||||
// NSAnimation
|
||||
NSString* NSAnimationProgressMarkNotification
|
||||
|
@ -812,10 +815,25 @@ const NSAppearanceName NSAppearanceNameAccessibilityHighContrastVibrantDark =
|
|||
@"NSAppearanceNameAccessibilityHighContrastVibrantDark";
|
||||
const NSAppearanceName NSAppearanceNameLightContent = @"NSAppearanceNameLightContent";
|
||||
|
||||
// Values for NSFontCollectionAction
|
||||
NSFontCollectionActionTypeKey const NSFontCollectionWasShown = @"NSFontCollectionWasShown";
|
||||
NSFontCollectionActionTypeKey const NSFontCollectionWasHidden = @"NSFontCollectionWasHidden";
|
||||
NSFontCollectionActionTypeKey const NSFontCollectionWasRenamed = @"NSFontCollectionWasRenamed";
|
||||
|
||||
// Standard named collections
|
||||
NSFontCollectionName const NSFontCollectionAllFonts = @"NSFontCollectionAllFonts";
|
||||
NSFontCollectionName const NSFontCollectionUser = @"NSFontCollectionUser";
|
||||
NSFontCollectionName const NSFontCollectionFavorites = @"NSFontCollectionFavorites";
|
||||
NSFontCollectionName const NSFontCollectionRecentlyUsed = @"NSFontCollectionRecentlyUsed";
|
||||
|
||||
// Collections
|
||||
NSFontCollectionMatchingOptionKey const NSFontCollectionIncludeDisabledFontsOption = @"NSFontCollectionIncludeDisabledFontsOption";
|
||||
NSFontCollectionMatchingOptionKey const NSFontCollectionRemoveDuplicatesOption = @"NSFontCollectionRemoveDuplicatesOption";
|
||||
NSFontCollectionMatchingOptionKey const NSFontCollectionDisallowAutoActivationOption = @"NSFontCollectionDisallowAutoActivationOption";
|
||||
|
||||
// Speech recognition...
|
||||
const NSString *GSSpeechRecognizerDidRecognizeWordNotification = @"GSSpeechRecognizerDidRecognizeWordNotification";
|
||||
|
||||
|
||||
extern void __objc_gui_force_linking (void);
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue