Merge branch 'master' into xib_document

# Conflicts:
#	ChangeLog
This commit is contained in:
fredkiefer 2020-01-07 21:27:20 +01:00
commit 14f88edfe8
15 changed files with 1380 additions and 6 deletions

View file

@ -22,6 +22,31 @@
* Source/GSXibParser.m,
* Source/GNUmakefile: Remove now obsolete class.
2020-01-07 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSDatePicker.h,
* Headers/AppKit/NSDatePickerCell.h,
* Source/NSDatePicker.m,
* Source/NSDatePickerCell.m: Small cleanup.
* Headers/AppKit/AppKit.h
* Headers/AppKit/NSPredicateEditor.h
* Headers/AppKit/NSPredicateEditorRowTemplate.h
* Headers/AppKit/NSRuleEditor.h
* Source/GNUmakefile
* Source/NSPredicateEditor.m
* Source/NSPredicateEditorRowTemplate.m
* Source/NSRuleEditor.m
* Source/externs.m: Add minimal version of predicate editor copied
over from mySTEP.
2020-01-06 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSDatePickerCell.h,
* Headers/AppKit/NSDatePicker.h,
* Source/NSDatePickerCell.m,
* Source/NSDatePicker.m: Add minimal version of date picker copied
over from mySTEP.
2019-12-29 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSBundleAdditions.m (-pathForNibResource:): Report type

View file

@ -147,6 +147,8 @@
#import <AppKit/NSClickGestureRecognizer.h>
#import <AppKit/NSColorPickerTouchBarItem.h>
#import <AppKit/NSCustomTouchBarItem.h>
#import <AppKit/NSDatePicker.h>
#import <AppKit/NSDatePickerCell.h>
#import <AppKit/NSDockTile.h>
#import <AppKit/NSDocument.h>
#import <AppKit/NSDocumentController.h>
@ -178,9 +180,12 @@
#import <AppKit/NSOutlineView.h>
#import <AppKit/NSParagraphStyle.h>
#import <AppKit/NSPickerTouchBarItem.h>
#import <AppKit/NSPredicateEditor.h>
#import <AppKit/NSPredicateEditorRowTemplate.h>
#import <AppKit/NSProgressIndicator.h>
#import <AppKit/NSPopoverTouchBarItem.h>
#import <AppKit/NSPressGestureRecognizer.h>
#import <AppKit/NSRuleEditor.h>
#import <AppKit/NSRulerMarker.h>
#import <AppKit/NSRulerView.h>
#import <AppKit/NSRotationGestureRecognizer.h>

View file

@ -0,0 +1,82 @@
/* -*-objc-*-
NSDatePicker.h
The date picker class
Copyright (C) 2020 Free Software Foundation, Inc.
Created by Dr. H. Nikolaus Schaller on Sat Jan 07 2006.
Copyright (c) 2005 DSITRI.
Author: Fabian Spillner
Date: 22. October 2007
Author: Fabian Spillner <fabian.spillner@gmail.com>
Date: 7. November 2007 - aligned with 10.5
This file is part of the GNUstep GUI 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; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _GNUstep_H_NSDatePicker
#define _GNUstep_H_NSDatePicker
#import <AppKit/NSControl.h>
#import <AppKit/NSDatePickerCell.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
@interface NSDatePicker : NSControl
- (NSColor *) backgroundColor;
- (NSCalendar *) calendar;
- (NSDatePickerElementFlags) datePickerElements;
- (NSDatePickerMode) datePickerMode;
- (NSDatePickerStyle) datePickerStyle;
- (NSDate *) dateValue;
- (id) delegate;
- (BOOL) drawsBackground;
- (BOOL) isBezeled;
- (BOOL) isBordered;
- (NSLocale *) locale;
- (NSDate *) maxDate;
- (NSDate *) minDate;
- (void) setBackgroundColor:(NSColor *) color;
- (void) setBezeled:(BOOL) flag;
- (void) setBordered:(BOOL) flag;
- (void) setCalendar:(NSCalendar *) calendar;
- (void) setDatePickerElements:(NSDatePickerElementFlags) flags;
- (void) setDatePickerMode:(NSDatePickerMode) mode;
- (void) setDatePickerStyle:(NSDatePickerStyle) style;
- (void) setDateValue:(NSDate *) date;
- (void) setDelegate:(id) obj; /* DOESNT EXIST IN API */
- (void) setDrawsBackground:(BOOL) flag;
- (void) setLocale:(NSLocale *) locale;
- (void) setMaxDate:(NSDate *) date;
- (void) setMinDate:(NSDate *) date;
- (void) setTextColor:(NSColor *) color;
- (void) setTimeInterval:(NSTimeInterval) interval;
- (void) setTimeZone:(NSTimeZone *) zone;
- (NSColor *) textColor;
- (NSTimeInterval) timeInterval;
- (NSTimeZone *) timeZone;
@end
#endif
#endif /* _GNUstep_H_NSDatePicker */

View file

@ -0,0 +1,120 @@
/* -*-objc-*-
NSDatePickerCell.h
The date picker cell class
Copyright (C) 2020 Free Software Foundation, Inc.
Created by Dr. H. Nikolaus Schaller on Sat Jan 07 2006.
Author: Fabian Spillner
Date: 22. October 2007
This file is part of the GNUstep GUI 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; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _GNUstep_H_NSDatePickerCell
#define _GNUstep_H_NSDatePickerCell
#import <AppKit/NSActionCell.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
enum {
NSTextFieldAndStepperDatePickerStyle = 0,
NSClockAndCalendarDatePickerStyle = 1,
NSTextFieldDatePickerStyle = 2
};
typedef NSUInteger NSDatePickerStyle;
enum {
NSSingleDateMode = 0,
NSRangeDateMode = 1
};
typedef NSUInteger NSDatePickerMode;
enum {
NSHourMinuteDatePickerElementFlag = 0x000c,
NSHourMinuteSecondDatePickerElementFlag = 0x000e,
NSTimeZoneDatePickerElementFlag = 0x0010,
NSYearMonthDatePickerElementFlag = 0x00c0,
NSYearMonthDayDatePickerElementFlag = 0x00e0,
NSEraDatePickerElementFlag = 0x0100,
};
typedef NSUInteger NSDatePickerElementFlags;
@class NSColor, NSDate, NSCalendar, NSLocale, NSTimeZone;
@interface NSDatePickerCell : NSActionCell
{
NSColor *_backgroundColor;
NSColor *_textColor;
NSDate *_maxDate;
NSDate *_minDate;
id _delegate;
NSTimeInterval _timeInterval;
// FIXME: pack into a bitfield?
NSDatePickerElementFlags _datePickerElements;
NSDatePickerMode _datePickerMode;
NSDatePickerStyle _datePickerStyle;
BOOL _drawsBackground;
}
- (NSColor *) backgroundColor;
- (NSCalendar *) calendar;
- (NSDatePickerElementFlags) datePickerElements;
- (NSDatePickerMode) datePickerMode;
- (NSDatePickerStyle) datePickerStyle;
- (NSDate *) dateValue;
- (id) delegate;
- (BOOL) drawsBackground;
- (NSLocale *) locale;
- (NSDate *) maxDate;
- (NSDate *) minDate;
- (void) setBackgroundColor:(NSColor *) color;
- (void) setCalendar:(NSCalendar *) calendar;
- (void) setDatePickerElements:(NSDatePickerElementFlags) flags;
- (void) setDatePickerMode:(NSDatePickerMode) mode;
- (void) setDatePickerStyle:(NSDatePickerStyle) style;
- (void) setDateValue:(NSDate *) date;
- (void) setDelegate:(id) obj;
- (void) setDrawsBackground:(BOOL) flag;
- (void) setLocale:(NSLocale *) locale;
- (void) setMaxDate:(NSDate *) date;
- (void) setMinDate:(NSDate *) date;
- (void) setTextColor:(NSColor *) color;
- (void) setTimeInterval:(NSTimeInterval) interval;
- (void) setTimeZone:(NSTimeZone *) zone;
- (NSColor *) textColor;
- (NSTimeInterval) timeInterval;
- (NSTimeZone *) timeZone;
@end
@interface NSObject (NSDataPickerCellDelegate)
- (void)datePickerCell:(NSDatePickerCell *) aDatePickerCell
validateProposedDateValue:(NSDate **) proposedDateValue
timeInterval:(NSTimeInterval *) proposedTimeInterval;
@end
#endif
#endif /* _GNUstep_H_NSDatePickerCell */

View file

@ -0,0 +1,48 @@
/* -*-objc-*-
NSPredicateEditor.h
The predicate editor class
Copyright (C) 2020 Free Software Foundation, Inc.
Created by Fabian Spillner on 03.12.07.
This file is part of the GNUstep GUI 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; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _GNUstep_H_NSPredicateEditor
#define _GNUstep_H_NSPredicateEditor
#import <AppKit/NSRuleEditor.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
@class NSArray;
@interface NSPredicateEditor : NSRuleEditor {
NSArray *_rowTemplates;
}
- (NSArray *) rowTemplates;
- (void) setRowTemplates: (NSArray *)templates;
@end
#endif
#endif /* _GNUstep_H_NSPredicateEditor */

View file

@ -0,0 +1,88 @@
/* -*-objc-*-
NSPredicateEditorRowTemplate.h
The template rows for the predicate editor
Copyright (C) 2020 Free Software Foundation, Inc.
Created by Fabian Spillner on 03.12.07.
This file is part of the GNUstep GUI 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; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _GNUstep_H_NSPredicateEditorRowTemplate
#define _GNUstep_H_NSPredicateEditorRowTemplate
#import <Foundation/Foundation.h>
@class NSPredicate, NSEntityDescription;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
/* CoreData Framework */
enum {
NSUndefinedAttributeType = 0,
NSInteger16AttributeType = 100,
NSInteger32AttributeType = 200,
NSInteger64AttributeType = 300,
NSDecimalAttributeType = 400,
NSDoubleAttributeType = 500,
NSFloatAttributeType = 600,
NSStringAttributeType = 700,
NSBooleanAttributeType = 800,
NSDateAttributeType = 900,
NSBinaryDataAttributeType = 1000
};
typedef NSUInteger NSAttributeType;
@interface NSPredicateEditorRowTemplate : NSObject {
}
+ (NSArray *) templatesWithAttributeKeyPaths: (NSArray *)paths
inEntityDescription: (NSEntityDescription *)entityDesc;
- (NSArray *) compoundTypes;
- (NSArray *) displayableSubpredicatesOfPredicate: (NSPredicate *)pred;
- (id) initWithCompoundTypes: (NSArray *)types;
- (id) initWithLeftExpressions: (NSArray *)leftExprs
rightExpressionAttributeType: (NSAttributeType)attrType
modifier: (NSComparisonPredicateModifier)modif
operators: (NSArray *)ops
options: (NSUInteger)opts;
- (id) initWithLeftExpressions: (NSArray *)leftExprs
rightExpressions: (NSArray *)rightExprs
modifier: (NSComparisonPredicateModifier)modif
operators: (NSArray *)ops
options: (NSUInteger)opts;
- (NSArray *) leftExpressions;
- (double) matchForPredicate: (NSPredicate *)pred;
- (NSComparisonPredicateModifier) modifier;
- (NSArray *) operators;
- (NSUInteger) options;
- (NSPredicate *) predicateWithSubpredicates: (NSArray *)subpred;
- (NSAttributeType) rightExpressionAttributeType;
- (NSArray *) rightExpressions;
- (void) setPredicate: (NSPredicate *)pred;
- (NSArray *) templateViews;
@end
#endif
#endif /* _GNUstep_H_NSPredicateEditorRowTemplate */

View file

@ -0,0 +1,140 @@
/* -*-objc-*-
NSRuleEditor.h
The rule editor class
Copyright (C) 2020 Free Software Foundation, Inc.
Created by Fabian Spillner on 03.12.07.
This file is part of the GNUstep GUI 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; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _GNUstep_H_NSRuleEditor
#define _GNUstep_H_NSRuleEditor
#import <AppKit/NSControl.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
enum {
NSRuleEditorNestingModeSingle,
NSRuleEditorNestingModeList,
NSRuleEditorNestingModeCompound,
NSRuleEditorNestingModeSimple
};
typedef NSUInteger NSRuleEditorNestingMode;
enum {
NSRuleEditorRowTypeSimple,
NSRuleEditorRowTypeCompound
};
typedef NSUInteger NSRuleEditorRowType;
extern NSString * const NSRuleEditorPredicateLeftExpression;
extern NSString * const NSRuleEditorPredicateRightExpression;
extern NSString * const NSRuleEditorPredicateComparisonModifier;
extern NSString * const NSRuleEditorPredicateOptions;
extern NSString * const NSRuleEditorPredicateOperatorType;
extern NSString * const NSRuleEditorPredicateCustomSelector;
extern NSString * const NSRuleEditorPredicateCompoundType;
extern NSString *NSRuleEditorRowsDidChangeNotification;
@interface NSRuleEditor : NSControl {
}
- (void) addRow: (id)sender;
- (BOOL) canRemoveAllRows;
- (NSArray *) criteriaForRow: (NSInteger)index;
- (NSString *) criteriaKeyPath;
- (id) delegate;
- (NSArray *) displayValuesForRow: (NSInteger)index;
- (NSString *) displayValuesKeyPath;
- (NSDictionary *) formattingDictionary;
- (NSString *) formattingStringsFilename;
- (void) insertRowAtIndex: (NSInteger)index
withType: (NSRuleEditorRowType)type
asSubrowOfRow: (NSInteger)row
animate: (BOOL)flag;
- (BOOL) isEditable;
- (NSRuleEditorNestingMode) nestingMode;
- (NSInteger) numberOfRows;
- (NSInteger) parentRowForRow: (NSInteger)row;
- (NSPredicate *) predicate;
- (NSPredicate *) predicateForRow: (NSInteger)row;
- (void) reloadCriteria;
- (void) reloadPredicate;
- (void) removeRowAtIndex: (NSInteger)index;
- (void) removeRowsAtIndexes: (NSIndexSet *)rowIds includeSubrows: (BOOL)flag;
- (Class) rowClass;
- (NSInteger) rowForDisplayValue: (id)value;
- (CGFloat) rowHeight;
- (NSRuleEditorRowType) rowTypeForRow: (NSInteger)row;
- (NSString *) rowTypeKeyPath;
- (NSIndexSet *) selectedRowIndexes;
- (void) selectRowIndexes: (NSIndexSet *)ids
byExtendingSelection: (BOOL)flag;
- (void) setCanRemoveAllRows: (BOOL)flag;
- (void) setCriteria: (NSArray *)crits
andDisplayValues: (NSArray *)vals
forRowAtIndex: (NSInteger)index;
- (void) setCriteriaKeyPath: (NSString *)path;
- (void) setDelegate: (id)delegate;
- (void) setDisplayValuesKeyPath: (NSString *)path;
- (void) setEditable: (BOOL)flag;
- (void) setFormattingDictionary: (NSDictionary *)dict;
- (void) setFormattingStringsFilename: (NSString *)filename;
- (void) setNestingMode: (NSRuleEditorNestingMode)flag;
- (void) setRowClass: (Class)rowClass;
- (void) setRowHeight: (CGFloat)height;
- (void) setRowTypeKeyPath: (NSString *)path;
- (void) setSubrowsKeyPath: (NSString *)path;
- (NSIndexSet *) subrowIndexesForRow: (NSInteger)row;
- (NSString *) subrowsKeyPath;
@end
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
@protocol NSRuleEditorDelegate
- (id) ruleEditor: (NSRuleEditor *)editor
child: (NSInteger)idx
forCriterion: (id)crit
withRowType: (NSRuleEditorRowType) type;
- (id) ruleEditor: (NSRuleEditor *)editor
displayValueForCriterion: (id)crit
inRow: (NSInteger)row;
- (NSInteger) ruleEditor: (NSRuleEditor *)editor
numberOfChildrenForCriterion: (id)crit
withRowType: (NSRuleEditorRowType)type;
- (NSDictionary *) ruleEditor: (NSRuleEditor *)editor
predicatePartsForCriterion: (id)crit
withDisplayValue: (id)val
inRow: (NSInteger)row;
- (void) ruleEditorRowsDidChange: (NSNotification *)notif;
@end
#endif
#endif /* _GNUstep_H_NSRuleEditor */

View file

@ -15,8 +15,6 @@ MISSING HEADERS
> NSCollectionViewTransitionLayout.h
> NSColorSampler.h
> NSDataAsset.h
> NSDatePicker.h
> NSDatePickerCell.h
> NSDictionaryController.h
> NSDiffableDataSource.h
> NSDraggingItem.h
@ -80,7 +78,7 @@ MISSING HEADERS
> NSWindowRestoration.h
> NSWindowTab.h
> NSWindowTabGroup.h
Total: 86
Total: 84
Completed
---

View file

