mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Clean compilation
This commit is contained in:
parent
f23058b172
commit
d9c42f8cc8
4 changed files with 187 additions and 0 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>
|
||||
|
|
83
Headers/AppKit/NSAppearance.h
Normal file
83
Headers/AppKit/NSAppearance.h
Normal file
|
@ -0,0 +1,83 @@
|
|||
/* Definition of class NSAppearance
|
||||
Copyright (C) 2019 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>
|
||||
|
||||
#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 <NSCopying, 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
|
||||
|
||||
const NSAppearanceName NSAppearanceNameAqua;
|
||||
const NSAppearanceName NSAppearanceNameDarkAqua;
|
||||
const NSAppearanceName NSAppearanceNameVibrantLight;
|
||||
const NSAppearanceName NSAppearanceNameVibrantDark;
|
||||
const NSAppearanceName NSAppearanceNameAccessibilityHighContrastAqua;
|
||||
const NSAppearanceName NSAppearanceNameAccessibilityHighContrastDarkAqua;
|
||||
const NSAppearanceName NSAppearanceNameAccessibilityHighContrastVibrantLight;
|
||||
const NSAppearanceName NSAppearanceNameAccessibilityHighContrastVibrantDark;
|
||||
const NSAppearanceName NSAppearanceNameLightContent;
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GS_API_MACOSX */
|
||||
|
||||
#endif /* _NSAppearance_h_GNUSTEP_GUI_INCLUDE */
|
||||
|
|
@ -50,6 +50,7 @@ NSAffineTransform.m \
|
|||
NSAlert.m \
|
||||
NSAnimation.m \
|
||||
NSAnimationContext.m \
|
||||
NSAppearance.m \
|
||||
NSApplication.m \
|
||||
NSArrayController.m \
|
||||
NSAttributedString.m \
|
||||
|
@ -343,6 +344,7 @@ NSAffineTransform.h \
|
|||
NSAlert.h \
|
||||
NSAnimation.h \
|
||||
NSAnimationContext.h \
|
||||
NSAppearance.h \
|
||||
NSApplication.h \
|
||||
NSArrayController.h \
|
||||
NSBezierPath.h \
|
||||
|
|
101
Source/NSAppearance.m
Normal file
101
Source/NSAppearance.m
Normal file
|
@ -0,0 +1,101 @@
|
|||
/* Implementation of class NSAppearance
|
||||
Copyright (C) 2019 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>
|
||||
|
||||
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
|
||||
{
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder *)coder
|
||||
{
|
||||
}
|
||||
|
||||
- (instancetype) copyWithZone: (NSZone *)zone
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
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";
|
Loading…
Reference in a new issue