More initial work.

This commit is contained in:
Gregory John Casamento 2020-04-16 11:42:21 -04:00
parent ea5dbc2236
commit 8785a1307b
5 changed files with 31 additions and 16 deletions

View file

@ -216,6 +216,7 @@
#import <AppKit/NSStepperTouchBarItem.h>
#import <AppKit/NSStepper.h>
#import <AppKit/NSStepperCell.h>
#import <AppKit/NSSwitch.h>
#import <AppKit/NSTableColumn.h>
#import <AppKit/NSTableHeaderCell.h>
#import <AppKit/NSTableHeaderView.h>

View file

@ -123,6 +123,16 @@ enum {
};
typedef NSUInteger NSCellStateValue;
/*
* Control state values as of 10.13
*/
enum {
NSControlStateValueMixed = -1,
NSControlStateValueOff = 0,
NSControlStateValueOn = 1
};
typedef NSUInteger NSControlStateValue;
/**
* <p>Enumeration of the ways that you can display an image in an
* NSImageCell. The available ones are:</p>

View file

@ -26,15 +26,22 @@
#define _NSSwitch_h_GNUSTEP_GUI_INCLUDE
#import <AppKit/NSControl.h>
#import <AppKit/NSCell.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_0, GS_API_LATEST)
#if OS_API_VERSION(MAC_OS_X_VERSION_10_15, GS_API_LATEST)
#if defined(__cplusplus)
extern "C" {
#endif
@interface NSSwitch : NSControl
{
NSControlStateValue _state;
}
- (void) setState: (NSControlStateValue)s;
- (NSControlStateValue) state;
@end
#if defined(__cplusplus)

View file

@ -122,6 +122,7 @@ NSRotationGestureRecognizer.m \
NSSharingServicePickerTouchBarItem.m \
NSSliderTouchBarItem.m \
NSStepperTouchBarItem.m \
NSSwitch.m \
NSTouch.m \
NSTouchBar.m \
NSTouchBarItem.m \
@ -506,6 +507,7 @@ NSStepperTouchBarItem.h \
NSStringDrawing.h \
NSStatusBar.h \
NSStatusItem.h \
NSSwitch.h \
NSTabView.h \
NSTabViewItem.h \
NSTableColumn.h \

View file

@ -1,5 +1,5 @@
/* Implementation of class NSSwitch
Copyright (C) 2019 Free Software Foundation, Inc.
Copyright (C) 2020 Free Software Foundation, Inc.
By: Gregory John Casamento
Date: Wed Apr 8 22:01:02 EDT 2020
@ -9,7 +9,7 @@
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.
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
@ -25,14 +25,6 @@
#import <AppKit/NSSwitch.h>
#import <AppKit/NSActionCell.h>
static id switchCellClass = nil;
@interface GSSwitchCell : NSActionCell
@end
@implementation GSSwitchCell
@end
@implementation NSSwitch
+ (void) initialize
@ -40,20 +32,23 @@ static id switchCellClass = nil;
if (self == [NSSwitch class])
{
[self setVersion: 1];
[self setCellClass: [GSSwitchCell class]];
}
}
+ (Class) cellClass
- (void) setState: (NSControlStateValue)s
{
return switchCellClass;
_state = s;
[self setNeedsDisplay];
}
+ (void) setCellClass: (Class)clz
- (NSControlStateValue) state
{
switchCellClass = clz;
return _state;
}
- (void) drawRect: (NSRect)rect
{
}
@end