diff --git a/ChangeLog b/ChangeLog index 48ca7c1eb..dcbbdb49a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,44 @@ +2001-03-08 Richard Frith-Macdonald + + * Headers/gnustep/base/NSCalendarDate.h: + * Headers/gnustep/base/NSTimeZone.h: New files for MacOS-X compatibility + * Headers/gnustep/base/Foundation.h: Add NSCalendarDate and NSTimeZone + * Headers/gnustep/base/NSDate.h: Remove info in new files. + * Source/GNUmakefile: Add new NSCalendarDate and NSTimeZone files. + * Source/NSCalendarDate.m: Update for header changes. + * Source/NSDate.m: ditto + * Source/NSDateFormatter.m: ditto + * Source/NSLog.m: ditto + * Source/NSString.m: ditto + * Source/NSTimeZone.m: ditto + +2001-03-06 Adam Fedor + + * Source/libgnustep-base.def: Regenerate. + +2001-03-05 Richard Frith-Macdonald + + * Source/NSUserDefaults.m: Changed ([+setUserLanguages:]) to use + NSLanguages. + * Documentation/gsdoc/NSUserDefaults.gsdoc: documented the + ([+setUserlanguages:]) method. + +2001-03-04 Jonathan Gapen + + * Documentation/gsdoc/NSCharacterSet.gsdoc: Documented some methods. + * Headers/gnustep/unicode/caseconv.h: Updated case-mapping tables. + * Source/NSBitmapCharSet.m: Added sanity check to initWithBitmap: + * Source/Unicode.m: Changed uni_toupper() and uni_tolower() to use + direct lookup in two-level tables, rather than a linear search. + +2001-03-03 Richard Frith-Macdonald + + * Source/NSBundle.m: Corrected + ([-_bundleResourcePathsWithRootPath:subPath:]) to use + ([NSUserDefaults +userLanguages]) to get language array again. + * Documentation/gsdoc/NSUserDefaults.gsdoc: Updated and added + information about +userLanguages + 2001-03-07 Adam Fedor * Source/NSInvocation.m (-initWithTarget:selector:): Correct copying diff --git a/Documentation/gsdoc/NSCalendarDate.gsdoc b/Documentation/gsdoc/NSCalendarDate.gsdoc index 09ed2a74b..c72d44558 100644 --- a/Documentation/gsdoc/NSCalendarDate.gsdoc +++ b/Documentation/gsdoc/NSCalendarDate.gsdoc @@ -14,7 +14,7 @@ NSCalendarDate - Foundation/NSDate.h + Foundation/NSCalendarDate.h NSCoding diff --git a/Headers/gnustep/base/Foundation.h b/Headers/gnustep/base/Foundation.h index d9149da87..e36ddec14 100644 --- a/Headers/gnustep/base/Foundation.h +++ b/Headers/gnustep/base/Foundation.h @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -80,6 +81,7 @@ #include #include #include +#include #include #include #include diff --git a/Headers/gnustep/base/NSCalendarDate.h b/Headers/gnustep/base/NSCalendarDate.h new file mode 100644 index 000000000..dd8cc4038 --- /dev/null +++ b/Headers/gnustep/base/NSCalendarDate.h @@ -0,0 +1,137 @@ +/* Interface for NSCalendarDate for GNUStep + Copyright (C) 1994, 1996, 1999 Free Software Foundation, Inc. + + This file is part of the GNUstep Base Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + */ + +#ifndef __NSCalendarDate_h_GNUSTEP_BASE_INCLUDE +#define __NSCalendarDate_h_GNUSTEP_BASE_INCLUDE + +#include + +@class NSTimeZone; +@class NSTimeZoneDetail; + +@interface NSCalendarDate : NSDate +{ + NSTimeInterval _seconds_since_ref; + NSString *_calendar_format; + NSTimeZone *_time_zone; +} + +// Getting an NSCalendar Date ++ (id) calendarDate; ++ (id) dateWithString: (NSString*)description + calendarFormat: (NSString*)format; ++ (id) dateWithString: (NSString*)description + calendarFormat: (NSString*)format + locale: (NSDictionary*)dictionary; ++ (id) dateWithYear: (int)year + month: (unsigned int)month + day: (unsigned int)day + hour: (unsigned int)hour + minute: (unsigned int)minute + second: (unsigned int)second + timeZone: (NSTimeZone*)aTimeZone; + +// Initializing an NSCalendar Date +- (id) initWithString: (NSString*)description; +- (id) initWithString: (NSString*)description + calendarFormat: (NSString*)format; +- (id) initWithString: (NSString*)description + calendarFormat: (NSString*)format + locale: (NSDictionary*)dictionary; +- (id) initWithYear: (int)year + month: (unsigned int)month + day: (unsigned int)day + hour: (unsigned int)hour + minute: (unsigned int)minute + second: (unsigned int)second + timeZone: (NSTimeZone*)aTimeZone; + +// Retreiving Date Elements +- (int) dayOfCommonEra; +- (int) dayOfMonth; +- (int) dayOfWeek; +- (int) dayOfYear; +- (int) hourOfDay; +- (int) minuteOfHour; +- (int) monthOfYear; +- (int) secondOfMinute; +- (int) yearOfCommonEra; + +// Providing Adjusted Dates +- (NSCalendarDate*) addYear: (int)year + month: (int)month + day: (int)day + hour: (int)hour + minute: (int)minute + second: (int)second; + +// Getting String Descriptions of Dates +- (NSString*) description; +- (NSString*) descriptionWithCalendarFormat: (NSString*)format; +- (NSString*) descriptionWithCalendarFormat: (NSString*)format + locale: (NSDictionary*)locale; +- (NSString*) descriptionWithLocale: (NSDictionary*)locale; + +// Getting and Setting Calendar Formats +- (NSString*) calendarFormat; +- (void) setCalendarFormat: (NSString*)format; + +// Getting and Setting Time Zones +- (void) setTimeZone: (NSTimeZone*)aTimeZone; +#ifndef STRICT_OPENSTEP +- (NSTimeZone*) timeZone; +#endif +#ifndef STRICT_MACOS_X +- (NSTimeZoneDetail*) timeZoneDetail; +#endif + +@end + + +@interface NSCalendarDate (GregorianDate) + +- (int) lastDayOfGregorianMonth: (int)month year: (int)year; +- (int) absoluteGregorianDay: (int)day month: (int)month year: (int)year; +- (void) gregorianDateFromAbsolute: (int)d + day: (int*)day + month: (int*)month + year: (int*)year; + +@end + +@interface NSCalendarDate (OPENSTEP) + +- (NSCalendarDate*) dateByAddingYears: (int)years + months: (int)months + days: (int)days + hours: (int)hours + minutes: (int)minutes + seconds: (int)seconds; + +- (void) years: (int*)years + months: (int*)months + days: (int*)days + hours: (int*)hours + minutes: (int*)minutes + seconds: (int*)seconds + sinceDate: (NSDate*)date; +@end + +#endif /* __NSCalendarDate_h_GNUSTEP_BASE_INCLUDE*/ diff --git a/Headers/gnustep/base/NSDate.h b/Headers/gnustep/base/NSDate.h index 49f93b15d..aac87a314 100644 --- a/Headers/gnustep/base/NSDate.h +++ b/Headers/gnustep/base/NSDate.h @@ -111,176 +111,4 @@ NSTimeInterval GSTimeNow(); /* Get time since reference date*/ NSTimeInterval GSTime(int d, int m, int y, int hh, int mm, int ss, int mil); #endif - - -@interface NSTimeZone : NSObject - -//Creating and Initializing an NSTimeZone -+ (NSTimeZone*) localTimeZone; -+ (NSTimeZone*) timeZoneForSecondsFromGMT: (int)seconds; -+ (NSTimeZone*) timeZoneWithName: (NSString*)aTimeZoneName; - -//Managing Time Zones -+ (void) setDefaultTimeZone: (NSTimeZone*)aTimeZone; - -// Getting Time Zone Information -+ (NSDictionary*) abbreviationDictionary; - -//Getting Arrays of Time Zones -+ (NSArray*) timeZoneArray; -- (NSArray*) timeZoneDetailArray; - -#ifndef NO_GNUSTEP -/* Returns an dictionary that maps abbreviations to the array - containing all the time zone names that use the abbreviation. */ -+ (NSDictionary*) abbreviationMap; -#endif - -#ifndef STRICT_OPENSTEP -+ (void) resetSystemTimeZone; -+ (NSTimeZone*) systemTimeZone; -+ (NSTimeZone*) timeZoneWithName: (NSString*)name data: (NSData*)data; -- (NSString*) abbreviation; -- (NSString*) abbreviationForDate: (NSDate*)aDate; -- (id) initWithName: (NSString*)name; -- (id) initWithName: (NSString*)name data: (NSData*)data; -- (BOOL) isDaylightSavingTime; -- (BOOL) isDaylightSavingTimeForDate: (NSDate*)aDate; -- (BOOL) isEqualToTimeZone: (NSTimeZone*)aTimeZone; -- (NSString*) name; -- (int) secondsFromGMT; -- (int) secondsFromGMTForDate: (NSDate*)aDate; -#endif - -#ifndef STRICT_MACOS_X -- (NSTimeZoneDetail*) timeZoneDetailForDate: (NSDate*)date; -- (NSString*) timeZoneName; -#endif - -/* - * The next two methods are a problem ... they are present in both - * OpenStep and MacOS-X, but return different types! - * We resort to the MaxOS-X version. - */ -+ (NSTimeZone*) defaultTimeZone; -+ (NSTimeZone*) timeZoneWithAbbreviation: (NSString*)abbreviation; -@end - -#ifndef STRICT_MACOS_X -@interface NSTimeZoneDetail : NSTimeZone -- (BOOL) isDaylightSavingTimeZone; -- (NSString*) timeZoneAbbreviation; -- (int) timeZoneSecondsFromGMT; -@end -#endif - - -@interface NSCalendarDate : NSDate -{ - NSTimeInterval _seconds_since_ref; - NSString *_calendar_format; - NSTimeZone *_time_zone; -} - -// Getting an NSCalendar Date -+ (id) calendarDate; -+ (id) dateWithString: (NSString*)description - calendarFormat: (NSString*)format; -+ (id) dateWithString: (NSString*)description - calendarFormat: (NSString*)format - locale: (NSDictionary*)dictionary; -+ (id) dateWithYear: (int)year - month: (unsigned int)month - day: (unsigned int)day - hour: (unsigned int)hour - minute: (unsigned int)minute - second: (unsigned int)second - timeZone: (NSTimeZone*)aTimeZone; - -// Initializing an NSCalendar Date -- (id) initWithString: (NSString*)description; -- (id) initWithString: (NSString*)description - calendarFormat: (NSString*)format; -- (id) initWithString: (NSString*)description - calendarFormat: (NSString*)format - locale: (NSDictionary*)dictionary; -- (id) initWithYear: (int)year - month: (unsigned int)month - day: (unsigned int)day - hour: (unsigned int)hour - minute: (unsigned int)minute - second: (unsigned int)second - timeZone: (NSTimeZone*)aTimeZone; - -// Retreiving Date Elements -- (int) dayOfCommonEra; -- (int) dayOfMonth; -- (int) dayOfWeek; -- (int) dayOfYear; -- (int) hourOfDay; -- (int) minuteOfHour; -- (int) monthOfYear; -- (int) secondOfMinute; -- (int) yearOfCommonEra; - -// Providing Adjusted Dates -- (NSCalendarDate*) addYear: (int)year - month: (int)month - day: (int)day - hour: (int)hour - minute: (int)minute - second: (int)second; - -// Getting String Descriptions of Dates -- (NSString*) description; -- (NSString*) descriptionWithCalendarFormat: (NSString*)format; -- (NSString*) descriptionWithCalendarFormat: (NSString*)format - locale: (NSDictionary*)locale; -- (NSString*) descriptionWithLocale: (NSDictionary*)locale; - -// Getting and Setting Calendar Formats -- (NSString*) calendarFormat; -- (void) setCalendarFormat: (NSString*)format; - -// Getting and Setting Time Zones -- (void) setTimeZone: (NSTimeZone*)aTimeZone; -#ifndef STRICT_OPENSTEP -- (NSTimeZone*) timeZone; -#endif -#ifndef STRICT_MACOS_X -- (NSTimeZoneDetail*) timeZoneDetail; -#endif - -@end - - -@interface NSCalendarDate (GregorianDate) - -- (int) lastDayOfGregorianMonth: (int)month year: (int)year; -- (int) absoluteGregorianDay: (int)day month: (int)month year: (int)year; -- (void) gregorianDateFromAbsolute: (int)d - day: (int*)day - month: (int*)month - year: (int*)year; - -@end - -@interface NSCalendarDate (OPENSTEP) - -- (NSCalendarDate*) dateByAddingYears: (int)years - months: (int)months - days: (int)days - hours: (int)hours - minutes: (int)minutes - seconds: (int)seconds; - -- (void) years: (int*)years - months: (int*)months - days: (int*)days - hours: (int*)hours - minutes: (int*)minutes - seconds: (int*)seconds - sinceDate: (NSDate*)date; -@end - #endif /* __NSDate_h_GNUSTEP_BASE_INCLUDE*/ diff --git a/Headers/gnustep/base/NSTimeZone.h b/Headers/gnustep/base/NSTimeZone.h new file mode 100644 index 000000000..e4942fe6b --- /dev/null +++ b/Headers/gnustep/base/NSTimeZone.h @@ -0,0 +1,93 @@ +/* Interface for NSTimeZone for GNUStep + Copyright (C) 1994, 1996, 1999 Free Software Foundation, Inc. + + This file is part of the GNUstep Base Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + */ + +#ifndef __NSTimeZone_h_GNUSTEP_BASE_INCLUDE +#define __NSTimeZone_h_GNUSTEP_BASE_INCLUDE + +#include + +@class NSArray; +@class NSDate; +@class NSDictionary; +@class NSString; + +@interface NSTimeZone : NSObject + +//Creating and Initializing an NSTimeZone ++ (NSTimeZone*) localTimeZone; ++ (NSTimeZone*) timeZoneForSecondsFromGMT: (int)seconds; ++ (NSTimeZone*) timeZoneWithName: (NSString*)aTimeZoneName; + +//Managing Time Zones ++ (void) setDefaultTimeZone: (NSTimeZone*)aTimeZone; + +// Getting Time Zone Information ++ (NSDictionary*) abbreviationDictionary; + +//Getting Arrays of Time Zones ++ (NSArray*) timeZoneArray; +- (NSArray*) timeZoneDetailArray; + +#ifndef NO_GNUSTEP +/* Returns an dictionary that maps abbreviations to the array + containing all the time zone names that use the abbreviation. */ ++ (NSDictionary*) abbreviationMap; +#endif + +#ifndef STRICT_OPENSTEP ++ (void) resetSystemTimeZone; ++ (NSTimeZone*) systemTimeZone; ++ (NSTimeZone*) timeZoneWithName: (NSString*)name data: (NSData*)data; +- (NSString*) abbreviation; +- (NSString*) abbreviationForDate: (NSDate*)aDate; +- (id) initWithName: (NSString*)name; +- (id) initWithName: (NSString*)name data: (NSData*)data; +- (BOOL) isDaylightSavingTime; +- (BOOL) isDaylightSavingTimeForDate: (NSDate*)aDate; +- (BOOL) isEqualToTimeZone: (NSTimeZone*)aTimeZone; +- (NSString*) name; +- (int) secondsFromGMT; +- (int) secondsFromGMTForDate: (NSDate*)aDate; +#endif + +#ifndef STRICT_MACOS_X +- (NSTimeZoneDetail*) timeZoneDetailForDate: (NSDate*)date; +- (NSString*) timeZoneName; +#endif + +/* + * The next two methods are a problem ... they are present in both + * OpenStep and MacOS-X, but return different types! + * We resort to the MaxOS-X version. + */ ++ (NSTimeZone*) defaultTimeZone; ++ (NSTimeZone*) timeZoneWithAbbreviation: (NSString*)abbreviation; +@end + +#ifndef STRICT_MACOS_X +@interface NSTimeZoneDetail : NSTimeZone +- (BOOL) isDaylightSavingTimeZone; +- (NSString*) timeZoneAbbreviation; +- (int) timeZoneSecondsFromGMT; +@end +#endif + +#endif /* __NSTimeZone_h_GNUSTEP_BASE_INCLUDE*/ + diff --git a/Source/GNUmakefile b/Source/GNUmakefile index f7bad9b42..a526b5b86 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -276,6 +276,7 @@ NSAutoreleasePool.h \ NSBitmapCharSet.h \ NSBundle.h \ NSByteOrder.h \ +NSCalendarDate.h \ NSCharacterSet.h \ NSClassDescription.h \ NSCoder.h \ @@ -326,6 +327,7 @@ NSSet.h \ NSString.h \ NSTask.h \ NSThread.h \ +NSTimeZone.h \ NSTimer.h \ NSUndoManager.h \ NSUserDefaults.h \ diff --git a/Source/NSCalendarDate.m b/Source/NSCalendarDate.m index 1676dd7f3..cdf66cd25 100644 --- a/Source/NSCalendarDate.m +++ b/Source/NSCalendarDate.m @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/Source/NSDate.m b/Source/NSDate.m index a98eaae4f..3dc667bee 100644 --- a/Source/NSDate.m +++ b/Source/NSDate.m @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/Source/NSDateFormatter.m b/Source/NSDateFormatter.m index 1df56888b..e273c6cad 100644 --- a/Source/NSDateFormatter.m +++ b/Source/NSDateFormatter.m @@ -23,6 +23,8 @@ #include #include +#include +#include #include #include #include diff --git a/Source/NSLog.m b/Source/NSLog.m index 7cf18ec23..5d9c621c2 100644 --- a/Source/NSLog.m +++ b/Source/NSLog.m @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/Source/NSString.m b/Source/NSString.m index e780db9f6..2563e4a28 100644 --- a/Source/NSString.m +++ b/Source/NSString.m @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include diff --git a/Source/NSTimeZone.m b/Source/NSTimeZone.m index 40dee422b..425b18e1a 100644 --- a/Source/NSTimeZone.m +++ b/Source/NSTimeZone.m @@ -65,6 +65,7 @@ #include #include #include +#include #include #define NOID