Add NSwitch initial changes

This commit is contained in:
Gregory John Casamento 2020-04-13 14:15:07 -04:00
parent 928e44b65c
commit f989474735
2 changed files with 106 additions and 0 deletions

47
Headers/AppKit/NSSwitch.h Normal file
View file

@ -0,0 +1,47 @@
/* Definition of class NSSwitch
Copyright (C) 2020 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: Wed Apr 8 22:01:02 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
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.
*/
#ifndef _NSSwitch_h_GNUSTEP_GUI_INCLUDE
#define _NSSwitch_h_GNUSTEP_GUI_INCLUDE
#import <AppKit/NSControl.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_0, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {
#endif
@interface NSSwitch : NSControl
@end
#if defined(__cplusplus)
}
#endif
#endif /* GS_API_MACOSX */
#endif /* _NSSwitch_h_GNUSTEP_GUI_INCLUDE */

59
Source/NSSwitch.m Normal file
View file

@ -0,0 +1,59 @@
/* Implementation of class NSSwitch
Copyright (C) 2019 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: Wed Apr 8 22:01:02 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 <AppKit/NSSwitch.h>
#import <AppKit/NSActionCell.h>
static id switchCellClass = nil;
@interface GSSwitchCell : NSActionCell
@end
@implementation GSSwitchCell
@end
@implementation NSSwitch
+ (void) initialize
{
if (self == [NSSwitch class])
{
[self setVersion: 1];
[self setCellClass: [GSSwitchCell class]];
}
}
+ (Class) cellClass
{
return switchCellClass;
}
+ (void) setCellClass: (Class)clz
{
switchCellClass = clz;
}
@end