mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 06:51:44 +00:00
Merge branch 'master' into xib_document
This commit is contained in:
commit
e2c59a7bee
8 changed files with 370 additions and 4 deletions
|
@ -48,6 +48,7 @@
|
|||
#import <AppKit/NSAccessibilityConstants.h>
|
||||
#import <AppKit/NSActionCell.h>
|
||||
#import <AppKit/NSAnimationContext.h>
|
||||
#import <AppKit/NSAppearance.h>
|
||||
#import <AppKit/NSApplication.h>
|
||||
#import <AppKit/NSAttributedString.h>
|
||||
#import <AppKit/NSBitmapImageRep.h>
|
||||
|
@ -71,6 +72,7 @@
|
|||
#import <AppKit/NSControl.h>
|
||||
#import <AppKit/NSCursor.h>
|
||||
#import <AppKit/NSCustomImageRep.h>
|
||||
#import <AppKit/NSDataAsset.h>
|
||||
#import <AppKit/NSDataLink.h>
|
||||
#import <AppKit/NSDataLinkManager.h>
|
||||
#import <AppKit/NSDataLinkPanel.h>
|
||||
|
|
84
Headers/AppKit/NSAppearance.h
Normal file
84
Headers/AppKit/NSAppearance.h
Normal file
|
@ -0,0 +1,84 @@
|
|||
/* Definition of class NSAppearance
|
||||
Copyright (C) 2020 Free Software Foundation, Inc.
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: Wed Jan 15 07:03:39 EST 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 _NSAppearance_h_GNUSTEP_GUI_INCLUDE
|
||||
#define _NSAppearance_h_GNUSTEP_GUI_INCLUDE
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <Foundation/NSBundle.h>
|
||||
#import <AppKit/AppKitDefines.h>
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9, GS_API_LATEST)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef NSString* NSAppearanceName;
|
||||
|
||||
@interface NSAppearance : NSObject <NSCoding>
|
||||
{
|
||||
NSString *_name;
|
||||
BOOL _allowsVibrancy;
|
||||
NSAppearanceName _currentAppearance;
|
||||
}
|
||||
|
||||
// Creating an appearance...
|
||||
+ (instancetype) appearanceNamed: (NSString *)name;
|
||||
- (instancetype) initWithAppearanceNamed: (NSString *)name bundle: (NSBundle *)bundle;
|
||||
|
||||
// Getting the appearance name
|
||||
- (NSString *) name;
|
||||
|
||||
// Determining the most appropriate appearance
|
||||
- (NSAppearanceName) bestMatchFromAppearancesWithNames: (NSArray *)appearances;
|
||||
|
||||
// Getting and setting the appearance
|
||||
+ (void) setCurrentAppearance: (NSAppearanceName)name;
|
||||
+ (NSAppearanceName) currentAppearance;
|
||||
|
||||
// Managing vibrancy
|
||||
- (BOOL) allowsVibrancy;
|
||||
|
||||
@end
|
||||
|
||||
APPKIT_EXPORT NSAppearanceName const NSAppearanceNameAqua;
|
||||
APPKIT_EXPORT NSAppearanceName const NSAppearanceNameDarkAqua;
|
||||
APPKIT_EXPORT NSAppearanceName const NSAppearanceNameVibrantLight;
|
||||
APPKIT_EXPORT NSAppearanceName const NSAppearanceNameVibrantDark;
|
||||
APPKIT_EXPORT NSAppearanceName const NSAppearanceNameAccessibilityHighContrastAqua;
|
||||
APPKIT_EXPORT NSAppearanceName const NSAppearanceNameAccessibilityHighContrastDarkAqua;
|
||||
APPKIT_EXPORT NSAppearanceName const NSAppearanceNameAccessibilityHighContrastVibrantLight;
|
||||
APPKIT_EXPORT NSAppearanceName const NSAppearanceNameAccessibilityHighContrastVibrantDark;
|
||||
APPKIT_EXPORT NSAppearanceName const NSAppearanceNameLightContent;
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GS_API_MACOSX */
|
||||
|
||||
#endif /* _NSAppearance_h_GNUSTEP_GUI_INCLUDE */
|
||||
|
68
Headers/AppKit/NSDataAsset.h
Normal file
68
Headers/AppKit/NSDataAsset.h
Normal file
|
@ -0,0 +1,68 @@
|
|||
/* Definition of class NSDataAsset
|
||||
Copyright (C) 2020 Free Software Foundation, Inc.
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: Fri Jan 17 10:25:34 EST 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 _NSDataAsset_h_GNUSTEP_GUI_INCLUDE
|
||||
#define _NSDataAsset_h_GNUSTEP_GUI_INCLUDE
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_11, GS_API_LATEST)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@class NSData, NSBundle, NSString;
|
||||
|
||||
typedef NSString* NSDataAssetName;
|
||||
|
||||
@interface NSDataAsset : NSObject <NSCopying>
|
||||
{
|
||||
NSDataAssetName _name;
|
||||
NSBundle *_bundle;
|
||||
NSData *_data;
|
||||
NSString *_typeIdentifier;
|
||||
}
|
||||
|
||||
// Initializing the Data Asset
|
||||
- (instancetype) initWithName: (NSDataAssetName)name;
|
||||
- (instancetype) initWithName: (NSDataAssetName)name bundle: (NSBundle *)bundle;
|
||||
|
||||
// Accessing data...
|
||||
- (NSData *) data;
|
||||
|
||||
// Getting data asset information
|
||||
- (NSDataAssetName) name;
|
||||
- (NSString *) typeIdentifier;
|
||||
|
||||
@end
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GS_API_MACOSX */
|
||||
|
||||
#endif /* _NSDataAsset_h_GNUSTEP_GUI_INCLUDE */
|
||||
|
7
MISSING
7
MISSING
|
@ -7,14 +7,12 @@ MISSING HEADERS
|
|||
> NSAccessibilityElement.h
|
||||
> NSAccessibilityProtocols.h
|
||||
> NSAlignmentFeedbackFilter.h
|
||||
> NSAppearance.h
|
||||
> NSCollectionViewCompositionalLayout.h
|
||||
> NSCollectionViewFlowLayout.h
|
||||
> NSCollectionViewGridLayout.h
|
||||
> NSCollectionViewLayout.h
|
||||
> NSCollectionViewTransitionLayout.h
|
||||
> NSColorSampler.h
|
||||
> NSDataAsset.h
|
||||
> NSDictionaryController.h
|
||||
> NSDiffableDataSource.h
|
||||
> NSDraggingItem.h
|
||||
|
@ -76,7 +74,7 @@ MISSING HEADERS
|
|||
> NSWindowRestoration.h
|
||||
> NSWindowTab.h
|
||||
> NSWindowTabGroup.h
|
||||
Total: 82
|
||||
Total: 74
|
||||
|
||||
Completed
|
||||
---
|
||||
|
@ -86,7 +84,8 @@ Completed
|
|||
> NSPDFPanel.h
|
||||
> NSPICTImageRep.h
|
||||
> NSDockTile.h
|
||||
Total: 6
|
||||
> NSAppearance.h
|
||||
Total: 7
|
||||
|
||||
Mac Specific
|
||||
---
|
||||
|
|
|
@ -50,6 +50,7 @@ NSAffineTransform.m \
|
|||
NSAlert.m \
|
||||
NSAnimation.m \
|
||||
NSAnimationContext.m \
|
||||
NSAppearance.m \
|
||||
NSApplication.m \
|
||||
NSArrayController.m \
|
||||
NSAttributedString.m \
|
||||
|
@ -89,6 +90,7 @@ NSController.m \
|
|||
NSCursor.m \
|
||||
NSCustomImageRep.m \
|
||||
NSCustomTouchBarItem.m \
|
||||
NSDataAsset.m \
|
||||
NSDataLink.m \
|
||||
NSDataLinkManager.m \
|
||||
NSDataLinkPanel.m \
|
||||
|
@ -345,6 +347,7 @@ NSAffineTransform.h \
|
|||
NSAlert.h \
|
||||
NSAnimation.h \
|
||||
NSAnimationContext.h \
|
||||
NSAppearance.h \
|
||||
NSApplication.h \
|
||||
NSArrayController.h \
|
||||
NSBezierPath.h \
|
||||
|
@ -377,6 +380,7 @@ NSController.h \
|
|||
NSCursor.h \
|
||||
NSCustomImageRep.h \
|
||||
NSCustomTouchBarItem.h \
|
||||
NSDataAsset.h \
|
||||
NSDataLink.h \
|
||||
NSDataLinkManager.h \
|
||||
NSDataLinkPanel.h \
|
||||
|
|
110
Source/NSAppearance.m
Normal file
110
Source/NSAppearance.m
Normal file
|
@ -0,0 +1,110 @@
|
|||
/* Implementation of class NSAppearance
|
||||
Copyright (C) 2020 Free Software Foundation, Inc.
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: Wed Jan 15 07:03:39 EST 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 <AppKit/NSAppearance.h>
|
||||
#import <Foundation/NSArchiver.h>
|
||||
|
||||
NSAppearance *__currentAppearance = nil;
|
||||
|
||||
@implementation NSAppearance
|
||||
|
||||
// Creating an appearance...
|
||||
+ (instancetype) appearanceNamed: (NSString *)name
|
||||
{
|
||||
return [[NSAppearance alloc] initWithAppearanceNamed: name bundle: nil];
|
||||
}
|
||||
|
||||
- (instancetype) initWithAppearanceNamed: (NSString *)name bundle: (NSBundle *)bundle
|
||||
{
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
ASSIGNCOPY(_name, name);
|
||||
_allowsVibrancy = NO;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
if ([coder allowsKeyedCoding])
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSIGN(_name, [coder decodeObject]);
|
||||
[coder decodeValueOfObjCType: @encode(BOOL) at: &_allowsVibrancy];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder *)coder
|
||||
{
|
||||
if ([coder allowsKeyedCoding])
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
[coder encodeObject: _name];
|
||||
[coder encodeValueOfObjCType: @encode(BOOL) at: &_allowsVibrancy];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(_name);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
// Getting the appearance name
|
||||
- (NSString *) name
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
// Determining the most appropriate appearance
|
||||
- (NSAppearanceName) bestMatchFromAppearancesWithNames: (NSArray *)appearances
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Getting and setting the appearance
|
||||
+ (void) setCurrentAppearance: (NSAppearance *)appearance
|
||||
{
|
||||
ASSIGN(__currentAppearance, appearance);
|
||||
}
|
||||
|
||||
+ (NSAppearance *) currentAppearance
|
||||
{
|
||||
return __currentAppearance;
|
||||
}
|
||||
|
||||
// Managing vibrancy
|
||||
- (BOOL) allowsVibrancy
|
||||
{
|
||||
return _allowsVibrancy;
|
||||
}
|
||||
|
||||
@end
|
||||
|
85
Source/NSDataAsset.m
Normal file
85
Source/NSDataAsset.m
Normal file
|
@ -0,0 +1,85 @@
|
|||
/* Implementation of class NSDataAsset
|
||||
Copyright (C) 2020 Free Software Foundation, Inc.
|
||||
|
||||
By: Gregory John Casamento
|
||||
Date: Fri Jan 17 10:25:34 EST 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/NSBundle.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSData.h>
|
||||
#import <AppKit/NSDataAsset.h>
|
||||
|
||||
@implementation NSDataAsset
|
||||
|
||||
// Initializing the Data Asset
|
||||
- (instancetype) initWithName: (NSDataAssetName)name
|
||||
{
|
||||
return [self initWithName: name bundle: nil];
|
||||
}
|
||||
|
||||
- (instancetype) initWithName: (NSDataAssetName)name bundle: (NSBundle *)bundle
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
ASSIGNCOPY(_name, name);
|
||||
ASSIGN(_bundle, bundle);
|
||||
_data = nil;
|
||||
_typeIdentifier = nil;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(_name);
|
||||
RELEASE(_bundle);
|
||||
RELEASE(_data);
|
||||
RELEASE(_typeIdentifier);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id) copyWithZone: (NSZone *)zone
|
||||
{
|
||||
NSDataAsset *copy = [[NSDataAsset allocWithZone: zone] initWithName: _name bundle: _bundle];
|
||||
ASSIGNCOPY(copy->_data, _data);
|
||||
ASSIGNCOPY(copy->_typeIdentifier, _typeIdentifier);
|
||||
return copy;
|
||||
}
|
||||
|
||||
// Accessing data...
|
||||
- (NSData *) data
|
||||
{
|
||||
return _data;
|
||||
}
|
||||
|
||||
// Getting data asset information
|
||||
- (NSDataAssetName) name
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
- (NSString *) typeIdentifier
|
||||
{
|
||||
return _typeIdentifier;
|
||||
}
|
||||
@end
|
||||
|
|
@ -31,6 +31,7 @@
|
|||
#import <Foundation/NSString.h>
|
||||
#import "AppKit/NSApplication.h"
|
||||
#import "AppKit/NSEvent.h"
|
||||
#import "AppKit/NSAppearance.h"
|
||||
|
||||
// Global strings
|
||||
NSString *NSModalPanelRunLoopMode = @"NSModalPanelRunLoopMode";
|
||||
|
@ -798,6 +799,19 @@ NSString *const NSRuleEditorPredicateCompoundType = @"NSRuleEditorPredicateCompo
|
|||
|
||||
NSString *NSRuleEditorRowsDidChangeNotification = @"NSRuleEditorRowsDidChangeNotification";
|
||||
|
||||
// NSAppearance
|
||||
const NSAppearanceName NSAppearanceNameAqua = @"NSAppearanceNameAqua";
|
||||
const NSAppearanceName NSAppearanceNameDarkAqua = @"NSAppearanceNameDarkAqua";
|
||||
const NSAppearanceName NSAppearanceNameVibrantLight = @"NSAppearanceNameVibrantLight";
|
||||
const NSAppearanceName NSAppearanceNameVibrantDark = @"NSAppearanceNameVibrantDark";
|
||||
const NSAppearanceName NSAppearanceNameAccessibilityHighContrastAqua = @"NSAppearanceNameAccessibilityHighContrastAqua";
|
||||
const NSAppearanceName NSAppearanceNameAccessibilityHighContrastDarkAqua = @"NSAppearanceNameAccessibilityHighContrastDarkAqua";
|
||||
const NSAppearanceName NSAppearanceNameAccessibilityHighContrastVibrantLight =
|
||||
@"NSAppearanceNameAccessibilityHighContrastVibrantLight";
|
||||
const NSAppearanceName NSAppearanceNameAccessibilityHighContrastVibrantDark =
|
||||
@"NSAppearanceNameAccessibilityHighContrastVibrantDark";
|
||||
const NSAppearanceName NSAppearanceNameLightContent = @"NSAppearanceNameLightContent";
|
||||
|
||||
extern void __objc_gui_force_linking (void);
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue