NSUserNotification and related classes

darlinghq/darling#445
This commit is contained in:
Andrew Hyatt 2019-01-16 17:15:28 -05:00
parent 6f6492b692
commit 372892456c
6 changed files with 80 additions and 23 deletions

View File

@ -215,7 +215,6 @@ set(foundation_sources
src/NSURLDownload.m
src/NSXPCConnection.m
src/NSAppleEventManager.m
src/NSUserNotificationCenter.m
src/NSDateComponentsFormatter.m
src/NSMeasurementFormatter.m
src/NSAppleScript.m
@ -226,6 +225,7 @@ set(foundation_sources
src/NSScriptObjectSpecifiers.m
src/NSScriptCommand.m
src/NSScriptCommandDescription.m
src/NSUserNotification.m
)
# Includes ObjC headers -> must be compiled as ObjC

View File

@ -131,7 +131,6 @@
#import <Foundation/NSXMLNodeOptions.h>
#import <Foundation/NSURLDownload.h>
#import <Foundation/NSURLHandle.h>
#import <Foundation/NSUserNotificationCenter.h>
#endif

View File

@ -1 +1,34 @@
// TODO: NSUserNotification
/*
This file is part of Darling.
Copyright (C) 2019 Lubos Dolezel
Darling is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Darling 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.
You should have received a copy of the GNU General Public License
along with Darling. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Foundation/NSString.h>
@interface NSUserNotification : NSObject <NSCopying>
@end
@interface NSUserNotificationAction : NSObject <NSCopying>
@end
@interface NSUserNotificationCenter : NSObject
@end
@protocol NSUserNotificationCenterDelegate <NSObject>
@end
FOUNDATION_EXPORT NSString * const NSUserNotificationDefaultSoundName;

View File

@ -1,5 +0,0 @@
#import <Foundation/NSObject.h>
@interface NSUserNotificationCenter
@end

45
src/NSUserNotification.m Normal file
View File

@ -0,0 +1,45 @@
/*
This file is part of Darling.
Copyright (C) 2019 Lubos Dolezel
Darling is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Darling 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.
You should have received a copy of the GNU General Public License
along with Darling. If not, see <http://www.gnu.org/licenses/>.
*/
#import <Foundation/NSUserNotification.h>
@implementation NSUserNotification
- (id)copyWithZone:(NSZone *)zone
{
NSLog(@"[NSUserNotification copyWithZone:]");
return nil;
}
@end
@implementation NSUserNotificationAction
- (id)copyWithZone:(NSZone *)zone
{
NSLog(@"[NSUserNotificationAction copyWithZone:]");
return nil;
}
@end
@implementation NSUserNotificationCenter
@end
NSString * const NSUserNotificationDefaultSoundName = @"DefaultSoundName";

View File

@ -1,15 +0,0 @@
#import <Foundation/NSUserNotificationCenter.h>
#import <Foundation/NSMethodSignature.h>
#import <Foundation/NSInvocation.h>
@implementation NSUserNotificationCenter
- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector {
return [NSMethodSignature signatureWithObjCTypes: "v@:"];
}
- (void)forwardInvocation:(NSInvocation *)anInvocation {
NSLog(@"Stub called: %@ in %@", NSStringFromSelector([anInvocation selector]), [self class]);
}
@end