@ -92,6 +92,8 @@ NSCustomTouchBarItem.m \
NSDataLink.m \
NSDataLinkManager.m \
NSDataLinkPanel.m \
NSDatePicker.m \
NSDatePickerCell.m \
NSDockTile.m \
NSDocument.m \
NSDocumentController.m \
@ -170,7 +172,6 @@ NSPanel.m \
NSPanGestureRecognizer.m \
NSPickerTouchBarItem.m \
NSPopoverTouchBarItem.m \
NSPressGestureRecognizer.m \
NSParagraphStyle.m \
NSPasteboardItem.m \
NSPDFInfo.m \
@ -180,6 +181,9 @@ NSPICTImageRep.m \
NSPopover.m \
NSPopUpButton.m \
NSPopUpButtonCell.m \
NSPredicateEditor.m \
NSPredicateEditorRowTemplate.m \
NSPressGestureRecognizer.m \
NSPrinter.m \
NSPrintInfo.m \
NSPrintOperation.m \
@ -187,6 +191,7 @@ NSPrintPanel.m \
NSProgressIndicator.m \
NSResponder.m \
NSRotationGestureRecognizer.m \
NSRuleEditor.m \
NSRulerMarker.m \
NSRulerView.m \
NSRunningApplication.m \
@ -373,6 +378,8 @@ NSCustomTouchBarItem.h \
NSDataLink.h \
NSDataLinkManager.h \
NSDataLinkPanel.h \
NSDatePicker.h \
NSDatePickerCell.h \
NSDockTile.h \
NSDocument.h \
NSDocumentController.h \
@ -433,6 +440,8 @@ NSPopoverTouchBarItem.h \
NSPopover.h \
NSPopUpButton.h \
NSPopUpButtonCell.h \
NSPredicateEditor.h \
NSPredicateEditorRowTemplate.h \
NSPressGestureRecognizer.h \
NSPrintInfo.h \
NSPrintOperation.h \
@ -441,6 +450,7 @@ NSPrinter.h \
NSProgressIndicator.h \
NSResponder.h \
NSRotationGestureRecognizer.h \
NSRuleEditor.h \
NSRulerMarker.h \
NSRulerView.h \
NSRunningApplication.h \

220
Source/NSDatePicker.m Normal file
View file

