diff --git a/ChangeLog b/ChangeLog index 6f27f9707..420575627 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +Tue Mar 4 09:28:57 1997 GNUstep Development + + * Headers/gnustep/gui/NSEvent.h: Include needed header file. + * Headers/gnustep/gui/NSNibLoading.h: Likewise. + * Headers/gnustep/gui/NSPasteboard.h: Likewise. + * Headers/gnustep/gui/NSSpellServer.h: Likewise. + + * Remove internal NSLog() implementation. + * Source/Functions.m: Remove file. + * Headers/gnustep/gui/LogFile.h: Remove file. + * Headers/gnustep/gui/NSWindow.h: Remove include file. + * Source/LogFile.m: Remove file. + * Source/NSActionCell.m: Remove include file. + * Source/NSApplication.m: Likewise. + * Source/NSButton.m: Likewise. + * Source/NSCell.m: Likewise. + * Source/NSControl.m: Likewise. + * Source/NSEvent.m: Likewise. + * Source/NSFontManager.m: Likewise. + * Source/NSResponder.m: Likewise. + * Source/tiff.m: Likewise. + * Source/Makefile.in: Remove LogFile.h and LogFile.m. + + * Source/NSFont.m (getFont): Return font not font name. + Mon Feb 17 19:30:50 1997 Ovidiu Predescu * Source/NSButton.m: New methods -setAlignment: and -alignment, diff --git a/Headers/gnustep/gui/LogFile.h b/Headers/gnustep/gui/LogFile.h deleted file mode 100644 index cf4c61a60..000000000 --- a/Headers/gnustep/gui/LogFile.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - LogFile.h - - Logfile for recording trace messages - - Copyright (C) 1996 Free Software Foundation, Inc. - - Author: Scott Christley - Date: 1996 - - This file is part of the GNUstep Application 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; see the file COPYING.LIB. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef _GNUstep_H_LogFile -#define _GNUstep_H_LogFile - -#include -#include - -@interface LogFile : NSObject - -{ - // Attributes - struct _MB_lflags - { - unsigned int is_locking:1; - unsigned int is_date_logging:1; - } l_flags; - FILE *the_log; -} - -// -// Call one of these to initialize the log file and open a stream -// to the standard output or a file. -// -// -init does not open a file -- init; -- initStdout; -- initStdoutWithLocking; -- initFile:(const char *)filename; -- initFileWithLocking:(const char *)filename; - -// Instance methods -- writeLog:(const char *)logEntry; -- closeLog; -- (BOOL)isDateLogging; -- setDateLogging:(BOOL)flag; -- (BOOL)isLocking; - -@end - -#ifdef DEBUGLOG -#define NSDebugLog(format, args...) NSLog(format, ## args) -#else -#define NSDebugLog(format, args...) -#endif - -#endif // _GNUstep_H_LogFile diff --git a/Headers/gnustep/gui/NSEvent.h b/Headers/gnustep/gui/NSEvent.h index d99697be6..cf0675bc5 100644 --- a/Headers/gnustep/gui/NSEvent.h +++ b/Headers/gnustep/gui/NSEvent.h @@ -31,6 +31,7 @@ #include #include +#include @class NSString; diff --git a/Headers/gnustep/gui/NSNibLoading.h b/Headers/gnustep/gui/NSNibLoading.h index 915a4c960..eec2bcdbc 100644 --- a/Headers/gnustep/gui/NSNibLoading.h +++ b/Headers/gnustep/gui/NSNibLoading.h @@ -29,6 +29,7 @@ #define _GNUstep_H_NSNibLoading #include +#include @interface NSObject (NSNibAwaking) diff --git a/Headers/gnustep/gui/NSPasteboard.h b/Headers/gnustep/gui/NSPasteboard.h index 7621299ab..a031ff105 100644 --- a/Headers/gnustep/gui/NSPasteboard.h +++ b/Headers/gnustep/gui/NSPasteboard.h @@ -30,6 +30,7 @@ #define _GNUstep_H_NSPasteboard #include +#include @class NSString; @class NSArray; diff --git a/Headers/gnustep/gui/NSSpellServer.h b/Headers/gnustep/gui/NSSpellServer.h index 6b0c6e397..e98fed5e7 100644 --- a/Headers/gnustep/gui/NSSpellServer.h +++ b/Headers/gnustep/gui/NSSpellServer.h @@ -30,6 +30,7 @@ #define _GNUstep_H_NSSpellServer #include +#include @interface NSSpellServer : NSObject diff --git a/Headers/gnustep/gui/NSWindow.h b/Headers/gnustep/gui/NSWindow.h index b3beedb11..db751f101 100644 --- a/Headers/gnustep/gui/NSWindow.h +++ b/Headers/gnustep/gui/NSWindow.h @@ -33,7 +33,6 @@ #include #include #include -#include @class NSString; @class NSArray; diff --git a/Source/Functions.m b/Source/Functions.m deleted file mode 100644 index 92483fce0..000000000 --- a/Source/Functions.m +++ /dev/null @@ -1,73 +0,0 @@ -/* - Functions.m - - Generic Functions for the GNUstep GUI Library. - - Copyright (C) 1996 Free Software Foundation, Inc. - - Author: Scott Christley - Date: 1996 - - 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 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; see the file COPYING.LIB. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include - -#include - -#ifndef LIB_FOUNDATION_LIBRARY - -#include -#include - -// Should be in Foundation Kit -// Does not handle %@ -// yuck, yuck, yuck -extern LogFile *logFile; -void NSLogV(NSString *format, va_list args) -{ - char out[1024]; - - vsprintf(out, [format cString], args); - [logFile writeLog:out]; -} - -void NSLog(NSString *format, ...) -{ - va_list ap; - - va_start(ap, format); - NSLogV(format, ap); - va_end(ap); -} -#endif /* LIB_FOUNDATION_LIBRARY */ - -void NSNullLog(NSString *format, ...) -{ -} - -// -// Play the System Beep -// -void NSBeep(void) -{ -#ifdef WIN32 - MessageBeep(MB_OK); -#endif -} diff --git a/Source/LogFile.m b/Source/LogFile.m deleted file mode 100644 index 910cdcad3..000000000 --- a/Source/LogFile.m +++ /dev/null @@ -1,131 +0,0 @@ -/* - LogFile.m - - Logfile for recording trace messages - - Copyright (C) 1996 Free Software Foundation, Inc. - - Author: Scott Christley - Date: 1996 - - 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 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; see the file COPYING.LIB. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include - -@implementation LogFile - -// Class methods -+ (void)initialize -{ - // Initial version - if (self == [LogFile class]) - [self setVersion:1.0]; - -} - -// Instance methods -- init -{ - [super init]; - l_flags.is_locking = NO; - l_flags.is_date_logging = YES; - if (the_log) [self closeLog]; - return self; -} - -- (void)dealloc -{ - [self closeLog]; - return [super dealloc]; -} - -- initStdout -{ - [self init]; - return self; -} - -- initStdoutWithLocking -{ - [self init]; - l_flags.is_locking = YES; - return self; -} - -- initFile:(const char *)filename -{ - [self init]; - the_log = fopen(filename, "w"); - if (the_log) [self writeLog: "Start of Log\n"]; - if (!the_log) - return nil; - else - return self; -} - -- initFileWithLocking:(const char *)filename; -{ - [self init]; - l_flags.is_locking = YES; - the_log = fopen(filename, "w"); - if (the_log) [self writeLog: "Start of Log\n"]; - if (!the_log) - return nil; - else - return self; -} - -// Instance methods -- writeLog:(const char *)logEntry -{ - if (the_log == NULL) - printf("%s", logEntry); - else - { - fprintf(the_log, "%s", logEntry); - fflush(the_log); - } - return self; -} - -- closeLog -{ - [self writeLog:"Log closed.\n"]; - if (the_log) fclose(the_log); - the_log = NULL; - return self; -} - -- (BOOL)isDateLogging -{ - return (BOOL)l_flags.is_date_logging; -} - -- setDateLogging:(BOOL)flag -{ - l_flags.is_date_logging = flag; - return self; -} - -- (BOOL)isLocking -{ - return (BOOL)l_flags.is_locking; -} - -@end diff --git a/Source/Makefile.in b/Source/Makefile.in index 1c8cf24f7..3fbee7ee8 100644 --- a/Source/Makefile.in +++ b/Source/Makefile.in @@ -85,15 +85,12 @@ INIT_FILE_OBJ=$(INIT_FILE)$(oext) include $(srcdir)/../Version GNUSTEP1_HEADERS = gui/AppKit.h \ -gui/Functions.h \ -gui/LogFile.h \ gui/NSActionCell.h \ gui/NSApplication.h \ gui/NSBitmapImageRep.h \ gui/NSBox.h \ gui/NSBrowser.h \ gui/NSBrowserCell.h \ -gui/NSBundle.h \ gui/NSButton.h \ gui/NSButtonCell.h \ gui/NSCStringText.h \ @@ -121,6 +118,7 @@ gui/NSFontManager.h \ gui/NSFontPanel.h \ gui/NSForm.h \ gui/NSFormCell.h \ +gui/NSGraphics.h \ gui/NSHelpPanel.h \ gui/NSImage.h \ gui/NSImageRep.h \ @@ -233,7 +231,6 @@ NSWindow$(oext) \ NSWorkspace$(oext) \ Functions$(oext) \ TrackingRectangle$(oext) \ -LogFile$(oext) \ tiff$(oext) OBJS = $(OBJS_WITHOUT_INIT) diff --git a/Source/NSActionCell.m b/Source/NSActionCell.m index ca7a50a3e..22715085b 100644 --- a/Source/NSActionCell.m +++ b/Source/NSActionCell.m @@ -29,7 +29,6 @@ #include #include #include -#include @implementation NSActionCell diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 195ac056d..8787170db 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -38,7 +38,6 @@ #include #include #include -#include // // Class variables diff --git a/Source/NSButton.m b/Source/NSButton.m index e1cc80460..3dc3ac220 100644 --- a/Source/NSButton.m +++ b/Source/NSButton.m @@ -30,7 +30,6 @@ #include #include #include -#include // // class variables diff --git a/Source/NSCell.m b/Source/NSCell.m index 19bd076cb..abb2da127 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -33,7 +33,6 @@ #include #include #include -#include @implementation NSCell diff --git a/Source/NSControl.m b/Source/NSControl.m index 1c5d51ebf..ee778eeaf 100644 --- a/Source/NSControl.m +++ b/Source/NSControl.m @@ -29,7 +29,6 @@ #include #include #include -#include // // Class variables diff --git a/Source/NSEvent.m b/Source/NSEvent.m index b7fe224fe..86095b6b3 100644 --- a/Source/NSEvent.m +++ b/Source/NSEvent.m @@ -28,7 +28,6 @@ #include #include -#include @implementation NSEvent diff --git a/Source/NSFont.m b/Source/NSFont.m index 7a1a98f65..44ee2752a 100644 --- a/Source/NSFont.m +++ b/Source/NSFont.m @@ -64,10 +64,10 @@ static NSMutableSet* fontsUsed = nil; static NSFont* getFont(NSString* key, NSString* defaultFont, float fontSize) { NSString* fontName; - + fontName = [[NSUserDefaults standardUserDefaults] objectForKey:key]; if (!fontName) - fontName = defaultFont; + return [NSFont fontWithName: defaultFont size: fontSize]; return [NSFont fontWithName:fontName size:fontSize]; } diff --git a/Source/NSFontManager.m b/Source/NSFontManager.m index cbac60116..58831dfde 100644 --- a/Source/NSFontManager.m +++ b/Source/NSFontManager.m @@ -30,7 +30,6 @@ #include #include #include -#include // // Class variables diff --git a/Source/NSResponder.m b/Source/NSResponder.m index c908f555d..d07f03f01 100644 --- a/Source/NSResponder.m +++ b/Source/NSResponder.m @@ -29,7 +29,6 @@ #include #include #include -#include @implementation NSResponder diff --git a/Source/tiff.m b/Source/tiff.m index 56cdaae28..c091124a1 100644 --- a/Source/tiff.m +++ b/Source/tiff.m @@ -58,7 +58,6 @@ #include #include #include -#include #include #include @@ -250,7 +249,7 @@ NSTiffGetInfo(int imageNumber, TIFF* image) #define READ_SCANLINE(sample) \ if ( TIFFReadScanline( image, buf, row, sample ) < 0 ) { \ - fprintf(stderr, "tiff: bad data read on line %d\n", row ); \ + NSLog(@"tiff: bad data read on line %d\n", row ); \ error = 1; \ break; \ } \ @@ -351,7 +350,7 @@ NSTiffRead(int imageNumber, TIFF* image, NSTiffInfo* info, char* data) case PHOTOMETRIC_RGB: if (newinfo->planarConfig == PLANARCONFIG_CONTIG) { - NSLog(@"PHOTOMETRIC_RGB: CONTIG\n"); + NSDebugLog(@"PHOTOMETRIC_RGB: CONTIG\n"); for ( row = 0; row < newinfo->height; ++row ) { READ_SCANLINE(0) @@ -364,7 +363,7 @@ NSTiffRead(int imageNumber, TIFF* image, NSTiffInfo* info, char* data) } else { - NSLog(@"PHOTOMETRIC_RGB: NOT CONTIG\n"); + NSDebugLog(@"PHOTOMETRIC_RGB: NOT CONTIG\n"); for (i = 0; i < newinfo->samplesPerPixel; i++) for ( row = 0; row < newinfo->height; ++row ) {