@ -0,0 +1,220 @@
/** <title>NSDatePicker</title>
<abstract>The date picker class</abstract>
Copyright (C) 2020 Free Software Foundation, Inc.
Author: Nikolaus Schaller <hns@computer.org>
Date: April 2006
Author: Fred Kiefer <fredkiefer@gmx.de>
Date: January 2020
This file is part of the GNUstep GUI 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; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#import <Foundation/NSString.h>
#import "AppKit/NSDatePickerCell.h"
#import "AppKit/NSDatePicker.h"
static id usedCellClass = nil;
@implementation NSDatePicker
+ (void) initialize
{
if (self == [NSDatePicker class])
{
[self setVersion: 1];
[self setCellClass: [NSDatePickerCell class]];
}
}
+ (Class) cellClass
{
return usedCellClass;
}
+ (void) setCellClass: (Class)cellClass
{
usedCellClass = cellClass;
}
- (NSColor *) backgroundColor
{
return [_cell backgroundColor];
}
- (NSCalendar *) calendar
{
return [_cell calendar];
}
- (NSDatePickerElementFlags) datePickerElements
{
return [_cell datePickerElements];
}
- (NSDatePickerMode) datePickerMode
{
return [_cell datePickerMode];
}
- (NSDatePickerStyle) datePickerStyle
{
return [_cell datePickerStyle];
}
- (NSDate *) dateValue
{
return [_cell dateValue];
}
- (id) delegate
{
return [_cell delegate];
}
- (BOOL) drawsBackground
{
return [_cell drawsBackground];
}
- (BOOL) isBezeled
{
return [_cell isBezeled];
}
- (BOOL) isBordered
{
return [_cell isBordered];
}
- (NSLocale *) locale
{
return [_cell locale];
}
- (NSDate *) maxDate
{
return [_cell maxDate];
}
- (NSDate *) minDate
{
return [_cell minDate];
}
- (void) setBackgroundColor: (NSColor *)color
{
[_cell setBackgroundColor: color];
}
- (void) setBezeled: (BOOL)flag
{
[_cell setBezeled: flag];
}
- (void) setBordered: (BOOL)flag
{
[_cell setBordered: flag];
}
- (void) setCalendar: (NSCalendar *)calendar
{
[_cell setCalendar: calendar];
}
- (void) setDatePickerElements: (NSDatePickerElementFlags)flags
{
[_cell setDatePickerElements: flags];
}
- (void) setDatePickerMode: (NSDatePickerMode)mode
{
[_cell setDatePickerMode: mode];
}
- (void) setDatePickerStyle: (NSDatePickerStyle)style
{
[_cell setDatePickerStyle: style];
}
- (void) setDateValue: (NSDate *)date
{
[_cell setDateValue: date];
}
- (void) setDelegate: (id)obj
{
[_cell setDelegate: obj];
}
- (void) setDrawsBackground: (BOOL)flag
{
[_cell setDrawsBackground: flag];
}
- (void) setLocale: (NSLocale *)locale
{
[_cell setLocale: locale];
}
- (void) setMaxDate: (NSDate *)date
{
[_cell setMaxDate: date];
}
- (void) setMinDate: (NSDate *)date
{
[_cell setMinDate: date];
}
- (void) setTextColor: (NSColor *)color
{
[_cell setTextColor: color];
}
- (void) setTimeInterval: (NSTimeInterval)interval
{
[_cell setTimeInterval: interval];
}
- (void) setTimeZone: (NSTimeZone *)zone
{
[_cell setTimeZone: zone];
}
- (NSColor *) textColor
{
return [_cell textColor];
}
- (NSTimeInterval) timeInterval
{
return [_cell timeInterval];
}
- (NSTimeZone *) timeZone
{
return [_cell timeZone];
}
@end

225
Source/NSDatePickerCell.m Normal file
View file

@ -0,0 +1,225 @@
/** <title>NSDatePickerCell</title>
<abstract>The date picker cell class</abstract>
Copyright (C) 2020 Free Software Foundation, Inc.
Author: Nikolaus Schaller <hns@computer.org>
Date: April 2006
Author: Fred Kiefer <fredkiefer@gmx.de>
Date: January 2020
This file is part of the GNUstep GUI 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; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#import <Foundation/NSString.h>
#import <Foundation/NSDateFormatter.h>
#import "AppKit/NSDatePickerCell.h"
#import "AppKit/NSColor.h"
@implementation NSDatePickerCell
- (id) initTextCell: (NSString*)aString
{
if ((self = [super initTextCell: aString]))
{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[self setFormatter: formatter];
RELEASE(formatter);
}
return self;
}
- (NSColor *) backgroundColor
{
return _backgroundColor;
}
- (void) setBackgroundColor: (NSColor *)color
{
ASSIGN(_backgroundColor, color);
}
- (NSCalendar *) calendar
{
return [[self formatter] calendar];
}
- (void) setCalendar: (NSCalendar *)calendar
{
[[self formatter] setCalendar: calendar];
}
- (NSDatePickerElementFlags) datePickerElements
{
return _datePickerElements;
}
- (void) setDatePickerElements: (NSDatePickerElementFlags)flags
{
_datePickerElements = flags;
}
- (NSDatePickerMode) datePickerMode
{
return _datePickerMode;
}
- (void) setDatePickerMode: (NSDatePickerMode)mode
{
_datePickerMode = mode;
}
- (NSDatePickerStyle) datePickerStyle
{
return _datePickerStyle;
}
- (void) setDatePickerStyle: (NSDatePickerStyle)style
{
_datePickerStyle = style;
}
- (NSDate *) dateValue
{
return (NSDate *)[self objectValue];
}
- (void) setDateValue: (NSDate *)date
{
[self setObjectValue: date];
}
- (id) delegate
{
return _delegate;
}
- (void) setDelegate: (id)obj
{
_delegate = obj;
}
- (BOOL) drawsBackground
{
return _drawsBackground;
}
- (void) setDrawsBackground: (BOOL)flag
{
_drawsBackground = flag;
}
- (NSLocale *) locale
{
return [[self formatter] locale];
}
- (void) setLocale: (NSLocale *)locale
{
[[self formatter] setLocale: locale];
}
- (NSDate *) maxDate
{
return _maxDate;
}
- (void) setMaxDate: (NSDate *)date
{
ASSIGN(_maxDate, date);
}
- (NSDate *) minDate
{
return _minDate;
}
- (void) setMinDate: (NSDate *)date
{
ASSIGN(_minDate, date);
}
- (NSColor *) textColor
{
return _textColor;
}
- (void) setTextColor: (NSColor *)color
{
ASSIGN(_textColor, color);
}
- (NSTimeInterval) timeInterval
{
return _timeInterval;
}
- (void) setTimeInterval: (NSTimeInterval)interval
{
_timeInterval = interval;
}
- (NSTimeZone *) timeZone
{
return [[self formatter] timeZone];
}
- (void) setTimeZone: (NSTimeZone *)zone
{
[[self formatter] setTimeZone: zone];
}
- (void) encodeWithCoder: (NSCoder *)aCoder
{
if ([aCoder allowsKeyedCoding])
{
[aCoder encodeDouble: [self timeInterval] forKey: @"NSTimeInterval"];
[aCoder encodeInt: [self datePickerElements] forKey: @"NSDatePickerElements"];
[aCoder encodeInt: [self datePickerStyle] forKey: @"NSDatePickerType"];
[aCoder encodeObject: [self backgroundColor] forKey: @"NSBackgroundColor"];
}
else
{
}
}
- (id) initWithCoder: (NSCoder *)aDecoder
{
if ((self = [super initWithCoder: aDecoder]))
{
if ([aDecoder allowsKeyedCoding])
{
[self setTimeInterval: [aDecoder decodeDoubleForKey: @"NSTimeInterval"]];
[self setDatePickerElements: [aDecoder decodeIntForKey: @"NSDatePickerElements"]];
[self setDatePickerStyle: [aDecoder decodeIntForKey: @"NSDatePickerType"]];
[self setBackgroundColor: [aDecoder decodeObjectForKey: @"NSBackgroundColor"]];
}
else
{
}
}
return self;
}
@end

View file

@ -0,0 +1,50 @@
/** <title>NSPredicateEditor</title>
<abstract>The predicate editor class</abstract>
Copyright (C) 2020 Free Software Foundation, Inc.
Author: Fred Kiefer <fredkiefer@gmx.de>
Date: January 2020
This file is part of the GNUstep GUI 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; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#import "AppKit/NSPredicateEditor.h"
@implementation NSPredicateEditor
- (void) dealloc
{
RELEASE(_rowTemplates);
[super dealloc];
}
- (NSArray *) rowTemplates
{
return _rowTemplates;
}
- (void) setRowTemplates: (NSArray *)templates
{
ASSIGN(_rowTemplates, templates);
}
@end

View file

@ -0,0 +1,121 @@
/** <title>NSPredicateEditorRowTemplate</title>
<abstract>The template rows for the predicate editor</abstract>
Copyright (C) 2020 Free Software Foundation, Inc.
Author: Fred Kiefer <fredkiefer@gmx.de>
Date: January 2020
This file is part of the GNUstep GUI 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; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#import "AppKit/NSPredicateEditorRowTemplate.h"
@implementation NSPredicateEditorRowTemplate
+ (NSArray *) templatesWithAttributeKeyPaths: (NSArray *)paths
inEntityDescription: (NSEntityDescription *)entityDesc
{
return nil;
}
- (NSArray *) compoundTypes
{
return nil;
}
- (NSArray *) displayableSubpredicatesOfPredicate: (NSPredicate *)pred
{
return nil;
}
- (id) initWithCompoundTypes: (NSArray *)types
{
return self;
}
- (id) initWithLeftExpressions: (NSArray *)leftExprs
rightExpressionAttributeType: (NSAttributeType)attrType
modifier: (NSComparisonPredicateModifier)modif
operators: (NSArray *)ops
options: (NSUInteger)opts;
{
return self;
}
- (id) initWithLeftExpressions: (NSArray *)leftExprs
rightExpressions: (NSArray *)rightExprs
modifier: (NSComparisonPredicateModifier)modif
operators: (NSArray *)ops
options: (NSUInteger)opts;
{
return self;
}
- (NSArray *) leftExpressions
{
return nil;
}
- (double) matchForPredicate: (NSPredicate *)pred
{
return 0.0;
}
- (NSComparisonPredicateModifier) modifier
{
return NSDirectPredicateModifier;
}
- (NSArray *) operators
{
return nil;
}
- (NSUInteger) options
{
return 0;
}
- (NSPredicate *) predicateWithSubpredicates: (NSArray *)subpred
{
return nil;
}
- (NSAttributeType) rightExpressionAttributeType
{
return 0;
}
- (NSArray *) rightExpressions
{
return nil;
}
- (void) setPredicate: (NSPredicate *)pred
{
}
- (NSArray *) templateViews
{
return nil;
}
@end

233
Source/NSRuleEditor.m Normal file
View file

@ -0,0 +1,233 @@
/** <title>NSRuleEditor</title>
<abstract>The rule editor class</abstract>
Copyright (C) 2020 Free Software Foundation, Inc.
Author: Fred Kiefer <fredkiefer@gmx.de>
Date: January 2020
This file is part of the GNUstep GUI 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; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#import "AppKit/NSRuleEditor.h"
@implementation NSRuleEditor
- (void) addRow: (id)sender
{
}
- (BOOL) canRemoveAllRows
{
return YES;
}
- (NSArray *) criteriaForRow: (NSInteger)index
{
return nil;
}
- (NSString *) criteriaKeyPath
{
return nil;
}
- (id) delegate
{
return nil;
}
- (NSArray *) displayValuesForRow: (NSInteger)index
{
return nil;
}
- (NSString *) displayValuesKeyPath
{
return nil;
}
- (NSDictionary *) formattingDictionary
{
return nil;
}
- (NSString *) formattingStringsFilename
{
return nil;
}
- (void) insertRowAtIndex: (NSInteger)index
withType: (NSRuleEditorRowType)type
asSubrowOfRow: (NSInteger)row
animate: (BOOL)flag
{
}
- (BOOL) isEditable
{
return YES;
}
- (NSRuleEditorNestingMode) nestingMode
{
return NSRuleEditorNestingModeSingle;
}
- (NSInteger) numberOfRows
{
return 0;
}
- (NSInteger) parentRowForRow: (NSInteger)row
{
return 0;
}
- (NSPredicate *) predicate
{
return nil;
}
- (NSPredicate *) predicateForRow: (NSInteger)row
{
return nil;
}
- (void) reloadCriteria
{
}
- (void) reloadPredicate
{
}
- (void) removeRowAtIndex: (NSInteger)index
{
}
- (void) removeRowsAtIndexes: (NSIndexSet *)rowIds includeSubrows: (BOOL)flag
{
}
- (Class) rowClass
{
return nil;
}
- (NSInteger) rowForDisplayValue: (id)value
{
return 0;
}
- (CGFloat) rowHeight
{
return 0.0;
}
- (NSRuleEditorRowType) rowTypeForRow: (NSInteger)row
{
return NSRuleEditorRowTypeSimple;
}
- (NSString *) rowTypeKeyPath
{
return nil;
}
- (NSIndexSet *) selectedRowIndexes
{
return nil;
}
- (void) selectRowIndexes: (NSIndexSet *)ids
byExtendingSelection: (BOOL)flag
{
}
- (void) setCanRemoveAllRows: (BOOL)flag
{
}
- (void) setCriteria: (NSArray *)crits
andDisplayValues: (NSArray *)vals
forRowAtIndex: (NSInteger)index
{
}
- (void) setCriteriaKeyPath: (NSString *)path
{
}
- (void) setDelegate: (id)delegate
{
}
- (void) setDisplayValuesKeyPath: (NSString *)path
{
}
- (void) setEditable: (BOOL)flag
{
}
- (void) setFormattingDictionary: (NSDictionary *)dict
{
}
- (void) setFormattingStringsFilename: (NSString *)filename
{
}
- (void) setNestingMode: (NSRuleEditorNestingMode)flag
{
}
- (void) setRowClass: (Class)rowClass
{
}
- (void) setRowHeight: (CGFloat)height
{
}
- (void) setRowTypeKeyPath: (NSString *)path
{
}
- (void) setSubrowsKeyPath: (NSString *)path
{
}
- (NSIndexSet *) subrowIndexesForRow: (NSInteger)row
{
return nil;
}
- (NSString *) subrowsKeyPath
{
return nil;
}
- (void) viewDidMoveToWindow
{
}
@end

View file

@ -785,6 +785,17 @@ NSString *NSImageNameFontPanel = @"NSFontPanel";
NSString *NSImageNameColorPanel = @"NSColorPanel";
NSString *NSImageNameCaution = @"NSCaution";
// NSRuleEditor
NSString *const NSRuleEditorPredicateLeftExpression = @"NSRuleEditorPredicateLeftExpression";
NSString *const NSRuleEditorPredicateRightExpression = @"NSRuleEditorPredicateRightExpression";
NSString *const NSRuleEditorPredicateComparisonModifier = @"NSRuleEditorPredicateComparisonModifier";
NSString *const NSRuleEditorPredicateOptions = @"NSRuleEditorPredicateOptions";
NSString *const NSRuleEditorPredicateOperatorType = @"NSRuleEditorPredicateOperatorType";
NSString *const NSRuleEditorPredicateCustomSelector = @"NSRuleEditorPredicateCustomSelector";
NSString *const NSRuleEditorPredicateCompoundType = @"NSRuleEditorPredicateCompoundType";
NSString *NSRuleEditorRowsDidChangeNotification = @"NSRuleEditorRowsDidChangeNotification";
extern void __objc_gui_force_linking (void);
void
@ -793,5 +804,3 @@ __objc_gui_force_linking (void)
extern void __objc_gui_linking (void);
__objc_gui_linking ();
}